From nobody Mon Feb 9 19:37:21 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22441C001DE for ; Fri, 4 Aug 2023 21:08:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230498AbjHDVIn (ORCPT ); Fri, 4 Aug 2023 17:08:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230349AbjHDVIP (ORCPT ); Fri, 4 Aug 2023 17:08:15 -0400 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DB4D4C3B for ; Fri, 4 Aug 2023 14:07:25 -0700 (PDT) Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-686ba97e4feso2333108b3a.0 for ; Fri, 04 Aug 2023 14:07:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691183243; x=1691788043; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VNDAtrU25aj6ZP4bQWj0APLJi4B34GsziEpWhng/8JI=; b=OIeIwYaKjUbKT7o1VfqN2rM1ojzUgZhYMNyt9GXc4au4BxZNaKrvf44cxwhOEOJk99 nUT67+6BP32EIAmgd7GMcbkz8LKuxhP0jJkTSsx+E1aBgQbHs1RHaAYkjX6bqWNTJe5O wxNBUpp4NIteLU6F6Iqk/orzGfTiIcdFm5DPo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691183243; x=1691788043; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VNDAtrU25aj6ZP4bQWj0APLJi4B34GsziEpWhng/8JI=; b=hQFJ95B0BQo5HRkSaPdfIyWDpm006Yu/xQ+jsq3B+OIHsMlZkjUS3EUfxajIrsTaO5 /y2nKN2aoWLSWaID8Q5wLVKiU56P43XW4Wg9j2lep+Z8uw1eQ5dzTDrgURJzM4iePAR6 XcJ7X+w0GFvqadr10HTH4KVDskZmvpvUqyjh5XPTdE5fKl4kUMJDCxMW4DaTI3yYTS7F wx0xnCc4DAf94TuiDVUPSIEsDNfGXtLojov6/ZVAG0mNP79wjRRhacyyZTvjqxGm39p6 BMdLuMWGBlaYRqDtIRvhiu765ZagEiioS6jD3BoXhGLe/mpoLG4Q86eGTwpUmJ/cHLSt gOsg== X-Gm-Message-State: AOJu0Yx7ngbXPbsoQc7CG/7Ac+9x17OlF8hYqA3rN4ysiJrNJ+ij9OLX Abj+pfSrA/FZBFHqHgAu8NqUPc8s8IdlfwcOuweWwTxf X-Google-Smtp-Source: AGHT+IFkbNOFoh/VI4k1FOKVvL/4zX2h+f9c0koj1hj0xdsNC4QSnnSpGjC+Wrgn2SfibLOdC4Cvgw== X-Received: by 2002:aa7:8884:0:b0:687:9909:3c75 with SMTP id z4-20020aa78884000000b0068799093c75mr3885000pfe.4.1691183243227; Fri, 04 Aug 2023 14:07:23 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:9d:2:e186:e5d2:e60:bad3]) by smtp.gmail.com with ESMTPSA id n22-20020aa78a56000000b0068664ace38asm2037584pfa.19.2023.08.04.14.07.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Aug 2023 14:07:22 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Douglas Anderson , Daniel Vetter , David Airlie , Javier Martinez Canillas , Jerry Han , Neil Armstrong , Ondrej Jirman , Sam Ravnborg , Stefan Mavrodiev , Sumit Semwal , linux-kernel@vger.kernel.org Subject: [RFC PATCH 05/10] drm/panel: Don't store+check prepared/enabled for panels needing shutdown Date: Fri, 4 Aug 2023 14:06:08 -0700 Message-ID: <20230804140605.RFC.5.Icc3238e91bc726d4b04c51a4acf67f001ec453d7@changeid> X-Mailer: git-send-email 2.41.0.585.gd2178a4bd4-goog In-Reply-To: <20230804210644.1862287-1-dianders@chromium.org> References: <20230804210644.1862287-1-dianders@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" As talked about in commit d2aacaf07395 ("drm/panel: Check for already prepared/enabled in drm_panel"), we want to remove needless code from panel drivers that was storing and double-checking the prepared/enabled state. Even if someone was relying on the double-check before, that double-check is now in the core and not needed in individual drivers. A number of panels seemed to need the extra double-checking of the prepared/enabled state to handle driver remove and/or shutdown. This set of drivers was easy to transform and used to call drm_panel_unprepare() and drm_panel_disable(). It's easy to move them to call the drm_panel_helper_shutdown() that does the double-checking for the panels. NOTE: this patch doesn't attempt to sanitize the shutdown or remove functions of these panels, it merely tries to preserve the old behavior while removing the need for the panels to track prepared/enabled state themselves. Specifically it can be noted that removing an in-use panel is not necessarily straightfoward and may not be correct in most panels. ALSO NOTE: some of the panels touched in this path used to not complain about disable/unprepare error at shutdown time. Now that we're using the drm_panel_helper_shutdown() function we'll consistently warn about these errors. THIRDLY NOTE: One of these panels, "boe-himax8279d", used to call its unprepare() and disable() functions directly instead of calling drm_panel_unprepare() and drm_panel_disable(). I believe that the only difference is that "boe-himax8279d" will now turn off its backlight at shutdown/remove. This will also pave the way if anyone wants to use this panel w/ the new "panel follower" APIs. Signed-off-by: Douglas Anderson --- drivers/gpu/drm/panel/panel-boe-himax8279d.c | 36 ++----------- .../gpu/drm/panel/panel-boe-tv101wum-nl6.c | 16 +----- drivers/gpu/drm/panel/panel-edp.c | 34 ++----------- drivers/gpu/drm/panel/panel-elida-kd35t133.c | 21 +------- drivers/gpu/drm/panel/panel-himax-hx8394.c | 21 +------- drivers/gpu/drm/panel/panel-innolux-p079zca.c | 51 ++----------------- drivers/gpu/drm/panel/panel-khadas-ts050.c | 35 ++----------- .../drm/panel/panel-kingdisplay-kd097d04.c | 43 ++-------------- .../drm/panel/panel-leadtek-ltk050h3146w.c | 21 +------- .../drm/panel/panel-leadtek-ltk500hd1829.c | 21 +------- .../gpu/drm/panel/panel-novatek-nt36672a.c | 24 ++------- .../drm/panel/panel-olimex-lcd-olinuxino.c | 45 +--------------- .../drm/panel/panel-osd-osd101t2587-53ts.c | 37 ++------------ .../gpu/drm/panel/panel-samsung-atna33xc20.c | 31 ++--------- drivers/gpu/drm/panel/panel-simple.c | 34 ++----------- drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c | 19 ++----- .../gpu/drm/panel/panel-xinpeng-xpp055c272.c | 21 +------- 17 files changed, 45 insertions(+), 465 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-boe-himax8279d.c b/drivers/gpu/drm= /panel/panel-boe-himax8279d.c index 11b64acbe8a9..cccf9400fa99 100644 --- a/drivers/gpu/drm/panel/panel-boe-himax8279d.c +++ b/drivers/gpu/drm/panel/panel-boe-himax8279d.c @@ -18,6 +18,7 @@ #include #include #include +#include =20 #include