From patchwork Fri Aug 4 21:06:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 13342360 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1385CC001DE for ; Fri, 4 Aug 2023 21:07:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B1BE610E12F; Fri, 4 Aug 2023 21:07:30 +0000 (UTC) Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by gabe.freedesktop.org (Postfix) with ESMTPS id BEC2A10E12F for ; Fri, 4 Aug 2023 21:07:24 +0000 (UTC) Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-686ba97e4feso2333118b3a.0 for ; Fri, 04 Aug 2023 14:07:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691183244; x=1691788044; 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=N6dNfcKtQXSBke+mS4nTeXCQtCgohPrw4TJPlo/PdyO5S1VfnJ0lLEF5d6rrflEVsf aimcxuM4ZwvGDe4cNiVLrqdlOaUEGJLyRSTegRpvymbhG/yRHvfWdvI7dCMGVrjRDTtw wTp4mI50n4njBi6P4ZmqVJcbX9jNMdOv4MnA0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691183244; x=1691788044; 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=N4btuwXLzqqYoKXb+BIrqcbczGtZGDtaoLBy6/4A0rRYxFb+ZBA4gio/EiuRZ4gZjV 1KUZLQiREKsQVjJ7bmoB6fft7mPspWO0grmwxW5FoumHBJ+kXchSmru17LtezBUakeSk Qm5Xx8SgKiBJwaWETvLDAUAgkqXO04niW1si/Y4wdNmhKfkxJW+/DVls0Ys4ky0SxmSc jSwsE9JbpljfKeueXmIM22zG6SIaTh6tc0NknsUnuiAQSFlh4k2GA2ija9n46fTP90/J aJEQ4IKfISDMf8HA8KPW8Gt8IYxVrX1QONdfspLLwbvl7gfYRBbARDL7JmdjH36XIble QSxA== X-Gm-Message-State: AOJu0Yw2cogA1n43RHwSMVFEcMprROemao8CUmALD1HkAubIdoHFsUNe Uz5A9E3yqoOqwMriorbSjNqtxROwiuIXOvsnkK1LpYbS 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 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 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , Stefan Mavrodiev , Sam Ravnborg , Jerry Han , Douglas Anderson , Javier Martinez Canillas , Ondrej Jirman , Sumit Semwal , linux-kernel@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 #include