From patchwork Fri May 3 21:32:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 13653499 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 80A18C4345F for ; Fri, 3 May 2024 21:36:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=24Ia6Y29j69U0gswK+vfYaS7DKaApYr92TfscQl6bz0=; b=QQHHEPf8mYK0fe N4u+oEbhqE9kXu797ZsOs0X9P4Q6rsnLjTgoUdU69ZKrcbNL6L8KCs1IoiQ0czTg7qj88rR1Rffm8 8dls9mnpew7hoOXRC86cd1W60gveTowMl2W9luwWnDrjVnCaNo2pmOwm6VDeTw/F4knz4FCHj+66x RJk5rjfegRaFQON01ZD6U7t9RNn4uAR6QtJ5DFARNRuHpxvKVQPD8oEsz9vg+Zuxr68S1jVRuSlbh HSnAVwBrOTmCjvyXbzlif7VHtBlB5CeSzKwG7MexZ8nP7ZoVAIH2ByyZbwVcIFl4/Cuy7vO6/Z9R7 /8S1RdmQP8aH8vNDgPPQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s30aB-00000000RfF-085D; Fri, 03 May 2024 21:36:43 +0000 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s30Zx-00000000RSL-2TGV for linux-arm-kernel@lists.infradead.org; Fri, 03 May 2024 21:36:35 +0000 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1ec69e3dbcfso1119245ad.0 for ; Fri, 03 May 2024 14:36:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772187; x=1715376987; darn=lists.infradead.org; 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=YlLGPoCdKZFYuD2WMpAl+nCcCPU9f5yFXStRl2ODaEI=; b=HWeMaVORAwUOROjzNK1e1+6t3c7yxL5htOD7qktr2+pYtSBYAePfLYXdjJAoE/NEDH ToGd0STyXpiFVKOe6Gtctu73CZ8iySh2I6C95qS9JXa73W8dcRGnzhdxBcAOGYqbPCqr s+20QWeXktSJJfMDmpCtHEdRYF35C7U/V9nJY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772187; x=1715376987; 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=YlLGPoCdKZFYuD2WMpAl+nCcCPU9f5yFXStRl2ODaEI=; b=YaYQrlvc9Kjns1ATeznfbb5xkBxnJNxT8qxkNLVJa8+hFIQ48VZVQ2/rSZOMp1CkEG s6WD/eRApuR6KF/TkKMVRZ9GUVndyNmUJhM0VlVvMVM4rQyIV+t+H56QXmZGib0PR3Jh cc2mdDtmSTgZR00aOex8KHuQ0+0KWDWATggUPWJip0Y51Xu+R00OcpbhToprBLO0T19I ctYdGyRyza0mkOg7XS2fWieEhbcuuo0udwgZYEYO0LMbTBl8OlVZi0xECcr5Vr7kE4YB rmeCqtbx6IVvqpIaUEOPzWjZeDYWcav6S6yTm2WMs5f3Mwsi3ytOG98qqrKEum+Fh1tu ArBw== X-Forwarded-Encrypted: i=1; AJvYcCV1Fvr/XF357vmChtgQ4iOM+J0l2rfiyegWyUQQpWTKnN3FiJVqcCJV2ppViId+Ev2zSi7dfKJe9ix8azFKf7dsQ/xRL3n3KEQiVbLZyN2J43o24KI= X-Gm-Message-State: AOJu0YzrXqsTwMtp7hcAZNTd/66QBzM9RP1nrVpU1Pb+pCQvnTPbjtEX 6VO3aF3Qs3FRTk61Zfj3sXrIOKEhtRj74Bc7vatm5QUCgJwvoRb7fyn3f7AeIg== X-Google-Smtp-Source: AGHT+IFaMjrOZx6PlnR9YpeAGNYEPKz0BZS22xq3/WCuAMWn8FGGgonr0VuEXbwoSJfpxSoPjNw6pg== X-Received: by 2002:a17:902:db0e:b0:1ec:3227:94ea with SMTP id m14-20020a170902db0e00b001ec322794eamr4805493plx.67.1714772187608; Fri, 03 May 2024 14:36:27 -0700 (PDT) Received: from dianders.sjc.corp.google.com ([2620:15c:9d:2:fb6a:b54b:7580:64f3]) by smtp.gmail.com with ESMTPSA id j12-20020a170903024c00b001eb51a46f5bsm3729134plh.43.2024.05.03.14.36.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:36:27 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , Jerry Han , Jitao Shi , Rock Wang , AngeloGioacchino Del Regno , Daniel Vetter , David Airlie , Jerry Han , Jessica Zhang , Maarten Lankhorst , Matthias Brugger , Sam Ravnborg , Thomas Zimmermann , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [RFT PATCH v2 02/48] drm/panel: boe-himax8279d: Stop tracking prepared/enabled Date: Fri, 3 May 2024 14:32:43 -0700 Message-ID: <20240503143327.RFT.v2.2.Ia3f254ab6e04e4f7afba6c066454498c8fb01324@changeid> X-Mailer: git-send-email 2.45.0.rc1.225.g2a3ae87e7f-goog In-Reply-To: <20240503213441.177109-1-dianders@chromium.org> References: <20240503213441.177109-1-dianders@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240503_143629_750713_EE19F7AC X-CRM114-Status: GOOD ( 17.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. NOTE: as part of this, transition the panel's direct calls to its disable/unprepare functions in shutdown/remove to call through DRM panel. Cc: Jerry Han Cc: Jitao Shi Cc: Rock Wang Signed-off-by: Douglas Anderson --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. drivers/gpu/drm/panel/panel-boe-himax8279d.c | 31 +++----------------- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-boe-himax8279d.c b/drivers/gpu/drm/panel/panel-boe-himax8279d.c index e225840b0d67..12e14615298b 100644 --- a/drivers/gpu/drm/panel/panel-boe-himax8279d.c +++ b/drivers/gpu/drm/panel/panel-boe-himax8279d.c @@ -47,9 +47,6 @@ struct panel_info { struct gpio_desc *enable_gpio; struct gpio_desc *pp33_gpio; struct gpio_desc *pp18_gpio; - - bool prepared; - bool enabled; }; static inline struct panel_info *to_panel_info(struct drm_panel *panel) @@ -86,17 +83,12 @@ static int boe_panel_disable(struct drm_panel *panel) struct panel_info *pinfo = to_panel_info(panel); int err; - if (!pinfo->enabled) - return 0; - err = mipi_dsi_dcs_set_display_off(pinfo->link); if (err < 0) { dev_err(panel->dev, "failed to set display off: %d\n", err); return err; } - pinfo->enabled = false; - return 0; } @@ -105,9 +97,6 @@ static int boe_panel_unprepare(struct drm_panel *panel) struct panel_info *pinfo = to_panel_info(panel); int err; - if (!pinfo->prepared) - return 0; - err = mipi_dsi_dcs_set_display_off(pinfo->link); if (err < 0) dev_err(panel->dev, "failed to set display off: %d\n", err); @@ -121,8 +110,6 @@ static int boe_panel_unprepare(struct drm_panel *panel) disable_gpios(pinfo); - pinfo->prepared = false; - return 0; } @@ -131,9 +118,6 @@ static int boe_panel_prepare(struct drm_panel *panel) struct panel_info *pinfo = to_panel_info(panel); int err; - if (pinfo->prepared) - return 0; - gpiod_set_value(pinfo->pp18_gpio, 1); /* T1: 5ms - 6ms */ usleep_range(5000, 6000); @@ -180,8 +164,6 @@ static int boe_panel_prepare(struct drm_panel *panel) /* T7: 20ms - 21ms */ usleep_range(20000, 21000); - pinfo->prepared = true; - return 0; poweroff: @@ -194,9 +176,6 @@ static int boe_panel_enable(struct drm_panel *panel) struct panel_info *pinfo = to_panel_info(panel); int ret; - if (pinfo->enabled) - return 0; - usleep_range(120000, 121000); ret = mipi_dsi_dcs_set_display_on(pinfo->link); @@ -205,8 +184,6 @@ static int boe_panel_enable(struct drm_panel *panel) return ret; } - pinfo->enabled = true; - return 0; } @@ -917,11 +894,11 @@ static void panel_remove(struct mipi_dsi_device *dsi) struct panel_info *pinfo = mipi_dsi_get_drvdata(dsi); int err; - err = boe_panel_disable(&pinfo->base); + err = drm_panel_disable(&pinfo->base); if (err < 0) dev_err(&dsi->dev, "failed to disable panel: %d\n", err); - err = boe_panel_unprepare(&pinfo->base); + err = drm_panel_unprepare(&pinfo->base); if (err < 0) dev_err(&dsi->dev, "failed to unprepare panel: %d\n", err); @@ -936,8 +913,8 @@ static void panel_shutdown(struct mipi_dsi_device *dsi) { struct panel_info *pinfo = mipi_dsi_get_drvdata(dsi); - boe_panel_disable(&pinfo->base); - boe_panel_unprepare(&pinfo->base); + drm_panel_disable(&pinfo->base); + drm_panel_unprepare(&pinfo->base); } static struct mipi_dsi_driver panel_driver = { From patchwork Fri May 3 21:32:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 13653500 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 D825EC25B5F for ; Fri, 3 May 2024 21:36:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=132hMy4Va2EW2gthvDKsnYBbdO+NhiK0oucSFshmusk=; b=fqVcOUJxuLujNc ivVaHbdkwiEkjnb5GlTAy3ggcYGgta2SW5xumDs9SBoRxG10tniWuLRrY2k8liMEvXyHClA7GFdfp +Qf932HV8N+antjqnnN1X2Kq2aiT2iOt0MsWjrxOfD1YU2CyYb0szGirXSx5UlpyPxKd42wF+rQHW wkAOjx3cfLXYN9DSEARmoqJ4TM6G3ZaBxsJzKnoy/sFyrtLFUpQu3fbrszwoqT+ZibQugEFMfGMEZ xISBnpqQ4Qza/ilGEANS3NZ967HtMmCTocir8kod+UDK65acf4xLsEgdzO8mOh4JOmljV3HQ8Mrer 1fHdZ10iz37fyDtQBCkw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s30a7-00000000RcY-2T0h; Fri, 03 May 2024 21:36:39 +0000 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s30a1-00000000RV2-16xO for linux-arm-kernel@lists.infradead.org; Fri, 03 May 2024 21:36:35 +0000 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1e4c4fb6af3so950975ad.0 for ; Fri, 03 May 2024 14:36:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772191; x=1715376991; darn=lists.infradead.org; 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=ivwzpk8LV8o9VOgpaEI0wSikxdx7Ris0rIA4UDrHOxM=; b=ETZaGtJoSOoOBpMvew+ZbN0iU1MzTn8e4ed1FTTf+AjV4sz5UcwVvod/a35IfOad9/ pN+lqNx1PVejw11m5QQug8ivbj2E/TKENVwBCeJDSwJl/ziqhLJZCycXyHJa3j6do3eh Xo6bdC0VV5M0XzRmzT4FhBtEA4Dc6EObzTtG0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772191; x=1715376991; 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=ivwzpk8LV8o9VOgpaEI0wSikxdx7Ris0rIA4UDrHOxM=; b=ws2YxUpnb/gSNh8Gx0aW7b+f3MUBJHgJU6fGqv5XYU2F6dCajrFv6r9evH8TbHGDws eBWX1eUl0nMm4Mrt1QwBmuZQU0J4zybo+lPtJ5t7hW4sWVrT8n7kxBTGOW7VGI9JvQRm +zF4nnscdSydWKmC/XYcLn6yUdWyGez+52EMwjRV3LhfEY8cgiMgQ8bmqDOwZ3Rn6Rep FfZsXa45CanKX7XbZsoYks1ifQrzA3/+0gqLqkXJzsvSn+WDFhfK8+CViNglhZNIGiRQ 2pWPuS2Kv2rhv4hmrG24rwhrtxN8zteOrpnmLejRbfOaS26sgAGc9EDM6nSn1oslwJik ivKA== X-Forwarded-Encrypted: i=1; AJvYcCW5rJZz5w9wNJ87xQg01QOnnujq4AgoPnzLbFldG1MZYARXTv8JbMNkuRhy+RpHcehPbq/5c2Pefe/grDYuQMujLY57ixCYiCU5EgkjcYS/FZuMJbo= X-Gm-Message-State: AOJu0YywrjUvSf0CVFPu6dYxvacSgyKDJ5WKxwWzmuYMoFF7AS5CM7aG 0qlvvrxWl9g9vPTz74ZENV6QyHVzCTaMAh4h/BsbObP80iAsJY/bUaeLpTrdHg== X-Google-Smtp-Source: AGHT+IEhtQwHX90SwQBe2NnOXhamncltrhxwpD6fYsYZstR87YJRnxBbL7AN6shwzv3NIn/AynD71A== X-Received: by 2002:a17:902:d093:b0:1e0:a2cf:62e8 with SMTP id v19-20020a170902d09300b001e0a2cf62e8mr6761839plv.10.1714772190912; Fri, 03 May 2024 14:36:30 -0700 (PDT) Received: from dianders.sjc.corp.google.com ([2620:15c:9d:2:fb6a:b54b:7580:64f3]) by smtp.gmail.com with ESMTPSA id j12-20020a170903024c00b001eb51a46f5bsm3729134plh.43.2024.05.03.14.36.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:36:30 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , Jerry Han , Jitao Shi , Rock Wang , AngeloGioacchino Del Regno , Daniel Vetter , David Airlie , Jerry Han , Jessica Zhang , Maarten Lankhorst , Matthias Brugger , Sam Ravnborg , Thomas Zimmermann , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [RFT PATCH v2 03/48] drm/panel: boe-himax8279d: Don't call unprepare+disable at shutdown/remove Date: Fri, 3 May 2024 14:32:44 -0700 Message-ID: <20240503143327.RFT.v2.3.I19086c524d38f28f746befe85cb39ffda9d2f666@changeid> X-Mailer: git-send-email 2.45.0.rc1.225.g2a3ae87e7f-goog In-Reply-To: <20240503213441.177109-1-dianders@chromium.org> References: <20240503213441.177109-1-dianders@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240503_143633_446612_7BE139D8 X-CRM114-Status: GOOD ( 16.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org It's the responsibility of a correctly written DRM modeset driver to call drm_atomic_helper_shutdown() at shutdown time and that should be disabling / unpreparing the panel if needed. Panel drivers shouldn't be calling these functions themselves. A recent effort was made to fix as many DRM modeset drivers as possible [1] [2] [3] and most drivers are fixed now. Unfortunately, grepping mainline for this panel's compatible string shows no hits, so we can't be 100% sure if the DRM modeset driver used with this panel has been fixed. If it is found that the DRM modeset driver hasn't been fixed then this patch could be temporarily reverted until it is. [1] https://lore.kernel.org/r/20230901234015.566018-1-dianders@chromium.org [2] https://lore.kernel.org/r/20230901234202.566951-1-dianders@chromium.org [3] https://lore.kernel.org/r/20230921192749.1542462-1-dianders@chromium.org Cc: Jerry Han Cc: Jitao Shi Cc: Rock Wang Signed-off-by: Douglas Anderson --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. drivers/gpu/drm/panel/panel-boe-himax8279d.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-boe-himax8279d.c b/drivers/gpu/drm/panel/panel-boe-himax8279d.c index 12e14615298b..df746baae301 100644 --- a/drivers/gpu/drm/panel/panel-boe-himax8279d.c +++ b/drivers/gpu/drm/panel/panel-boe-himax8279d.c @@ -894,14 +894,6 @@ static void panel_remove(struct mipi_dsi_device *dsi) struct panel_info *pinfo = mipi_dsi_get_drvdata(dsi); int err; - err = drm_panel_disable(&pinfo->base); - if (err < 0) - dev_err(&dsi->dev, "failed to disable panel: %d\n", err); - - err = drm_panel_unprepare(&pinfo->base); - if (err < 0) - dev_err(&dsi->dev, "failed to unprepare panel: %d\n", err); - err = mipi_dsi_detach(dsi); if (err < 0) dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err); @@ -909,14 +901,6 @@ static void panel_remove(struct mipi_dsi_device *dsi) drm_panel_remove(&pinfo->base); } -static void panel_shutdown(struct mipi_dsi_device *dsi) -{ - struct panel_info *pinfo = mipi_dsi_get_drvdata(dsi); - - drm_panel_disable(&pinfo->base); - drm_panel_unprepare(&pinfo->base); -} - static struct mipi_dsi_driver panel_driver = { .driver = { .name = "panel-boe-himax8279d", @@ -924,7 +908,6 @@ static struct mipi_dsi_driver panel_driver = { }, .probe = panel_probe, .remove = panel_remove, - .shutdown = panel_shutdown, }; module_mipi_dsi_driver(panel_driver); From patchwork Fri May 3 21:32:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 13653665 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 1F231C4345F for ; Fri, 3 May 2024 22:46:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SuY5S0M2FbTVxIxNi1UlFLVvg0vU6pK3jhgRh8vyKfA=; b=izQFxBJaZTuyEd mmx5PPQhOOKpvlZFUqP9yKEGl4wa1R9zWsvs1VtINMxPKedNp+KAJWxg/Au97/im4KEftQkXlShgd AyMgcPsebNhB7b3K+IB/5V2h/3FtjLfqoYNycE2urf6y94I/cBGRLLogXy9n841HOS85L+TutMMlk m/155rqkTAyvzDbSmpsJdSN7GRAillmWFumqwMgpuKoz03t+/VeYKnez8X5/VJUEZXxAUSRMq+yKF Hdm+UByL5FW25eNBMtXhM1bQNbH5uW2/YM3hA9Ln4Ufsxj+oHtC0OVam3h3joWHgm44YIiy1MRjVx S9XjWrrDgVZsr3gF8pjA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s31fm-00000000eQP-27SE; Fri, 03 May 2024 22:46:34 +0000 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s30a3-00000000RY8-1Vo7 for linux-arm-kernel@lists.infradead.org; Fri, 03 May 2024 21:36:38 +0000 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1eab16c8d83so853245ad.3 for ; Fri, 03 May 2024 14:36:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772194; x=1715376994; darn=lists.infradead.org; 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=oJSS1xLEfY3Y1Nc4TX+Fmok5eKTdIJMR9yqmN0qgIiI=; b=HINDPiK06Ur6vaW0feaQ8stX4MCvSpV2vYIGuzEA6PnGYkSLsToGDt/ft3HJhUrDBQ 1qB16Wh+yB4sHEC/7Wjn2bXLFQFY1hN78gGVdEuCBEM4P2VSBzjAdLVYcJ1shWtkzMls yq/W2C0GOavW0dlD0TZPf/oFrxX2G/0QGdm8s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772194; x=1715376994; 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=oJSS1xLEfY3Y1Nc4TX+Fmok5eKTdIJMR9yqmN0qgIiI=; b=nhxxMYNOgmEer0BeqHbRcHYkzsQEdO6aLwZ757qIKD70gYQ8zBuSeAT77b8iQOObZC 6+QEyY2zaYbOVrtNWg7STYePfDFriQ0Qq7sIl3sj64T0UdAvh9HdW+KdlKnWidW/4Jlg 6IHPx6pHOqMSN7llT7BdYAtmcDSVlrcj3BKbTuS71wW/PdKLJYPD21QtzByEuR9Yh2Ct P4EYfolfRr6HnlLnoxb1XSIK9AG0Ds3iG+tALIUzmIPJy25kkrc87496PiR/6f+kThs8 n4CcIDeWQPDeD3gdg4FrOhhCGSs88/DWv0ee4guP2izJSQVH2HPLrHm0iTPKAC4rYaT/ dRwA== X-Forwarded-Encrypted: i=1; AJvYcCUYuOPB2EBBrW70ovKDZAIYMMZWVhpeduAn6WmrJhm3a/b9iGM7NFZYvgsDE078G+gyVvhMyVsay0sPwI5QPUlmpuKhocdOdea906N13XDITuvbmBY= X-Gm-Message-State: AOJu0YyaoF4Nr31OlR/rVH+oXBMvogH7fK1JVcspBMsrXvnmbfPDGxwV 6wIITtUGuSoekrPLyo/cPmR2E7hJdX6NecyhO3l+HBiVSs341wXuJLnCstb5xQ== X-Google-Smtp-Source: AGHT+IF/xaXv/X0Wte4aZNJO+64pdFolxJxdcSTQcUQ0uEZBKmCrVQEqCkWitBuj2PfiwIvx+UWLZQ== X-Received: by 2002:a17:903:41d1:b0:1ec:22ca:b290 with SMTP id u17-20020a17090341d100b001ec22cab290mr5154916ple.21.1714772194313; Fri, 03 May 2024 14:36:34 -0700 (PDT) Received: from dianders.sjc.corp.google.com ([2620:15c:9d:2:fb6a:b54b:7580:64f3]) by smtp.gmail.com with ESMTPSA id j12-20020a170903024c00b001eb51a46f5bsm3729134plh.43.2024.05.03.14.36.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:36:32 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , Jitao Shi , Cong Yang , AngeloGioacchino Del Regno , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Matthias Brugger , Sam Ravnborg , Thomas Zimmermann , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [RFT PATCH v2 04/48] drm/panel: boe-tv101wum-nl6: Stop tracking prepared Date: Fri, 3 May 2024 14:32:45 -0700 Message-ID: <20240503143327.RFT.v2.4.Ib501f2eceb62016e09cfb17bca29bde0f605a567@changeid> X-Mailer: git-send-email 2.45.0.rc1.225.g2a3ae87e7f-goog In-Reply-To: <20240503213441.177109-1-dianders@chromium.org> References: <20240503213441.177109-1-dianders@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240503_143635_734609_74C0F6A5 X-CRM114-Status: GOOD ( 14.47 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. Cc: Jitao Shi Cc: Cong Yang Signed-off-by: Douglas Anderson --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c index 0ffe8f8c01de..667e1bb4a58b 100644 --- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c +++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c @@ -50,8 +50,6 @@ struct boe_panel { struct regulator *avee; struct regulator *avdd; struct gpio_desc *enable_gpio; - - bool prepared; }; enum dsi_cmd_type { @@ -1450,9 +1448,6 @@ static int boe_panel_unprepare(struct drm_panel *panel) { struct boe_panel *boe = to_boe_panel(panel); - if (!boe->prepared) - return 0; - if (boe->desc->discharge_on_disable) { regulator_disable(boe->avee); regulator_disable(boe->avdd); @@ -1471,8 +1466,6 @@ static int boe_panel_unprepare(struct drm_panel *panel) regulator_disable(boe->pp3300); } - boe->prepared = false; - return 0; } @@ -1481,9 +1474,6 @@ static int boe_panel_prepare(struct drm_panel *panel) struct boe_panel *boe = to_boe_panel(panel); int ret; - if (boe->prepared) - return 0; - gpiod_set_value(boe->enable_gpio, 0); usleep_range(1000, 1500); @@ -1523,8 +1513,6 @@ static int boe_panel_prepare(struct drm_panel *panel) goto poweroff; } - boe->prepared = true; - return 0; poweroff: From patchwork Fri May 3 21:32:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 13653501 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 25ADDC4345F for ; Fri, 3 May 2024 21:45:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qkF7ac41bcVtYeEIezHW+PFr0pbmRziq7/fuHjlUWIM=; b=LZsDqzfK6ZBk0c K4BD5qIO83TvzVF3Y61NVrpRQlQg2pwms41PgjMkQ9LThsG6h0vul4x1XT8FvJOIjMhEOn7kskw1g V/j+bssFXYVDTbx/6lL3bMdmtXcKnL4F/ohzZ2NLsQvVqA1RxboeeX5x45OQzpdHl2l4OHa7k2PSk IBl4R/AX86yVQdeJuR32VmrB5k9kmmVy6MVxhoCR2dDeUFb3TtovmKmLQY6xLTFh27ebta4cKzIPO PAmxWjZ8jkJC9QANyDSMZuSKtdB1sKWZmfqe83N5gK/sPM2oLMpZ/u2WlV1L2vMVAHptB9dZFQn8H xzZO5aO70hjvOKllW4lQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s30i5-00000000UK9-1xDo; Fri, 03 May 2024 21:44:53 +0000 Received: from mail-yb1-xb2b.google.com ([2607:f8b0:4864:20::b2b]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s30i2-00000000UGq-1FdE for linux-arm-kernel@lists.infradead.org; Fri, 03 May 2024 21:44:51 +0000 Received: by mail-yb1-xb2b.google.com with SMTP id 3f1490d57ef6-de4665b4969so133533276.2 for ; Fri, 03 May 2024 14:44:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772679; x=1715377479; darn=lists.infradead.org; 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=Kta59gfQkdmQ0TL4kfPKXK/PL72P/0YD8zIuorS00AE=; b=G7JvCv/wdVUsGEPaHfLuGQGaFgjOMt1PHx2y+wdLkXZkn5vlUV2QiIbRRh1qqxMQDP 8NaV9lfZOKF85RMoNmvGvyPXKC2CkMpGqwZE7XJtVKT51p/xDrq3P0r+fTQBHJaB2S5a 9dt0TupdmSVWC45eldKpoGAdWsh7fo423eG2w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772679; x=1715377479; 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=Kta59gfQkdmQ0TL4kfPKXK/PL72P/0YD8zIuorS00AE=; b=HkfBZqmCsK7cDG1kmMsPGHPBlbiq8Q7SJlkyvcGLIfM+etlEfZrJMVXGtLUsqznFot ZxfJurV05TnyvjOvbXImqb4qg9mrgt9D6Wz/H0irEnZbhMQ/ToFybSn3qKLX1V5X86k+ 3f5g2/LsW5eRcVpPLA/rkQQBqnmGIzvRuI/RLCX3Dbv9aRywvh3o3Yt0hqCj/IqQ13JE 6OCxCnkDyu8JXMkFDkkAUSla2T0x9FT2EAJmQeNCx2kd5JgUEJJV+reyjwJecHztB+U9 ph7OvVl8DOddPKWaVs/d9yDT3W1tjij3EdCpzGDLZbaQXoLOpC/jTRDbXvV7ODDAUwiY dxmw== X-Forwarded-Encrypted: i=1; AJvYcCUjwGJoB+KhkjERiAyYni02YfxikHgUUpx3eVk6Ck8096I4Leo5bfemXxSyTWYgCflyCmhqOOjTbVvhrnKSTRBVb2UI3PKnDN++YdQU45omHC9OhGs= X-Gm-Message-State: AOJu0YxlkLjgWuyIXZfuiBuefB9n20NaDh3cPXDYXF+FxqtNs73ZSApd 7hhKGrEKlLbo181HAVg/pTlK5i4UEvp4PzdO/6tj4T6pFmE7QMMAWi/28ffFye0vzPENRb3AkOp iFQ== X-Google-Smtp-Source: AGHT+IHVhWhn4/nQtVyQZZLqUsnywWTqYGnhPIFneTo2Pek/30GOWy84nbyfus1Fy+LIRhpR3w7cFQ== X-Received: by 2002:a17:902:d4c7:b0:1e5:4f5:7fa7 with SMTP id o7-20020a170902d4c700b001e504f57fa7mr5769734plg.21.1714772197003; Fri, 03 May 2024 14:36:37 -0700 (PDT) Received: from dianders.sjc.corp.google.com ([2620:15c:9d:2:fb6a:b54b:7580:64f3]) by smtp.gmail.com with ESMTPSA id j12-20020a170903024c00b001eb51a46f5bsm3729134plh.43.2024.05.03.14.36.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:36:36 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , Jitao Shi , Cong Yang , AngeloGioacchino Del Regno , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Matthias Brugger , Sam Ravnborg , Thomas Zimmermann , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [RFT PATCH v2 05/48] drm/panel: boe-tv101wum-nl6: Don't call unprepare+disable at shutdown/remove Date: Fri, 3 May 2024 14:32:46 -0700 Message-ID: <20240503143327.RFT.v2.5.I5bd120aa0b7d17a1149ea43cc4852492834058c0@changeid> X-Mailer: git-send-email 2.45.0.rc1.225.g2a3ae87e7f-goog In-Reply-To: <20240503213441.177109-1-dianders@chromium.org> References: <20240503213441.177109-1-dianders@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240503_144450_342881_28FA0643 X-CRM114-Status: GOOD ( 15.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org It's the responsibility of a correctly written DRM modeset driver to call drm_atomic_helper_shutdown() at shutdown time and that should be disabling / unpreparing the panel if needed. Panel drivers shouldn't be calling these functions themselves. A recent effort was made to fix as many DRM modeset drivers as possible [1] [2] [3] and most drivers are fixed now. A grep through mainline for compatible strings used by this driver indicates that it is used by Mediatek and Qualcomm boards. Both of those drivers appear to be correctly calling drm_atomic_helper_shutdown() so we can remove the calls. [1] https://lore.kernel.org/r/20230901234015.566018-1-dianders@chromium.org [2] https://lore.kernel.org/r/20230901234202.566951-1-dianders@chromium.org [3] https://lore.kernel.org/r/20230921192749.1542462-1-dianders@chromium.org Cc: Jitao Shi Cc: Cong Yang Signed-off-by: Douglas Anderson --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c index 667e1bb4a58b..77b20e24cac7 100644 --- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c +++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c @@ -1910,21 +1910,11 @@ static int boe_panel_probe(struct mipi_dsi_device *dsi) return ret; } -static void boe_panel_shutdown(struct mipi_dsi_device *dsi) -{ - struct boe_panel *boe = mipi_dsi_get_drvdata(dsi); - - drm_panel_disable(&boe->base); - drm_panel_unprepare(&boe->base); -} - static void boe_panel_remove(struct mipi_dsi_device *dsi) { struct boe_panel *boe = mipi_dsi_get_drvdata(dsi); int ret; - boe_panel_shutdown(dsi); - ret = mipi_dsi_detach(dsi); if (ret < 0) dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", ret); @@ -1972,7 +1962,6 @@ static struct mipi_dsi_driver boe_panel_driver = { }, .probe = boe_panel_probe, .remove = boe_panel_remove, - .shutdown = boe_panel_shutdown, }; module_mipi_dsi_driver(boe_panel_driver);