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: 131362 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp113531vqr; Fri, 4 Aug 2023 14:37:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGjsEiIGSsd5ZP2b0gHTzIQC5UIlGL+qhnT9oCR8L/Z+tUoXsZEt2z1Kx1cd/0hvUAnnT/Y X-Received: by 2002:ac2:5e90:0:b0:4fb:c657:3376 with SMTP id b16-20020ac25e90000000b004fbc6573376mr1957763lfq.29.1691185027948; Fri, 04 Aug 2023 14:37:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691185027; cv=none; d=google.com; s=arc-20160816; b=P+UlxCCjEe1IkIan4VNF4WaAH4n63kI7nnTjY6z/i24Y+BO3Aa4DNIVD2CbC4jqtu2 gn8SF3xRhIRa0yU+AfxugdYyP0YhgjLZfGFU+LS/G6kIQ4AqSfKByv9ipUcQNJczvRR2 8yRjongFHy4Rx6Pt2ccDvTNa0hh0ATEQD6QjIhDLZClg+3kh3HoYi97uhSBIdV6fPCPT WhcwGZPFnIvD+XRELcOCBek97lTflT3exM+rLY4VlzSQFQs+6KZf6Lo8cF4mh3zLsbu/ W3tlxta9uzFyksiu8BBs08KrXOTr6+GHjd7ZWRP1Mu9NoTAFpDvR7sxFLYLDIDffkZ5m AtpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=VNDAtrU25aj6ZP4bQWj0APLJi4B34GsziEpWhng/8JI=; fh=hqPcgtUOZMViQGxnmqePZRdmhmw2HEgIqEKo3NfIUrM=; b=AsW8ili4+065BXnjmMmWHn8n/XrzL8TF3m3SE2mR8Vbzn2nJauvAQJy1+OtQi8Tder GQ4RHVehRB6DLpFpRueyUSM3y/xXhIUZrXgRHWhProWT1GCYMU0Qv7cbjAFYorxtrSj3 ajWubL1ANPYmyOKdbWtvSymcgPbhIjSrJIzQtmsQKN59DagWC17Ttks3fjYRx0Hc6G/5 hwUaKVPXxEgCqpfsCPkAqBRpUlb1D5ItBt43pGI14x7pnBwF9uikK5elsPMD+FXxs9f3 /FajM5tYDivZojhRsf75z5PElTljxXz7DS1lxqUtvIH4F1QSyaOHiBEbaCE1zz5Sz4TD l6og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=OIeIwYaK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z25-20020aa7cf99000000b00522ac23622dsi2194929edx.168.2023.08.04.14.36.44; Fri, 04 Aug 2023 14:37:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=OIeIwYaK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230495AbjHDVIn (ORCPT + 99 others); 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-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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773336031761054118 X-GMAIL-MSGID: 1773336031761054118 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