From nobody Thu Sep 19 19:30:17 2024 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DC34517C66 for ; Fri, 3 May 2024 21:36:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772187; cv=none; b=VXMKLyxase7SvM1/1ErMWeZXFdh+ZgnF8f12sfs52qR2A1Q2BslAQ3R4yvk5GIZyRW9O/BTN7KpMtY749SMtLXem96PD7DOFAPiau3orMznkt3V14ZnQDULwopXhLzcu2VxdzkGlvwmI/bA51RTAWYNONPRnj8cyaBLx0C3esR0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772187; c=relaxed/simple; bh=6eKY39M68/49dXV9yzY99XqInd1/An5lKqtN9hFr4eo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XwmQQose3P7prGbs3yjACQN41IU0/87/vU9nr1YL/H5h9QwhwTjDFOXRR6WlcQzLvCsz1XoOm/JZla6FLC4HMMRSHJfTAE0hWoPiU7+fyxrAoTTT5oQADohVVuJH+dlvYAa8tdSywJRhd8nLlX6TBeMSYG5cQhAN58dDOWb0BEQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=gLdR0Ljo; arc=none smtp.client-ip=209.85.214.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="gLdR0Ljo" Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1ecd9dab183so19696595ad.1 for ; Fri, 03 May 2024 14:36:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772185; x=1715376985; darn=vger.kernel.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=d+m8p2+fwwMHEcaYlRhsoMqeDao9Xs+fgyRTTXxpyQQ=; b=gLdR0Ljo8e8+WliE57Au+b5S4xMrWZ5Pnxvsk+UmcMeLF7PNiWFVS83UjL3JsY7M6n ZDeWr44H2tnekNUSpW8xo/aQq/nrHO5zJzvERD9es3Xc3dMzVNAu3+ythI/xzx17g+tI jRvuFEr97Xs/LBf4XUvhRsFd5c2mD8MA3E0V8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772185; x=1715376985; 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=d+m8p2+fwwMHEcaYlRhsoMqeDao9Xs+fgyRTTXxpyQQ=; b=uH/kI5mc2qlywFRDFOXh/u46Xdc6Jt05J0ihTIc2N2XMBziBnGVAEsYstV/ImAnzGZ FKkESO7C1rGCU6bk41EY/2YIysdyMZGtxMARzPp42Gx3V8oi6ZEFXEBjVRAdz1G/G01i Ib1PbQp87cDxPwOsf5oinwfLrN1oNWc98+ORSHGDdD/fbUXoLiDgRlm7EayfLbmECsqb Z+bvTVUUZ87oBORd2yT6kOGi4WIKuDmrMYRGvRZpwzc7HUBw4lujHDibDrXEvmNv/X5z hVAf2AjtJ/8C0pK6pkyoGiWbgqcl1kFGGybloOPK+yZAOfeRWMmlNlWGbsSTviE/90gD zTGA== X-Forwarded-Encrypted: i=1; AJvYcCURXoNszNgHVHtFOWx1kdHAWaTaNWYuUeJjED8+RgHBCFxJKsuxe102iTJfjvGgj9DTJYFcy2ftR1Jc+fkjQe2CygwV37G7OEslzJCH X-Gm-Message-State: AOJu0Yx41ad+65IEDEu5BfiihBTxtpO9uNj/WLwZWAtQRHjiwI/FqI9U P3ORp1Eaam2AgPz+Z46VD0X8/R9PvRsVMnfGBvJQKOCAehiZj+PuUSB/iQpL6g== X-Google-Smtp-Source: AGHT+IEe8XlbR/2YlPVfssvvzVEwgr7rfoy9E26NkJtjDWBN5xy4JZSBQ68VuPVn9y4gwaS+LyUeIg== X-Received: by 2002:a17:902:c407:b0:1e5:e676:4b09 with SMTP id k7-20020a170902c40700b001e5e6764b09mr5664110plk.25.1714772185179; Fri, 03 May 2024 14:36:25 -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.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:36:24 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , Luca Weiss , Konrad Dybcio , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 01/48] drm/panel: raydium-rm692e5: Stop tracking prepared Date: Fri, 3 May 2024 14:32:42 -0700 Message-ID: <20240503143327.RFT.v2.1.I784238de4810658212a5786b219f128460562a37@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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. Cc: Luca Weiss Cc: Konrad Dybcio Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard Tested-by: Luca Weiss --- Changes in v2: - New drivers/gpu/drm/panel/panel-raydium-rm692e5.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-raydium-rm692e5.c b/drivers/gpu/dr= m/panel/panel-raydium-rm692e5.c index a613ba5b816c..21d97f6b8a2f 100644 --- a/drivers/gpu/drm/panel/panel-raydium-rm692e5.c +++ b/drivers/gpu/drm/panel/panel-raydium-rm692e5.c @@ -23,7 +23,6 @@ struct rm692e5_panel { struct drm_dsc_config dsc; struct regulator_bulk_data supplies[3]; struct gpio_desc *reset_gpio; - bool prepared; }; =20 static inline struct rm692e5_panel *to_rm692e5_panel(struct drm_panel *pan= el) @@ -171,9 +170,6 @@ static int rm692e5_prepare(struct drm_panel *panel) struct device *dev =3D &ctx->dsi->dev; int ret; =20 - if (ctx->prepared) - return 0; - ret =3D regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies); if (ret < 0) { dev_err(dev, "Failed to enable regulators: %d\n", ret); @@ -213,8 +209,6 @@ static int rm692e5_prepare(struct drm_panel *panel) =20 mipi_dsi_generic_write_seq(ctx->dsi, 0xfe, 0x00); =20 - ctx->prepared =3D true; - return 0; } =20 @@ -222,13 +216,9 @@ static int rm692e5_unprepare(struct drm_panel *panel) { struct rm692e5_panel *ctx =3D to_rm692e5_panel(panel); =20 - if (!ctx->prepared) - return 0; - gpiod_set_value_cansleep(ctx->reset_gpio, 1); regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies); =20 - ctx->prepared =3D false; return 0; } =20 --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:17 2024 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 578FF59162 for ; Fri, 3 May 2024 21:36:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772190; cv=none; b=KXC/JWTTe+E/mc7BmaTvzEGjP7V6wAnwR+LUnlaLIVmyR2MbLsPqrN3JLAf2bXPAb7zzu7c17u5rBu4EJakJWKGuex6ExcKh7/L48BUHK5BFHjBAtFqcJZOz+wLx44fTgYq2ZgfAxzHJBxLfV9v8gU17jwrRpRQ/S7KwoQdiNCg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772190; c=relaxed/simple; bh=cqR7hS4vud8zXa5zW9gAw2iNuJRgRwzWpTUNSCfJM78=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CdK7na75N7XjnNo11AcxtlMbzAJYVrA8c1kDC0dHuzhohnOh528eugLhpS4i2VdhNPea0Pn6mz4W/9k3532R3KnUhmjdts+jj+UpZxilnHxF+3UNpdJI30VX/s8qPXFZzs/bwlgEjEnr5PfOvJNf0vmMeTJsJujUuVuaSdErULI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=MvAkl/X0; arc=none smtp.client-ip=209.85.214.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="MvAkl/X0" Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-1e83a2a4f2cso847105ad.1 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=vger.kernel.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=MvAkl/X0nCAxHWFmhsviVHIlPSMwQaD0p6VrQ4/rrVOUfKKxM+jN7ZT5DGi6/x8bK2 PkQc3wn/eGVUiWorvh3/pJTBMcHFrG/GdEblNZrtiR9XkLv8650pCdNthU/w52/SUxu7 jTiR6gUJILRnD9KtY0hA3OSytQgxMuw0BjgtQ= 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=ZHQmgPex7Z8LBPl68x2ihfsyc4QAzurnExgMhhDcF1Bqmi/gXtx3/gp1l1laEjzWCq KjZzSJ68VneqZA5dtaDcFDVOCA+W69uxxolMLhbthdtRYrgLsE9uz8RlYQmk6OaoVHSb lAasdG//pGVFxpVn8GUXSqrR0Yt1AxeWr6L2pZ0t8mtynCLvjgx+ljPDzD3Akfk2Gbkd oIQYS/OjRPpPJWXDx1u+mmGR8LGrvQXBna5rsDN/155sHcX/SYcdIyEtBpHXitw/diNI GsLlJesUC7UOqYAKUVdlmO8j14ZxRY3m2LBZe39VWISX3yUQtADtJvqaf72XdvTaMdqS 1q5w== X-Forwarded-Encrypted: i=1; AJvYcCVszsuukpSbiyPrTUqH+EA/NI49R7eJGv8bBFnfV6mTVzRaoyLULi9LKPXEevUYObPjOAskTXEeLm5+4WOirO4RUOxzUwQZmY7FRYsu X-Gm-Message-State: AOJu0YwzM/2QV8XMJYxxtXT/lKIlpP1w8c3Qj6ByGFZvGFX/CMlBDGi2 BIxC0qJekpfCGTpPWLStcyAcnpfc7el7XVvzEVYzSnYhzGB0VpRC9bZ37Q6oBA== 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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. 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 Acked-by: Linus Walleij Acked-by: Maxime Ripard --- 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; }; =20 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 =3D to_panel_info(panel); int err; =20 - if (!pinfo->enabled) - return 0; - err =3D 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; } =20 - pinfo->enabled =3D false; - return 0; } =20 @@ -105,9 +97,6 @@ static int boe_panel_unprepare(struct drm_panel *panel) struct panel_info *pinfo =3D to_panel_info(panel); int err; =20 - if (!pinfo->prepared) - return 0; - err =3D 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) =20 disable_gpios(pinfo); =20 - pinfo->prepared =3D false; - return 0; } =20 @@ -131,9 +118,6 @@ static int boe_panel_prepare(struct drm_panel *panel) struct panel_info *pinfo =3D to_panel_info(panel); int err; =20 - 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); =20 - pinfo->prepared =3D true; - return 0; =20 poweroff: @@ -194,9 +176,6 @@ static int boe_panel_enable(struct drm_panel *panel) struct panel_info *pinfo =3D to_panel_info(panel); int ret; =20 - if (pinfo->enabled) - return 0; - usleep_range(120000, 121000); =20 ret =3D mipi_dsi_dcs_set_display_on(pinfo->link); @@ -205,8 +184,6 @@ static int boe_panel_enable(struct drm_panel *panel) return ret; } =20 - pinfo->enabled =3D true; - return 0; } =20 @@ -917,11 +894,11 @@ static void panel_remove(struct mipi_dsi_device *dsi) struct panel_info *pinfo =3D mipi_dsi_get_drvdata(dsi); int err; =20 - err =3D boe_panel_disable(&pinfo->base); + err =3D drm_panel_disable(&pinfo->base); if (err < 0) dev_err(&dsi->dev, "failed to disable panel: %d\n", err); =20 - err =3D boe_panel_unprepare(&pinfo->base); + err =3D drm_panel_unprepare(&pinfo->base); if (err < 0) dev_err(&dsi->dev, "failed to unprepare panel: %d\n", err); =20 @@ -936,8 +913,8 @@ static void panel_shutdown(struct mipi_dsi_device *dsi) { struct panel_info *pinfo =3D mipi_dsi_get_drvdata(dsi); =20 - boe_panel_disable(&pinfo->base); - boe_panel_unprepare(&pinfo->base); + drm_panel_disable(&pinfo->base); + drm_panel_unprepare(&pinfo->base); } =20 static struct mipi_dsi_driver panel_driver =3D { --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:17 2024 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9D1EE4CDE0 for ; Fri, 3 May 2024 21:36:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772193; cv=none; b=USU+nUGyWBwU+/VX80Vu/34Aq4r43RcLVexkJGRl9rY87Jdr4BfTcRk42C3WatUw3iSJnfoymwU+eFvZZFZNzgkGpzxUySbOKhKo3rOWle7AYhiHExPUQZKPz6ppf/N1/oTwX3dUpNZJ21BTNB4yVMbQIfl4kuj0TH9MiABMvpg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772193; c=relaxed/simple; bh=Q15hSl0ME/9Le3lQp5qt508gFauIS2SVi1eec97Q8Dc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gQnWgifxO0AzEiL4ccM7MzHc1Sh5cSpPcrte7WePg4WvUEjMVlggTyGjp9AkZY9cIvsOURoPMKwFEjZnqhjrFO/VzdFwbZKpRVydwXMfPFK6ZvVf+ESFaEBYtQiu+b2vSmekUh+wE6eUHm5s5aIxPtnEC6tulNrR+THrYCxbdJ4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=iul2cwdk; arc=none smtp.client-ip=209.85.214.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="iul2cwdk" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-1ecd9a81966so16285035ad.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=vger.kernel.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=iul2cwdk5cKHvoCx0SxDgSHT1w/ZgAsGpy/V6uL4ePriVeseLMuXrjyLvKbEJeBZ6y 8qwOXzi8NeHpf7brGwzGn3JS+84yh90ko1PIHbEgg7SdPm7JK0R4BU1urH+OHFfLDHDB +mZ+UIrNccLZ86hfOejHAJl/Z1ZAWuKLR5vx0= 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=SRwzMDxqqjBJ3Mcn/66E/6Hnf78QBlm94F46ZinXxv5cAprNFVk7upVpBb8FdzEn/Y dox0RyZbs+cWhQ4yjkGUszPTRIUpMCcDz806X9MOBt7p4Q9swnsYGjmWmrJHnw9W5XJO y4RJw8OkjOJmJOZDnHS9nYn1obsfiZ+UIg8lesl7w4LD+BBqohJspiahYRS172Mu859t pN8JDXzN8Gl6zLB6+YcbNLjVc0ms4/Gu+U0/tQjPmpJW0otvS5ORmoC7uWU+FPjzck49 UzZKUvlSFQmhqBW8uMIuOGNQ4C9eZGNBImjfAvQgBcQPb/jF4VpKV9GocRfxh6elWFda JrLg== X-Forwarded-Encrypted: i=1; AJvYcCXaVsqUN7IsCtlCM0bKlC5lokB6+TWCK+YcycxW+NO58wyymfip8Of1x997Q0zM6pNDIQEAY4SK+aot96V14me2crYp5n9DaI4qMwbm X-Gm-Message-State: AOJu0YxjjuE1BBBKxKVCaiCRBmOjfnzjhmzn6mequqlvqRLksYCSAp6a fFwJtymcUWIL/xyyuZkArZHyVgD08uwafYKxXueh5dir/eJKBj9Otl3FyGoyYA== 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Acked-by: Linus Walleij Acked-by: Maxime Ripard --- 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 =3D mipi_dsi_get_drvdata(dsi); int err; =20 - err =3D drm_panel_disable(&pinfo->base); - if (err < 0) - dev_err(&dsi->dev, "failed to disable panel: %d\n", err); - - err =3D drm_panel_unprepare(&pinfo->base); - if (err < 0) - dev_err(&dsi->dev, "failed to unprepare panel: %d\n", err); - err =3D 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); } =20 -static void panel_shutdown(struct mipi_dsi_device *dsi) -{ - struct panel_info *pinfo =3D mipi_dsi_get_drvdata(dsi); - - drm_panel_disable(&pinfo->base); - drm_panel_unprepare(&pinfo->base); -} - static struct mipi_dsi_driver panel_driver =3D { .driver =3D { .name =3D "panel-boe-himax8279d", @@ -924,7 +908,6 @@ static struct mipi_dsi_driver panel_driver =3D { }, .probe =3D panel_probe, .remove =3D panel_remove, - .shutdown =3D panel_shutdown, }; module_mipi_dsi_driver(panel_driver); =20 --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:17 2024 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E671858ABC for ; Fri, 3 May 2024 21:36:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772196; cv=none; b=YkfYMPpy+ovVWAkddbdPTxZWKhUy1BszBad/tufxNtwDkxX6J6YAl75JbYW+gvOv7CqjC9BVAgy+CvBM7GZNQvc+aIDB1AZw8C0YkselWZNA+rSnadLfeSiXvR6DoGTKXsDT68xsJmQO2CkZWTTS4rtCeyB5lNe6rTh1+PFSO8o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772196; c=relaxed/simple; bh=hj+CoHiWh664elW2n6ckmx7SmywRTNBnurnsX4qarF4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PJRNGFTdFMBEur5O0p0Bcjq75LMmUtwZpzF/PZ5vYDUBvIn8fuIiO3GyoGPnjOTYg/WQCn05FfhuijjmrkKFZqMglXi38iUmvZ+cZbuNm46wNuUAHnERoED/ymmLlhegxtVvlsoE5GnROhU0coBTGNSsNhVXVNY1X1U0ijwq9NQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=l54dGb3M; arc=none smtp.client-ip=209.85.214.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="l54dGb3M" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-1e5c7d087e1so1043295ad.0 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=vger.kernel.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=l54dGb3Milw8mz0rLL6hSc97wxza/ORGLCu51w11xuvkKqv3sF9My90wKnAMDZ74b7 xwqkbRleSHUMl8zbq3mdV4GI1clI3vhMlbVret0G3zLXFl2ep6Qn+lWgywA4VIO7c7gy IYu6TYynN9LXaAPHPf/t4HPRtO7KcHbDhw5kY= 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=mtyekhMlkZqXd5Ukb5/os4103DcAoKajx/UV2EcebSA+N1BVnqZ9ziP5dfHtqXo7vE 02vzPZA4LGbQyCB9T56tKDamUf0Qp89cE4RJXZ4+CG/jNLoc1kRK/iFAZ91X7nV6rFHt TX5GmLE8L5ZN+srGqRe9hBkLAxLcGm7WETF819Nwjxkq44W94nu3LsYmhqxNwMLlQNey +tIAdq9lkevV32QEYg3J66bL8FYW34rkdKLG26Hdye3kdlFC6t82iuFC5EUg6s3jNc1t AoYhPHbq6NUgomrWekxzPOO0NUfuyP4EOvUfT1wK+7twg+Omdd/LX1j6E/QvvJtOGo3Y ZgCw== X-Forwarded-Encrypted: i=1; AJvYcCVLwwVE8sZEBkxzajCk7Qc0oFmeH7vo68dcv5DL3+M+oWXucEAB+N6ssje2b/YjS5hiZBgiagd2dEoyJ2sjsIsolw3+CNiwv819tf00 X-Gm-Message-State: AOJu0YwqHHotBXQRs2Kh6AiQ5NeVs252cge/p3C8WnqySsEIKlkwAn6D 2HRDQdq/v/nMHPNJMM71lmCnk2UpIaErd9FFz4izcLugi66eRZfrDDhN8jO3Dw== 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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. Cc: Jitao Shi Cc: Cong Yang Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard --- 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/d= rm/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; }; =20 enum dsi_cmd_type { @@ -1450,9 +1448,6 @@ static int boe_panel_unprepare(struct drm_panel *pane= l) { struct boe_panel *boe =3D to_boe_panel(panel); =20 - 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 *pane= l) regulator_disable(boe->pp3300); } =20 - boe->prepared =3D false; - return 0; } =20 @@ -1481,9 +1474,6 @@ static int boe_panel_prepare(struct drm_panel *panel) struct boe_panel *boe =3D to_boe_panel(panel); int ret; =20 - if (boe->prepared) - return 0; - gpiod_set_value(boe->enable_gpio, 0); usleep_range(1000, 1500); =20 @@ -1523,8 +1513,6 @@ static int boe_panel_prepare(struct drm_panel *panel) goto poweroff; } =20 - boe->prepared =3D true; - return 0; =20 poweroff: --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:17 2024 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 897DE84A57 for ; Fri, 3 May 2024 21:36:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772202; cv=none; b=BJw3IfBy1RH7wLrpGz5oU8U2eh2ZguUDwAJJ1Z1WX99t5bHnVtfdKKpHtkALCzlku3ZeEzMP+v2wMYPeRkrGm6RhZaJbnODBFzznts11/b/sb60W1ghrMUTB3W4arfAaYx1giGTyxzPFDl2LBfCtQlnJV6ukZqNHNTQXzt564fE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772202; c=relaxed/simple; bh=Xl9OtOjknJgxbPeTWau1v9EcTyLAEVp1zRV24ZssokE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=g7zJTStZIZcMgNorjrQLYkRIUNdjfQhz5nMK8j+bjE4FHGLncfiwlMcDe8yBnCKJkMGOm449R/XLN6xwlYsilEdXx8b34GTMimn2rI93JKJxBMvdlxOBp2zhHuHHR3N1U8vmZWE+AabIj6/3AkBHEtkE8NgEjaUwooatSKwWpaw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=RKuf7WuA; arc=none smtp.client-ip=209.85.214.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="RKuf7WuA" Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-1ecddf96313so1021655ad.2 for ; Fri, 03 May 2024 14:36:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772197; x=1715376997; darn=vger.kernel.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=RKuf7WuASvpstKfIfW3yhShTNOQuEveO6/fLm1OPufay7VnTcsCAE0JdmZ/2Hu0E4v dFtZePu/kZf2y0jem3OaeKKzxgu44HaOj9TPLbaJ0jQbvVzO3cvln0bvHxZqYKKbjvMx KnFEXgkCML1RQOAzVdK21JrcoKKDbCaQp0ag0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772197; x=1715376997; 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=scScBsroathzlQYfaLp0KAIfHdABABSB0sMCmrleekcYpteyxUmSzSKrPd1nVIMDpc Pgz5iTz0Pr27Yg9jIsEOQSKmNfyysWxNZMW0Yojtr7X5QHlYXK7HYJFah9AkipkiUfnM n447A1pznqovWTRotbBIB8GqjqF8fbkaFWLDXQmRrZ0iymwBDGt9RA5inRopCqnpPM9P j9eYHFEmdo9BUKCNxQU4DgihYWJIcY6JZxHIfg3J5ec7Q7DKbbmA07NXDTjgytqn1cL8 pBpx7oFk0nr/7ynL7A32okcGtTkh9JfekE1w1mnuekG0RJV6xu4gN1NTtzAPjPqoJqDf Ysng== X-Forwarded-Encrypted: i=1; AJvYcCWs/c6hlfcD0hVxyVS+BAhWUAFfj6JM+fyFCVcyzFs42pqeod4ghrPTFYIgbUAY5GtQod7Qk/XSG61BbbAnpWHpRoSTCu0i0jh4f6n/ X-Gm-Message-State: AOJu0Ywv72mQGoNKYcymmdjT3ediqYhFPYXjPrJSVkZQrXTyKV7DGQnb 4KN+V+TnCuOMqV+q6QEfDbytnD/WtCB69/lCpdoORnnkcYA6i8PZdIlSOCf9Fw== 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Acked-by: Linus Walleij Acked-by: Maxime Ripard --- 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/d= rm/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; } =20 -static void boe_panel_shutdown(struct mipi_dsi_device *dsi) -{ - struct boe_panel *boe =3D 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 =3D mipi_dsi_get_drvdata(dsi); int ret; =20 - boe_panel_shutdown(dsi); - ret =3D 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 =3D { }, .probe =3D boe_panel_probe, .remove =3D boe_panel_remove, - .shutdown =3D boe_panel_shutdown, }; module_mipi_dsi_driver(boe_panel_driver); =20 --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:17 2024 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F30BE58ABC for ; Fri, 3 May 2024 21:36:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772201; cv=none; b=hyBFfNdDC8l+eiWOQ9DVkIituxf81WA6ZHXeZpJONrCCADiJTFCSyF7ZbrEdmfjx28fvQY80e5ws3auFrt5w/8w+AEQ+ni1Swmw4DlfLJVyiD5G2uQcUZk7Lb0Rs38z+89JhGNBsYRVx+hBHaYAVfCj6LJE04VIf9XSxSQvz1dQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772201; c=relaxed/simple; bh=szuDzoCZuRFvsQUIOomj1teaF1eqZrWLsjF/lnyPTAk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IECtVaTfbdz91NAZCxfEGYedzFeQzC2FLp9kg/KhXH06IHuvm3hH61NbhTpolrXMMDJBWOpTGruAGmNwLKZ1wvGqCQdqBtQ/NLCN1S4Lq4XrRX/RFINSa3yzeo8QPdyb3ecW8bJB1KtvymCf4ElLNeXYtsOF4TGxvSgKFSo+ee8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=fsfDzlC9; arc=none smtp.client-ip=209.85.214.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="fsfDzlC9" Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-1e83a2a4f2cso847995ad.1 for ; Fri, 03 May 2024 14:36:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772199; x=1715376999; darn=vger.kernel.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=gCoTs68fkVHbhVnPnaiJoDVVCaB+mneUDffLrqHY7lM=; b=fsfDzlC9Z8bSqButUjT/8o3VxerAS6G1iPfpjTZCOp34IqcUi5gotKPneW1BR09Ry+ S0IwTw6SGkkHS1QbSEbZ96J2q7XZWfMuywuv7UYwl2CU7GYTdgmpaNbdd3Tna1oa2txz 7wOellpTLwv0Z89Eb+xntZQ7pPKSex5qrzTZU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772199; x=1715376999; 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=gCoTs68fkVHbhVnPnaiJoDVVCaB+mneUDffLrqHY7lM=; b=sAHtTdwclvmGbg2vt7POuxdp7iQou6JBbJ6On17vUGuE2dR88S+S/JWci5DAJ7lO2l xIU0E9yIJEXmkdJ+TeSmjO0w+q3/Imric2NjlqjW3T27j13HN65QeJLDLeolrOdUoenA QHM/4rz2AFM8IJh3tp6lhGzGcCZ3m/1oo7+mW71kDFGUYeG2a6jHjaoQiKqD3kshi8Ek nklJiRN7HodzZXh0i+3izGLnLIQ35+48RyWMbkl7KF5a79PjBMJQ/sUaCOa8BO18GOF5 xo65qxqQWPZYTNvJIHv+vcnW4XsYamw5vnUWCXBvjq2QVtEEntoiPxVhodQKI14GuNNm Jw/g== X-Forwarded-Encrypted: i=1; AJvYcCXNzeCL5+uufb4OVrLHvvojmfj2cnKiuDiiNim99VDRK8bCaZkoqP0PQHuGgECba8FNaRfoO72kuh97ITlK1rH1JjuhNAQeD0Dz/TIO X-Gm-Message-State: AOJu0Yyj2WhmU4Wawd9aV8IA3CZW0ADGUT/BDVHJFGWrqGuwiOn/mH4k k9K78pAay3CWHjWlh+N1dkW9ut8Pt2YVHFD6UEh7aiEIe6v69WNfkZ2BWYm9fQ== X-Google-Smtp-Source: AGHT+IELE7rVEQIWwU2v7bYG2I6EIH6w07IbYCviD6Ulwew4A7zRTV/QWIpp+ISdHunRXglP3i8Fyw== X-Received: by 2002:a17:902:e5c4:b0:1ec:2274:8205 with SMTP id u4-20020a170902e5c400b001ec22748205mr5122613plf.48.1714772199273; Fri, 03 May 2024 14:36:39 -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.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:36:38 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 06/48] drm/panel: edp: Stop tracking prepared/enabled Date: Fri, 3 May 2024 14:32:47 -0700 Message-ID: <20240503143327.RFT.v2.6.I4d1bf08781593c08127e506422687ab19fd3c824@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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. Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. drivers/gpu/drm/panel/panel-edp.c | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-edp.c b/drivers/gpu/drm/panel/pane= l-edp.c index 6db277efcbb7..344f67871d41 100644 --- a/drivers/gpu/drm/panel/panel-edp.c +++ b/drivers/gpu/drm/panel/panel-edp.c @@ -222,11 +222,8 @@ struct edp_panel_entry { =20 struct panel_edp { struct drm_panel base; - bool enabled; bool no_hpd; =20 - bool prepared; - ktime_t prepared_time; ktime_t powered_on_time; ktime_t unprepared_time; @@ -395,14 +392,9 @@ static int panel_edp_disable(struct drm_panel *panel) { struct panel_edp *p =3D to_panel_edp(panel); =20 - if (!p->enabled) - return 0; - if (p->desc->delay.disable) msleep(p->desc->delay.disable); =20 - p->enabled =3D false; - return 0; } =20 @@ -420,17 +412,11 @@ static int panel_edp_suspend(struct device *dev) =20 static int panel_edp_unprepare(struct drm_panel *panel) { - struct panel_edp *p =3D to_panel_edp(panel); int ret; =20 - /* Unpreparing when already unprepared is a no-op */ - if (!p->prepared) - return 0; - ret =3D pm_runtime_put_sync_suspend(panel->dev); if (ret < 0) return ret; - p->prepared =3D false; =20 return 0; } @@ -542,21 +528,14 @@ static int panel_edp_resume(struct device *dev) =20 static int panel_edp_prepare(struct drm_panel *panel) { - struct panel_edp *p =3D to_panel_edp(panel); int ret; =20 - /* Preparing when already prepared is a no-op */ - if (p->prepared) - return 0; - ret =3D pm_runtime_get_sync(panel->dev); if (ret < 0) { pm_runtime_put_autosuspend(panel->dev); return ret; } =20 - p->prepared =3D true; - return 0; } =20 @@ -565,9 +544,6 @@ static int panel_edp_enable(struct drm_panel *panel) struct panel_edp *p =3D to_panel_edp(panel); unsigned int delay; =20 - if (p->enabled) - return 0; - delay =3D p->desc->delay.enable; =20 /* @@ -598,8 +574,6 @@ static int panel_edp_enable(struct drm_panel *panel) =20 panel_edp_wait(p->powered_on_time, p->desc->delay.powered_on_to_enable); =20 - p->enabled =3D true; - return 0; } =20 @@ -869,7 +843,6 @@ static int panel_edp_probe(struct device *dev, const st= ruct panel_desc *desc, if (!panel) return -ENOMEM; =20 - panel->enabled =3D false; panel->prepared_time =3D 0; panel->desc =3D desc; panel->aux =3D aux; --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:17 2024 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 31DB75A110 for ; Fri, 3 May 2024 21:36:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772204; cv=none; b=OQ61xYLbDsP/ymGkcSuEpK6uEyq9kad4+sLH/omDgspHClxgK07czdSKBAswyIVRSUazHOE5GND0DM6k74V+jsyOFebnRCtb/ZoeeKY9O57zPnMmXssXk+d8Gtf3yFOwM9FU2KaOoYk7c/z1iNPxJe9msTuijpNUULdb3Z04ipA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772204; c=relaxed/simple; bh=nkEzB5xaPVoz6iOurmdL7HHNVRp9WgHsJcfOVLySFA8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FGZlhYiWdhtmiql6lOibM29dQfzFabhDGksTYggbpGwKobnAvnJ9BRb5TPfBywzmhX+wE1X6u4vE7c9U3WLurg5bgkGRsZ3ajHEkFp+3km9t/5moeMSpKJYWURGrowsTSCF8fNoLcdJRCOYzNDMcxYCnmLBsGG4xfSah86+3+lM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=LKU5PhFc; arc=none smtp.client-ip=209.85.214.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="LKU5PhFc" Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-1e3f17c6491so780235ad.2 for ; Fri, 03 May 2024 14:36:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772202; x=1715377002; darn=vger.kernel.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=b/gDi06ypcwTUid62LmhVpKtIZZa53PC46cbq17u59E=; b=LKU5PhFcgeyWWI9MK6J8NXiH9uW6ufi8zFcFup1fFMTibgMif+NLTnok9LuGm7OyTq ZoGDGseUNc4KksINBqRgLR+ceT+mtxIKUvcPqHB34eeWjJ8aYtwfywlI9OyM4Gyck0sl DHXwNMm8H/CajnlKwDbT+bUOAmRuk9pdJTE/g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772202; x=1715377002; 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=b/gDi06ypcwTUid62LmhVpKtIZZa53PC46cbq17u59E=; b=i1s44chKL0irky9+rBg3r98BU5+swaPMmO0KrzhRnz5wbi9Wxso8H/Ifwyf/MjSvpF uYgBDD2Gu+8mASS+hTQJNToSzspQFTG+YRbvPWyrrkAJWWyv48v2rqyeoNqzQ0utWvxO E2RP4OVB9P0AX2KYCgm3gls4I9fZB2aRK3yv3mbJ4OqGPkAE+mBzmvpBEyjmXTpNxWFG sIs6xpfJo8mhAXYcVq/EekiYmYtj5u6gbXC+2ThDjh3FJmMHSOHWEkx5drNiOdc5HRMs hMs2lUyClItZGNY9WPgKp3I+BD97BGCqkIuwKGrxs4vy4qEJz2b9CxVyERREjA2mBbdW iwww== X-Forwarded-Encrypted: i=1; AJvYcCWO4ASz46FlS6OCqFU3gTFusxxIFA7ZLNSm7o3An1uoWnrQokwugiiXEPhIsISLkUxhAQsv0ei9zHKUESEPvE1QmUL9NVXC85HX+UwG X-Gm-Message-State: AOJu0YzBmUARzkIj2oNRySUojrSvB2X5ko5Kl7Sz3/ysvc10s90y490i fbUjNiKjMDgLgVmcGQqd/KQYLDGPaOcjfUfv1VBDWnaTi54W+2FQMiqno0r2SA== X-Google-Smtp-Source: AGHT+IHVkT5EJTIYXQXBX5EIce/1Ex+Br0DGJO9Vob3PlE0kbtZ2ROcTXrJAG7DEeHfLLcWqrz5ILQ== X-Received: by 2002:a17:902:ce8a:b0:1e4:9ad5:a666 with SMTP id f10-20020a170902ce8a00b001e49ad5a666mr4922430plg.25.1714772202526; Fri, 03 May 2024 14:36:42 -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.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:36:40 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 07/48] drm/panel: edp: Add a comment about unprepare+disable at shutdown/remove Date: Fri, 3 May 2024 14:32:48 -0700 Message-ID: <20240503143327.RFT.v2.7.Icff7f7005d997773d585e36aba9ed41a9865201f@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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, it's very difficult to know exactly which DRM modeset drivers are using panel-edp due to the sheer number of panels it handles. For now, we'll leave the calls and just add a comment to keep people from copying this code. [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 Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. - panel-edp and panel-simple just get a comment now. drivers/gpu/drm/panel/panel-edp.c | 33 +++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-edp.c b/drivers/gpu/drm/panel/pane= l-edp.c index 344f67871d41..9c4c5c0e39a3 100644 --- a/drivers/gpu/drm/panel/panel-edp.c +++ b/drivers/gpu/drm/panel/panel-edp.c @@ -944,13 +944,34 @@ static int panel_edp_probe(struct device *dev, const = struct panel_desc *desc, return err; } =20 -static void panel_edp_remove(struct device *dev) +static void panel_edp_shutdown(struct device *dev) { struct panel_edp *panel =3D dev_get_drvdata(dev); =20 - drm_panel_remove(&panel->base); + /* + * NOTE: the following two calls don't really belong here. It is the + * responsibility of a correctly written DRM modeset driver to call + * drm_atomic_helper_shutdown() at shutdown time and that should + * cause the panel to be disabled / unprepared if needed. For now, + * however, we'll keep these calls due to the sheer number of + * different DRM modeset drivers used with panel-edp. The fact that + * we're calling these and _also_ the drm_atomic_helper_shutdown() + * will try to disable/unprepare means that we can get a warning about + * trying to disable/unprepare an already disabled/unprepared panel, + * but that's something we'll have to live with until we've confirmed + * that all DRM modeset drivers are properly calling + * drm_atomic_helper_shutdown(). + */ drm_panel_disable(&panel->base); drm_panel_unprepare(&panel->base); +} + +static void panel_edp_remove(struct device *dev) +{ + struct panel_edp *panel =3D dev_get_drvdata(dev); + + drm_panel_remove(&panel->base); + panel_edp_shutdown(dev); =20 pm_runtime_dont_use_autosuspend(dev); pm_runtime_disable(dev); @@ -961,14 +982,6 @@ static void panel_edp_remove(struct device *dev) panel->drm_edid =3D NULL; } =20 -static void panel_edp_shutdown(struct device *dev) -{ - struct panel_edp *panel =3D dev_get_drvdata(dev); - - drm_panel_disable(&panel->base); - drm_panel_unprepare(&panel->base); -} - static const struct display_timing auo_b101ean01_timing =3D { .pixelclock =3D { 65300000, 72500000, 75000000 }, .hactive =3D { 1280, 1280, 1280 }, --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:17 2024 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4006758ABC for ; Fri, 3 May 2024 21:36:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772206; cv=none; b=HfTvmVUpSzrKTFdYXiQDtKTPaIzKOQQpz8oJcPr54QTikh3SwMtwPB92WGPI4GX9CfDnZ6vkjZJkL+awxsFjKtvm9YsDL3TbAQwVo/MF7Z5DiWG5LnQGJwW4j+jAcnVZtnvOFtzYufmgkrwMSCm15uVf8Em4JD4VbGS0IuCASpc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772206; c=relaxed/simple; bh=UFRhW7hFxmMjKYOVgXJWmGpqqggLO+iuoq5fYFD0R2s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=PvW1ZWJn+pK+AEokTGoxqVs5xUqigzwz8H/qUstHPg2FpBMSOdz+VHo+rCnwKPlgiD+btKXnrpBHufpoLBLAZRoUfj+FouY3LEvEUmp97CvVynudOSR0B+yZLHo7U3VAK43os7Ar0RdeeNmx3ONZzk6wcNM/aY7jyh0RBxNWdJk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=mOldH39n; arc=none smtp.client-ip=209.85.214.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="mOldH39n" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-1e3ca546d40so1023605ad.3 for ; Fri, 03 May 2024 14:36:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772204; x=1715377004; darn=vger.kernel.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=paGqFOJ2nhC87MmLby9MgxTeHu7XKJBlCB1L6uiDNwg=; b=mOldH39nPA9cGqFTxg8kr220pral2lm7wmXU7LhY+hnCLG1lXJYHoyR+trqLu30/9b roGQKTGuIKIIMdrBlOqudWL/QqPXzDOfqD2y3TQZjDUTj+TbcC49FfP3zqp21w4f2JHB ocIbBSSk6byjkYUTdYSR7GDnL8ugUso9BlQ3c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772204; x=1715377004; 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=paGqFOJ2nhC87MmLby9MgxTeHu7XKJBlCB1L6uiDNwg=; b=gz4g5I0ng6ENNo9V1gf86KT+bb4xpM2U+6XaKn4JkWA5dlFdxVk+faXHRsqT10Ayaz zaws/aUE1N04Px/mPwtWyqylRUi05CswPKQ8AIndunQtpOMoCmyXgbcras3PlyTwVSvO m3ypSzO4ly1h7KOedEDizdvqtI+QuHNdPDqFoLvT2Mnq81BDU6M0KtmYxllNUhlc18UK WltBAo1PMUJBpk7k1buqJUlAAhNOsbl/gBHSl1/1v33kOZG1wHGAT1AZz7bv8JxjorzA XseUfXt0M3ka1a4XQ6xC90R7QNt999rVX9PpAoIbfKvgosmzb8HbTzaNbRQWDNEOX3vB 1PWw== X-Forwarded-Encrypted: i=1; AJvYcCWFrDBylhW1EunvrZVqcEKMx5LHuXNJvapNXltSw+VKIK/3N/fTjElnfly5DMNoKn1W1gk5dgaRqor/NA9iAwHwL3nEU43hwFAdj3uV X-Gm-Message-State: AOJu0YzudEvWfUZpNavaIMKJg9foQ50XlU14Muy8y39hCbdK3CaAh6kq ayDi7L6B54tsspbdnjg+ZZSSrGwwuL02Z/w/+/Fnqf+3HfQax1srzdsg8Z7pog== X-Google-Smtp-Source: AGHT+IEx3Ot96pqT0JZWFoeg3B/jPEk44kYlrdOtlaungPQljCh2vyyJ0lZPjiPjtxRQep5DNsRVJQ== X-Received: by 2002:a17:902:c40c:b0:1e4:df0c:a570 with SMTP id k12-20020a170902c40c00b001e4df0ca570mr4139211plk.8.1714772204518; Fri, 03 May 2024 14:36:44 -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.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:36:43 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , Chris Zhong , Lin Huang , Brian Norris , =?UTF-8?q?Heiko=20St=C3=BCbner?= , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 08/48] drm/panel: innolux-p079zca: Stop tracking prepared/enabled Date: Fri, 3 May 2024 14:32:49 -0700 Message-ID: <20240503143327.RFT.v2.8.I99c73621fe3fba067a5e7ee6a1f6293c23371e1e@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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: Chris Zhong Cc: Lin Huang Cc: Brian Norris Cc: "Heiko St=C3=BCbner" Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. drivers/gpu/drm/panel/panel-innolux-p079zca.c | 39 ------------------- 1 file changed, 39 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-innolux-p079zca.c b/drivers/gpu/dr= m/panel/panel-innolux-p079zca.c index 485178a99910..5833d3a0fc79 100644 --- a/drivers/gpu/drm/panel/panel-innolux-p079zca.c +++ b/drivers/gpu/drm/panel/panel-innolux-p079zca.c @@ -51,9 +51,6 @@ struct innolux_panel { =20 struct regulator_bulk_data *supplies; struct gpio_desc *enable_gpio; - - bool prepared; - bool enabled; }; =20 static inline struct innolux_panel *to_innolux_panel(struct drm_panel *pan= el) @@ -61,26 +58,11 @@ static inline struct innolux_panel *to_innolux_panel(st= ruct drm_panel *panel) return container_of(panel, struct innolux_panel, base); } =20 -static int innolux_panel_disable(struct drm_panel *panel) -{ - struct innolux_panel *innolux =3D to_innolux_panel(panel); - - if (!innolux->enabled) - return 0; - - innolux->enabled =3D false; - - return 0; -} - static int innolux_panel_unprepare(struct drm_panel *panel) { struct innolux_panel *innolux =3D to_innolux_panel(panel); int err; =20 - if (!innolux->prepared) - return 0; - err =3D mipi_dsi_dcs_set_display_off(innolux->link); if (err < 0) dev_err(panel->dev, "failed to set display off: %d\n", err); @@ -104,8 +86,6 @@ static int innolux_panel_unprepare(struct drm_panel *pan= el) if (err < 0) return err; =20 - innolux->prepared =3D false; - return 0; } =20 @@ -114,9 +94,6 @@ static int innolux_panel_prepare(struct drm_panel *panel) struct innolux_panel *innolux =3D to_innolux_panel(panel); int err; =20 - if (innolux->prepared) - return 0; - gpiod_set_value_cansleep(innolux->enable_gpio, 0); =20 err =3D regulator_bulk_enable(innolux->desc->num_supplies, @@ -178,8 +155,6 @@ static int innolux_panel_prepare(struct drm_panel *pane= l) /* T7: 5ms */ usleep_range(5000, 6000); =20 - innolux->prepared =3D true; - return 0; =20 poweroff: @@ -189,18 +164,6 @@ static int innolux_panel_prepare(struct drm_panel *pan= el) return err; } =20 -static int innolux_panel_enable(struct drm_panel *panel) -{ - struct innolux_panel *innolux =3D to_innolux_panel(panel); - - if (innolux->enabled) - return 0; - - innolux->enabled =3D true; - - return 0; -} - static const char * const innolux_p079zca_supply_names[] =3D { "power", }; @@ -407,10 +370,8 @@ static int innolux_panel_get_modes(struct drm_panel *p= anel, } =20 static const struct drm_panel_funcs innolux_panel_funcs =3D { - .disable =3D innolux_panel_disable, .unprepare =3D innolux_panel_unprepare, .prepare =3D innolux_panel_prepare, - .enable =3D innolux_panel_enable, .get_modes =3D innolux_panel_get_modes, }; =20 --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:17 2024 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 482F68615F for ; Fri, 3 May 2024 21:36:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772208; cv=none; b=bsM1QdRBMIRclDQxGLI3LUrjbIcXzy2OHD8rZ2/rUeydH8mo9Tn5cVM4gzMq83DRIZQDYUOwqQZNMmnPhbisviWDsIYJEwCO2Ua0d33Fw4oO3TmSv1AsJiGSRDpRhXTu6bgbcd/TwmtJ3rmBiMEuGo+vXTiGQyLDTfdXLGGrvfc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772208; c=relaxed/simple; bh=Ls0hx0BhTj3G0QRMQs+tqGMhFB+yvlJdCpWTrSoM8rs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=cLxFmgoYbc/MYwCtNTQaponrepFqW2wyWnytLQR/6XOQRxpgWyTsHEwA5T3GelH034ZZE3Ot9YBijLmpDHYuoZLh1+7M6YkHWD3h+dJm0ZibXS1nMGADo8YxdDTAFGihV32EOsV2xxpyEsGXW/RDgWSB99/zwJkXHCaL7GbgwQU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=e/yRfOcP; arc=none smtp.client-ip=209.85.214.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="e/yRfOcP" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-1e5c7d087e1so1044575ad.0 for ; Fri, 03 May 2024 14:36:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772206; x=1715377006; darn=vger.kernel.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=AM3srp3tc9xHdA4+vQgvWU13AmEZ/1q1evFgoZKKMpU=; b=e/yRfOcPp2+qhZoSzW6aNc+ojRklJkTmQzVL/1ZN4PNY8jTbJyouM+E47OHrT3psbr A83I5VZNIlDcFJ5uAseBQvalFdE7YgThzgBm9w3C9VUCtbfmuv9S5bsnPJrmWGyLDA33 ocRpSFZ0RTqsdInua0eQre+1FPY0MgO7FzH0g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772206; x=1715377006; 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=AM3srp3tc9xHdA4+vQgvWU13AmEZ/1q1evFgoZKKMpU=; b=DhWocMGw/n5aBcTvAC2q93yTvkhjUINl/Fehl30tAhw0okTgRaM4EJDTc5rOdFnGr7 A1khPWfXbSiiSZPcLEdp0A8e1Y2Dn2FvFNKNI4iXLQIIckrYlrOARBvYA8tA9tyTa3Fi EEjjI3nBoHCeEgNI1H8YuN27PE/MGL2NdsDxTDAFe8DBv9wpZuT8acVacdehgpoIDRP3 47ih/a+gzGjZ+IKN9lbcK3oFFah2QO9JCbBejIfQJuCXwYNirpAVn/DSJ0SuBLjTglHb YhAba4ts13HiSSjMhiSh6RmDyNb6/3+z6/E6MiqluQDyMHmCKDAaDNxELV03riCum1mC CXkQ== X-Forwarded-Encrypted: i=1; AJvYcCVKtprxksnMDRjBBdKLyP2XHiW40q9epDzB7LPtIhYr8PgE3aprMJPbHZHMAf880q9a3mRWibbCKYiH3K9+7BUoRiutu+dvUXS+owir X-Gm-Message-State: AOJu0YzGM0kiLpS+sauEfR8RGq3OBI78OHqoam3EjbyF8RVc1lGkr6zx vqEbLwTuA9lAirdyVeO2YMoL/6pm34OP+p1W04W/VVG6JzqtXjJxTaFU0Mjd2FIdjVLfX/BTzNo ZCw== X-Google-Smtp-Source: AGHT+IHQD9LkPID127xDFcCRAQJiVGTr5XKbdWyjPjZmELM/1pOIiovaPXVxv+TzcgrmiYCp2kAmvQ== X-Received: by 2002:a17:903:1211:b0:1e0:115c:e03c with SMTP id l17-20020a170903121100b001e0115ce03cmr4713172plh.53.1714772206553; Fri, 03 May 2024 14:36:46 -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.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:36:45 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , Chris Zhong , Lin Huang , Brian Norris , =?UTF-8?q?Heiko=20St=C3=BCbner?= , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 09/48] drm/panel: innolux-p079zca: Don't call unprepare+disable at shutdown/remove Date: Fri, 3 May 2024 14:32:50 -0700 Message-ID: <20240503143327.RFT.v2.9.Iaddb8e0cab570e2f8066a4baf1d49239a820b799@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 Rockchip boards. The Rockchip driver appears 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: Chris Zhong Cc: Lin Huang Cc: Brian Norris Cc: "Heiko St=C3=BCbner" Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. drivers/gpu/drm/panel/panel-innolux-p079zca.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-innolux-p079zca.c b/drivers/gpu/dr= m/panel/panel-innolux-p079zca.c index 5833d3a0fc79..280f0fc35b67 100644 --- a/drivers/gpu/drm/panel/panel-innolux-p079zca.c +++ b/drivers/gpu/drm/panel/panel-innolux-p079zca.c @@ -471,13 +471,6 @@ static void innolux_panel_remove(struct mipi_dsi_devic= e *dsi) struct innolux_panel *innolux =3D mipi_dsi_get_drvdata(dsi); int err; =20 - err =3D drm_panel_unprepare(&innolux->base); - if (err < 0) - dev_err(&dsi->dev, "failed to unprepare panel: %d\n", err); - - err =3D drm_panel_disable(&innolux->base); - if (err < 0) - dev_err(&dsi->dev, "failed to disable panel: %d\n", err); =20 err =3D mipi_dsi_detach(dsi); if (err < 0) @@ -486,14 +479,6 @@ static void innolux_panel_remove(struct mipi_dsi_devic= e *dsi) innolux_panel_del(innolux); } =20 -static void innolux_panel_shutdown(struct mipi_dsi_device *dsi) -{ - struct innolux_panel *innolux =3D mipi_dsi_get_drvdata(dsi); - - drm_panel_unprepare(&innolux->base); - drm_panel_disable(&innolux->base); -} - static struct mipi_dsi_driver innolux_panel_driver =3D { .driver =3D { .name =3D "panel-innolux-p079zca", @@ -501,7 +486,6 @@ static struct mipi_dsi_driver innolux_panel_driver =3D { }, .probe =3D innolux_panel_probe, .remove =3D innolux_panel_remove, - .shutdown =3D innolux_panel_shutdown, }; module_mipi_dsi_driver(innolux_panel_driver); =20 --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:17 2024 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 80B14126F11 for ; Fri, 3 May 2024 21:36:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772210; cv=none; b=VXwz86k2ZVb6RDJKTmNbEs/Cb/H6xWRNv0OfQSVqqqVgUpfUL/zHV5FP5P+7Pe+v7A2MEzyRIyoMFhpKcO5xFdch3enVbPAFX036Ma5QYfGvya98Csqc26glUKl7it1nmm0rs1t3osrRfS5u6bek+qGsmTyurprkR3ooyZVF67I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772210; c=relaxed/simple; bh=lGsGSu2+gwavy9O86uOGkKCD4hIuresXwGsoETcDQE0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hcoGmkQXzJsgI4YJmptj700gDRWrtyk5l7mDDyOZHRdSCGb8Pkz7d/T9/UvpsYlakOmRBMunzqQPNDbOpKNf5MAdpylFCcqAl8Jv/Z8UnP2L/hbiN7G+Jab/k+cZGvsLSLpe6yrrv9xqCk9m/PUqU+TxD5/9VhAbH3yv95iIBXY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=gCoyoTnT; arc=none smtp.client-ip=209.85.214.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="gCoyoTnT" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-1eb24e3a2d9so1142735ad.1 for ; Fri, 03 May 2024 14:36:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772209; x=1715377009; darn=vger.kernel.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=NGK5xSZNNlb2uRbxmyeRSuB7caWdrwYvtVpURnzxX80=; b=gCoyoTnTCgwqKZ2OUb4dc/yu4sG+JDphbIin4Ogu5FrtN+aWpvvSDJ59ShqAYioAMs PasDhhF2iGkTQxSlkXsVeD3sMDx/BO0wgW6Nrd8APie76EoxqhBs1ZlEnfrTROMYY0Sc EmLPWaxynmUoJIZgf08VVq+FnV9aWxEfwdaA4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772209; x=1715377009; 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=NGK5xSZNNlb2uRbxmyeRSuB7caWdrwYvtVpURnzxX80=; b=qBw+D4In83+bMTDMN+TYqJ1ubj+fC8aOnGJD067ilu3leV7eUP3SZgCoUComPnCMqz oiYIKtu0sz86rhrSZUi3ehGQME6sQuUcEKgw+viG1IiQ4wOGzh3RQ958+3GiwPxVqfmC p3X4Q0K0yzKradZDDD5OtH6RGFoDu+RJjNBuKakWFCNuD+gEt5LgonrBhUAh+7JZBbHv YNo6Go9wrqrwrU59FUMYusOgtAtTrDjnZtSW7ZvMBk4WgGJ9yNoiETwmBry+qkzf4Cj+ QFSgZQajmPIHKDcT3FKZpd6FbNZdBqyZcr07irOKbJHrlmXByX16U/35di0utNjLwzhj CJjA== X-Forwarded-Encrypted: i=1; AJvYcCW+AWWvVj3IhNCLVN7zFO729nia2BCOXV7MdZVHtNk8O99b3VKO3+4kc+KC1XRRU4/wK/udr0uEZ4Ml87044aKjcnu7WcKTGFtKUX32 X-Gm-Message-State: AOJu0Ywot3cz8fcQQKdx9X6BfAP9D9dFfqpFw1i5fBp/ymnm6Kzf7hdE orSTerLXgSgSSweERE+36xckcNpUGcygZqLuJZ2zxKocI/tspEUfVmKWRB+AbA== X-Google-Smtp-Source: AGHT+IEempTTTQ3d9Vy5vnr244sB3FyliFh1+HIKi7tUNUcNLkibMfoJWgsA8T7pfYRVD6IrR06Bvw== X-Received: by 2002:a17:902:b617:b0:1dd:e114:121c with SMTP id b23-20020a170902b61700b001dde114121cmr3627968pls.56.1714772208843; Fri, 03 May 2024 14:36:48 -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.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:36:47 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , Jacobe Zang , Nicolas Belin , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 10/48] drm/panel: khadas-ts050: Stop tracking prepared/enabled Date: Fri, 3 May 2024 14:32:51 -0700 Message-ID: <20240503143327.RFT.v2.10.Ibed1026f20cab08c90fa376e68c2f23a343e826b@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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. Cc: Jacobe Zang Cc: Nicolas Belin Cc: Neil Armstrong Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. drivers/gpu/drm/panel/panel-khadas-ts050.c | 28 ---------------------- 1 file changed, 28 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-khadas-ts050.c b/drivers/gpu/drm/p= anel/panel-khadas-ts050.c index c54be0cc3f08..e35762ebdbd1 100644 --- a/drivers/gpu/drm/panel/panel-khadas-ts050.c +++ b/drivers/gpu/drm/panel/panel-khadas-ts050.c @@ -26,9 +26,6 @@ struct khadas_ts050_panel { struct gpio_desc *reset_gpio; struct gpio_desc *enable_gpio; struct khadas_ts050_panel_data *panel_data; - - bool prepared; - bool enabled; }; =20 struct khadas_ts050_panel_cmd { @@ -642,9 +639,6 @@ static int khadas_ts050_panel_prepare(struct drm_panel = *panel) unsigned int i; int err; =20 - if (khadas_ts050->prepared) - return 0; - gpiod_set_value_cansleep(khadas_ts050->enable_gpio, 0); =20 err =3D regulator_enable(khadas_ts050->supply); @@ -708,8 +702,6 @@ static int khadas_ts050_panel_prepare(struct drm_panel = *panel) =20 usleep_range(10000, 11000); =20 - khadas_ts050->prepared =3D true; - return 0; =20 poweroff: @@ -726,11 +718,6 @@ static int khadas_ts050_panel_unprepare(struct drm_pan= el *panel) struct khadas_ts050_panel *khadas_ts050 =3D to_khadas_ts050_panel(panel); int err; =20 - if (!khadas_ts050->prepared) - return 0; - - khadas_ts050->prepared =3D false; - err =3D mipi_dsi_dcs_enter_sleep_mode(khadas_ts050->link); if (err < 0) dev_err(panel->dev, "failed to enter sleep mode: %d\n", err); @@ -747,31 +734,17 @@ static int khadas_ts050_panel_unprepare(struct drm_pa= nel *panel) return 0; } =20 -static int khadas_ts050_panel_enable(struct drm_panel *panel) -{ - struct khadas_ts050_panel *khadas_ts050 =3D to_khadas_ts050_panel(panel); - - khadas_ts050->enabled =3D true; - - return 0; -} - static int khadas_ts050_panel_disable(struct drm_panel *panel) { struct khadas_ts050_panel *khadas_ts050 =3D to_khadas_ts050_panel(panel); int err; =20 - if (!khadas_ts050->enabled) - return 0; - err =3D mipi_dsi_dcs_set_display_off(khadas_ts050->link); if (err < 0) dev_err(panel->dev, "failed to set display off: %d\n", err); =20 usleep_range(10000, 11000); =20 - khadas_ts050->enabled =3D false; - return 0; } =20 @@ -815,7 +788,6 @@ static int khadas_ts050_panel_get_modes(struct drm_pane= l *panel, static const struct drm_panel_funcs khadas_ts050_panel_funcs =3D { .prepare =3D khadas_ts050_panel_prepare, .unprepare =3D khadas_ts050_panel_unprepare, - .enable =3D khadas_ts050_panel_enable, .disable =3D khadas_ts050_panel_disable, .get_modes =3D khadas_ts050_panel_get_modes, }; --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:17 2024 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 75F8E1292D9 for ; Fri, 3 May 2024 21:36:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772212; cv=none; b=hHnDqnEMIVQbUe71w8x2/P7Z0wE/xq4xMN9wKNcxeidoKyeowA6lKZnJBdyioKEacU7pbg/TgpiNS/ErqIJxENV2gBfEIfGIVtU3P5XTKH4tKZILL8Zbfa6SZ35RISFkCuZOh+e7xrghXy9sISp7DkNtSRCdS78Tom3E/p9ko5g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772212; c=relaxed/simple; bh=jVDqOKx90k4h/+SwWWujMqQkYI4MUrhH4WSXfqMYo30=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fhV2KITB+5LuWqnExlestYsNo/GBs857pjWfXhHLPGBGuc4t3oR5YY99ZIcWaqzQ+1laeq5hHQ3qKObLwSftmjol7lvJz5GVy5uCGDQC2HYmcU1N3izJm5OIkAfUA70y7zcgezTctQHb3N2Q/saqt6rLD/JKGvIPi9bHdbFV45M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=MopmZgKD; arc=none smtp.client-ip=209.85.214.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="MopmZgKD" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-1ec92e355bfso1187005ad.3 for ; Fri, 03 May 2024 14:36:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772211; x=1715377011; darn=vger.kernel.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=xpAqyGRZ35mrxRmKBHfboZzq/mHfdewzPnwv0OdchAs=; b=MopmZgKDn51Oop8MoOAajyfXr//Bxc+7I1NqJEpkDzFVI5XjEQA/EW8TycmtRn/kSu LXKtTe/3MkUBroPvATeOh6SrIqOylNTOb4MqphsCTypfJp1GVIInTa+zkZByHV9lBzyQ Mv8qICNYaI1xKMKH1BZ77c9EWIeydoZqX1O/g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772211; x=1715377011; 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=xpAqyGRZ35mrxRmKBHfboZzq/mHfdewzPnwv0OdchAs=; b=KcbXaglinnM5jAwkuJT3sXieCHEwHO6GHW/VqF6ODCmgxRO59hnTbBn3T+8I6qIY4j 2YkZCg8jT7QKncYoxskolNOlUbK/pId0RFeD4o+t0CqRHXzyr1yCsJCRw6R4LS/ITSfL oLnnQJRePTPrrJ+NAtMDLxFabWS+QVpiJZr+5WSiAF5oeMlJRWJTp1+PmO9XmW4hTTGf EKzoHuA2jyyHxCljEtA738wG5PFsKtvkaA+WuZRjllO/Y3kMunD+86VKdqnHBvm62X/U RYtERrAm40Gke4R1XQKaUuOzNotse5Wo1fuE7+7eQLctyeK0RzEUP8ilCpkwY+HIptOA LCFQ== X-Forwarded-Encrypted: i=1; AJvYcCXBoQ1jpJ/6n0GLFwNsJ+fRPJ9ghjdjLXu/aFarLgYH30ik1u7sZhNUgc0iuhDZkOgfGs+Y0wGp5b2/qIbzDGSzx6NGmvFXnm8qOW7y X-Gm-Message-State: AOJu0Yyhh+pkQd5XB3o/I3wQ8bdZ2eePrjZpTQCLNowXlMhQMOgfDUkR IKHJLsGNeI01jeteZijQZcPGT+5Js3x/fp0ihi/JqBJ0NYO166ksC+5F62GLvw== X-Google-Smtp-Source: AGHT+IHPgak4KhT/VY1k6i6WU80Ppl8jX085UmJogG4vsMPYn1oTd7Du1ToJIYk6Efeso5tSI4Y1lg== X-Received: by 2002:a17:902:ce87:b0:1e0:983c:d686 with SMTP id f7-20020a170902ce8700b001e0983cd686mr5162135plg.20.1714772210940; Fri, 03 May 2024 14:36:50 -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.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:36:50 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , Jacobe Zang , Nicolas Belin , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 11/48] drm/panel: khadas-ts050: Don't call unprepare+disable at shutdown/remove Date: Fri, 3 May 2024 14:32:52 -0700 Message-ID: <20240503143327.RFT.v2.11.I1ee65e7905bf5bf46a0e6c5126ac3c7aa25cb80b@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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: Jacobe Zang Cc: Nicolas Belin Cc: Neil Armstrong Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. drivers/gpu/drm/panel/panel-khadas-ts050.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-khadas-ts050.c b/drivers/gpu/drm/p= anel/panel-khadas-ts050.c index e35762ebdbd1..14932cb3defc 100644 --- a/drivers/gpu/drm/panel/panel-khadas-ts050.c +++ b/drivers/gpu/drm/panel/panel-khadas-ts050.c @@ -880,16 +880,6 @@ static void khadas_ts050_panel_remove(struct mipi_dsi_= device *dsi) dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err); =20 drm_panel_remove(&khadas_ts050->base); - drm_panel_disable(&khadas_ts050->base); - drm_panel_unprepare(&khadas_ts050->base); -} - -static void khadas_ts050_panel_shutdown(struct mipi_dsi_device *dsi) -{ - struct khadas_ts050_panel *khadas_ts050 =3D mipi_dsi_get_drvdata(dsi); - - drm_panel_disable(&khadas_ts050->base); - drm_panel_unprepare(&khadas_ts050->base); } =20 static struct mipi_dsi_driver khadas_ts050_panel_driver =3D { @@ -899,7 +889,6 @@ static struct mipi_dsi_driver khadas_ts050_panel_driver= =3D { }, .probe =3D khadas_ts050_panel_probe, .remove =3D khadas_ts050_panel_remove, - .shutdown =3D khadas_ts050_panel_shutdown, }; module_mipi_dsi_driver(khadas_ts050_panel_driver); =20 --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:17 2024 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D093212C7FD for ; Fri, 3 May 2024 21:36:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772215; cv=none; b=tucUR5gcoHyEK6E5WQSPivtoscvFjpQGS04c7jhCV9FZaXV3vGwg9K8lCO++LldRRLdTDbI1kb5paOOW/b9th2AHhsjx0BwEUoasSxMWWQhweVoAQT4tp8Li4q0uiVLj3JwS857SibbKawRubrymdpkvloEdNt9UGaSLXBAv0mk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772215; c=relaxed/simple; bh=NzqglraYiL6N3znxl8ANLNzO3z0wT085E7fsKkcmN34=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=P7PClL5CyAtTBdCKANfu8jyZSu/kbLiygJMkSzpgEEImE1L5BI5kyZEPzQFACvRPSPAFed2ZW6LSLN6Scp1zs+5lrNd+JdL40fStBbpWWyRgrw5geUOVzIVvCPdUq2/UU+4ZKKgxUYYUHPDWv8A79TKDRhfAXUs9qe98zivrqUo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=UBgEKdDI; arc=none smtp.client-ip=209.85.214.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="UBgEKdDI" Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-1ed835f3c3cso1038125ad.3 for ; Fri, 03 May 2024 14:36:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772213; x=1715377013; darn=vger.kernel.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=fIbC9LrwuAAq79Jeay6jAxq6GRcu3tw3vRcfcGuhdCM=; b=UBgEKdDI1ZHtsaGmHM9Mx3gEYjF39JjqLknDtVO0VOr8cG0G0rLrU3K40QvsW1vU66 hSJYF2E1s93K7/6k802hTyS0zS+Ws3bZtDrJkn5580Y3YAmgqb00tUg1rI9sLVCujzec EOCS7UFc251wcXfqypJYS36V8BfNADtafJSDA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772213; x=1715377013; 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=fIbC9LrwuAAq79Jeay6jAxq6GRcu3tw3vRcfcGuhdCM=; b=TPyBhdahB3z5T53dOlPN+Ws7jiZu4MpAFGqNgaE4rcv27/J5OoW1/WJ5D0r7JrRVDm 1PR3Mh4O0tm1D/HB8X4nS0gXnsjqU6gEg2XP2yT13GiVeEAs4S9icXBWznjVtGJtD6OI dGrSl5b+klcN6oeOCWW5ZlrhjKAJAuKfNFKLBlf2kogXzjLIt6cRXGuNe4Mclue88ldw UeHPRbf6/zHHGvabaAnD4qtmnqkL40X4AfLWGqS52U8Sf7jGkcNpPvDarsFRrWkvwqhb 5hFnQbaVpJcO9yBpfQP/tkDJJWrkGSnt88EIdIECqzOAItXaD8UkjWjeygM2aTVG3pdA uZnw== X-Forwarded-Encrypted: i=1; AJvYcCV1SVH5sP1KsJWtS/thYECLx8grNdaBwpFdM3ItVD0yTXmppdkcbZGjUNAlSUx5IKwYfOATJfuCQ7VmQHETRjCae/3mwASfk+gylQPf X-Gm-Message-State: AOJu0YzaOAo1ccfQNgUU4x+DT//h7ahkh4J0isXMRJm8ed0Rr+Wtj0Pr OI5le7sD28TiRN8KZBKibPljjZJaA15xv5O/XtPCM7JnKy9MUX2Qv1d9iXW6AA== X-Google-Smtp-Source: AGHT+IEJVtpxW/vIwHLrsnoyEyV1IoA8JCw5mhGllbU5SBDs6pbVC07r9dJwje7IMXdKxtbI6jQipw== X-Received: by 2002:a17:902:9f98:b0:1eb:6468:7fc3 with SMTP id g24-20020a1709029f9800b001eb64687fc3mr3513255plq.62.1714772213125; Fri, 03 May 2024 14:36:53 -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.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:36:52 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , Brian Norris , Chris Zhong , Nickey Yang , =?UTF-8?q?Heiko=20St=C3=BCbner?= , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 12/48] drm/panel: kingdisplay-kd097d04: Stop tracking prepared/enabled Date: Fri, 3 May 2024 14:32:53 -0700 Message-ID: <20240503143327.RFT.v2.12.I711d07c4f4738df199697fd534c452cdfa46a21f@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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: Brian Norris Cc: Chris Zhong Cc: Nickey Yang Cc: "Heiko St=C3=BCbner" Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. .../drm/panel/panel-kingdisplay-kd097d04.c | 31 ------------------- 1 file changed, 31 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c b/drivers/g= pu/drm/panel/panel-kingdisplay-kd097d04.c index 17f8d80cf2b3..88d775e000d4 100644 --- a/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c +++ b/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c @@ -23,9 +23,6 @@ struct kingdisplay_panel { =20 struct regulator *supply; struct gpio_desc *enable_gpio; - - bool prepared; - bool enabled; }; =20 struct kingdisplay_panel_cmd { @@ -185,15 +182,10 @@ static int kingdisplay_panel_disable(struct drm_panel= *panel) struct kingdisplay_panel *kingdisplay =3D to_kingdisplay_panel(panel); int err; =20 - if (!kingdisplay->enabled) - return 0; - err =3D mipi_dsi_dcs_set_display_off(kingdisplay->link); if (err < 0) dev_err(panel->dev, "failed to set display off: %d\n", err); =20 - kingdisplay->enabled =3D false; - return 0; } =20 @@ -202,9 +194,6 @@ static int kingdisplay_panel_unprepare(struct drm_panel= *panel) struct kingdisplay_panel *kingdisplay =3D to_kingdisplay_panel(panel); int err; =20 - if (!kingdisplay->prepared) - return 0; - err =3D mipi_dsi_dcs_enter_sleep_mode(kingdisplay->link); if (err < 0) { dev_err(panel->dev, "failed to enter sleep mode: %d\n", err); @@ -220,8 +209,6 @@ static int kingdisplay_panel_unprepare(struct drm_panel= *panel) if (err < 0) return err; =20 - kingdisplay->prepared =3D false; - return 0; } =20 @@ -231,9 +218,6 @@ static int kingdisplay_panel_prepare(struct drm_panel *= panel) int err, regulator_err; unsigned int i; =20 - if (kingdisplay->prepared) - return 0; - gpiod_set_value_cansleep(kingdisplay->enable_gpio, 0); =20 err =3D regulator_enable(kingdisplay->supply); @@ -275,8 +259,6 @@ static int kingdisplay_panel_prepare(struct drm_panel *= panel) /* T7: 10ms */ usleep_range(10000, 11000); =20 - kingdisplay->prepared =3D true; - return 0; =20 poweroff: @@ -289,18 +271,6 @@ static int kingdisplay_panel_prepare(struct drm_panel = *panel) return err; } =20 -static int kingdisplay_panel_enable(struct drm_panel *panel) -{ - struct kingdisplay_panel *kingdisplay =3D to_kingdisplay_panel(panel); - - if (kingdisplay->enabled) - return 0; - - kingdisplay->enabled =3D true; - - return 0; -} - static const struct drm_display_mode default_mode =3D { .clock =3D 229000, .hdisplay =3D 1536, @@ -341,7 +311,6 @@ static const struct drm_panel_funcs kingdisplay_panel_f= uncs =3D { .disable =3D kingdisplay_panel_disable, .unprepare =3D kingdisplay_panel_unprepare, .prepare =3D kingdisplay_panel_prepare, - .enable =3D kingdisplay_panel_enable, .get_modes =3D kingdisplay_panel_get_modes, }; =20 --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:17 2024 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 60E4412F382 for ; Fri, 3 May 2024 21:36:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772217; cv=none; b=OzxHhQqxQEC+17V+FeCJInKvwSlhzM+QOdWPQcbAVoKypIv/e5Mn7Mlx0lvrZ/zJ5PIGWMiLeVgT23Hz088rVXRdH3yevHuAyVy8Bct3TSx5cnjZdEQ3E1cYVj0nUMbsBmAoqgISBLquc3DLY9m3lEhWMF3puPN55ePUYu/0lxM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772217; c=relaxed/simple; bh=MBnyH8mXANNQ2wH6x1SnrtTpzMyE3MelDz2HOgqKRow=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=KITRoIDlE3Fgu29I34Qi6ZYEsBldXQXPxt4DeJGPjmVHt1o6FUdl28+UVtyfc27z7Fpn2mM1wE9/RMGNtCG+6hkvE9e/kk5FRaIhgD7TvVc+8C/Y5/2z07MydfePuqgWyz4JjoIBe92jPp4lLbP2E8fxCUe/GfchrOK8yaIU45k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=nwblLWNv; arc=none smtp.client-ip=209.85.214.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="nwblLWNv" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-1ed835f3c3cso1038375ad.3 for ; Fri, 03 May 2024 14:36:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772216; x=1715377016; darn=vger.kernel.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=Vb3TgP/wCNf81D+aV3nRlzqlLyhQoFFUaND2nsUQhqU=; b=nwblLWNvIIHb8q4WRA8BA6LcIblwz+OUJfxMT3S6xKoXAt01EIN/dRFW2Lhm49etHs qKGPVOGkhZMu93SGJ+B8b1xtsP6vkYFj8hBdR7EtEkUF/rRKvObcKU3h8ngXLG0+Lyk7 DhBB8Xw4uEuI0BXVilCnOpJ83SR57NXIEOju4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772216; x=1715377016; 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=Vb3TgP/wCNf81D+aV3nRlzqlLyhQoFFUaND2nsUQhqU=; b=FVhDpAKbBuPxbzFWEA3OfJUyZtledFEGfS7CDOCUVzGul9ptaCT/24ScaHL4DgFrgB TR/J00sYUP67sjP+kjUTA3unrxA8xp8BySBECF+/NLJD7E2b3DyKvrHUap1/Q9v78QF5 +5gLRhfdy5SEwXxNJ0bGroRKrj9+eNJFOb664vElOMbQFUQywcmHpg3AEFO/P4hTIZ39 eIMwpLOLYZ67rloFKLYNdhd/i895xlFVyBM3LxoOWZFVbZube65P4+wCwDRvcd7X8BtP SohqGUhr4X9eLqHcZAF/cOQpMFKj6CwujmHEcXNc6Wck0bEV6I+132zcWxUDMW0Cw/Of L95A== X-Forwarded-Encrypted: i=1; AJvYcCVV9k0HBCi/sCQ9q2WhR0qn+QJTCMxgEfrCoHgP8l3Ob/WcR/fKYUG1FBX6jDXbmn8YuF6gI2C7TO60fvkn6Zf9Wh5YUFXlcUBnGOiM X-Gm-Message-State: AOJu0YydDG85CC1vAY/kzOUmrP7rkvDJj+umLxwrl1GE5X6byOLfIk2u CP6Aps5/fel8O4EmS8dTfprdLHt5MjfM9H5xOCU5aWZ3lX8tbv+p0cn64wsDNA== X-Google-Smtp-Source: AGHT+IFNtgQI4tL4b59ZXyBnIDIYmn8Ia9hPYK7earn8DOm88NvX2c1QDLLSGNTvuzAvGjP8xynfPQ== X-Received: by 2002:a17:903:2306:b0:1eb:1af8:309f with SMTP id d6-20020a170903230600b001eb1af8309fmr5572876plh.4.1714772215701; Fri, 03 May 2024 14:36:55 -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.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:36:54 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , Brian Norris , Chris Zhong , Nickey Yang , =?UTF-8?q?Heiko=20St=C3=BCbner?= , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 13/48] drm/panel: kingdisplay-kd097d04: Don't call unprepare+disable at shutdown/remove Date: Fri, 3 May 2024 14:32:54 -0700 Message-ID: <20240503143327.RFT.v2.13.I6c7c84b1560dd374f6e7e8dc50f419a870d31d31@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 Rockchip boards. The Rockchip driver 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: Brian Norris Cc: Chris Zhong Cc: Nickey Yang Cc: "Heiko St=C3=BCbner" Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. .../gpu/drm/panel/panel-kingdisplay-kd097d04.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c b/drivers/g= pu/drm/panel/panel-kingdisplay-kd097d04.c index 88d775e000d4..d6b912277196 100644 --- a/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c +++ b/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c @@ -389,14 +389,6 @@ static void kingdisplay_panel_remove(struct mipi_dsi_d= evice *dsi) struct kingdisplay_panel *kingdisplay =3D mipi_dsi_get_drvdata(dsi); int err; =20 - err =3D drm_panel_unprepare(&kingdisplay->base); - if (err < 0) - dev_err(&dsi->dev, "failed to unprepare panel: %d\n", err); - - err =3D drm_panel_disable(&kingdisplay->base); - if (err < 0) - dev_err(&dsi->dev, "failed to disable panel: %d\n", err); - err =3D mipi_dsi_detach(dsi); if (err < 0) dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err); @@ -404,14 +396,6 @@ static void kingdisplay_panel_remove(struct mipi_dsi_d= evice *dsi) kingdisplay_panel_del(kingdisplay); } =20 -static void kingdisplay_panel_shutdown(struct mipi_dsi_device *dsi) -{ - struct kingdisplay_panel *kingdisplay =3D mipi_dsi_get_drvdata(dsi); - - drm_panel_unprepare(&kingdisplay->base); - drm_panel_disable(&kingdisplay->base); -} - static struct mipi_dsi_driver kingdisplay_panel_driver =3D { .driver =3D { .name =3D "panel-kingdisplay-kd097d04", @@ -419,7 +403,6 @@ static struct mipi_dsi_driver kingdisplay_panel_driver = =3D { }, .probe =3D kingdisplay_panel_probe, .remove =3D kingdisplay_panel_remove, - .shutdown =3D kingdisplay_panel_shutdown, }; module_mipi_dsi_driver(kingdisplay_panel_driver); =20 --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:17 2024 Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EFF5B130491 for ; Fri, 3 May 2024 21:36:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772220; cv=none; b=u6wd/nM7k+laZK+STxTNOum+JsVg8PvR92CcUl/Ss7JArTU7f8mJ/ZcF+FQK893AeRjoS03Qp6DOYdVKh95MEedUsj9nq8PlmVvgnfXdSQAq5D7iK8cmw2r14IRXoy5ICgLPNE7EFC0bIZAo6byoWQNQfRtGXQQvlaCcWKDkIis= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772220; c=relaxed/simple; bh=pUdvl+CJe8eK0rPum/1lmKmhajDiQ4Bck5/6AuBlyNo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=mcAl/XRX4HJcSCR9+5goTfHl2xaY0LxCWHu8VP9FrCC7f7iM21JTQcd72I/EPPzEhCldgMyHz2l5nr7DbfOZ6umq6t3x4vEHOHlbUeMKyMBhIqjPbsBOVFlkEgR7mkSRERHCUQ8MiMJM7swJxyC6rsSccaU+swDP5JjtRJoMRxQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=GsjJYihF; arc=none smtp.client-ip=209.85.215.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="GsjJYihF" Received: by mail-pg1-f181.google.com with SMTP id 41be03b00d2f7-61bbb208ea5so98697a12.0 for ; Fri, 03 May 2024 14:36:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772218; x=1715377018; darn=vger.kernel.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=Xn3kmqG9n+u6RTxNsaXpW9ople5vt6wNE5CodtGeIeA=; b=GsjJYihFgTGGCHIljXbubUgByrew70L9VSqGx7fx6axVdmsx2Hg3TluPTJUFedjRt7 ZV+rMIjNITiTL4PjESrH+sbbEFvx4Kh08hfrxDlO6Wv2mCOx9OE5610OhfcKfiuV+kfT QVm/M8m8Ky4nknLJTZiNG8+kZxiBN0VR+D7vY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772218; x=1715377018; 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=Xn3kmqG9n+u6RTxNsaXpW9ople5vt6wNE5CodtGeIeA=; b=YPHWsQGRYx98XcyyyBnSosiFy1kqsQSZbW/w+LEwenfGDUwlfU9we5ubwd9dbYb5SD j4DcCa8/aRp/1BgIf1XTA3s9Z9L6CwxqQf65yUIOhN8e2VQz2K1C92UoBjDqmWl0yTz+ OlqbwNqNEN7Fbq+NJA3MMOHTw0wKXWJ5CAXA6MWjI8oKFvHSMaEyLIWGjI/6FPlbE3zG zv5AoXQHdsOlT1uVuSeBs7DyI1QIajEYzxtt2qQbK/Fp3Qo8nVururtNj94Ae2kOiel8 9CqDgmMyBCz24Ee7M4xAmw/4u5kp/ybO5ywc6fbw+CW06Z2jCIiXBNwnRg4FqH03UVzb gjOQ== X-Forwarded-Encrypted: i=1; AJvYcCVUYcVclLMzAzXZyT4aYRecPAmSgwZtvjEp/5kqs2jtGrF0qM0ML7us1hd//sLGevIhW+QWMLwssHRxzhtL/gYm93/RMpsAfrC9uSSZ X-Gm-Message-State: AOJu0YyPQNR8WRlxTxh2yxjm6Y0WTUl9lvpMTJhsRy/0O6z8c4GRJEhK Wd9TqI3IrG4uEvuyiqpcyOaSJx4LR91KI9wMhG7vfvcttpeqjwNhnQiJqO4M5g== X-Google-Smtp-Source: AGHT+IHU+zTKbiqkq2N+BAjsxHc3GvfIh424IhHaVXyvXNqc/r0rVspgmWUaRIVseSK1shOdJ8cBgw== X-Received: by 2002:a17:90b:400b:b0:2b2:9b67:198a with SMTP id ie11-20020a17090b400b00b002b29b67198amr4603020pjb.34.1714772218223; Fri, 03 May 2024 14:36:58 -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.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:36:57 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , =?UTF-8?q?Heiko=20St=C3=BCbner?= , Quentin Schulz , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 14/48] drm/panel: ltk050h3146w: Stop tracking prepared Date: Fri, 3 May 2024 14:32:55 -0700 Message-ID: <20240503143327.RFT.v2.14.I264417152e65b4a2e374666010666fa1c2d973fc@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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: "Heiko St=C3=BCbner" Cc: Quentin Schulz Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard Reviewed-by: Quentin Schulz --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c b/drivers/g= pu/drm/panel/panel-leadtek-ltk050h3146w.c index 1a26205701b5..5894bf30524a 100644 --- a/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c +++ b/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c @@ -36,7 +36,6 @@ struct ltk050h3146w { struct regulator *vci; struct regulator *iovcc; const struct ltk050h3146w_desc *panel_desc; - bool prepared; }; =20 static const struct ltk050h3146w_cmd page1_cmds[] =3D { @@ -521,9 +520,6 @@ static int ltk050h3146w_unprepare(struct drm_panel *pan= el) struct mipi_dsi_device *dsi =3D to_mipi_dsi_device(ctx->dev); int ret; =20 - if (!ctx->prepared) - return 0; - ret =3D mipi_dsi_dcs_set_display_off(dsi); if (ret < 0) { dev_err(ctx->dev, "failed to set display off: %d\n", ret); @@ -539,8 +535,6 @@ static int ltk050h3146w_unprepare(struct drm_panel *pan= el) regulator_disable(ctx->iovcc); regulator_disable(ctx->vci); =20 - ctx->prepared =3D false; - return 0; } =20 @@ -550,9 +544,6 @@ static int ltk050h3146w_prepare(struct drm_panel *panel) struct mipi_dsi_device *dsi =3D to_mipi_dsi_device(ctx->dev); int ret; =20 - if (ctx->prepared) - return 0; - dev_dbg(ctx->dev, "Resetting the panel\n"); ret =3D regulator_enable(ctx->vci); if (ret < 0) { @@ -593,8 +584,6 @@ static int ltk050h3146w_prepare(struct drm_panel *panel) =20 msleep(50); =20 - ctx->prepared =3D true; - return 0; =20 disable_iovcc: --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:17 2024 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A94C912F382 for ; Fri, 3 May 2024 21:37:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772223; cv=none; b=P5CvSxYKpMXywLx6fr0LUmGPMo1NBa5W5ItE5hPTdRFa8a8O4BXLPV65V4tbXvqAME6jDMqOGU433sltcAMV7kvWms5W1xmIdTqQoE7GSn1IZp+WWqtcKi7cy48A7yB9mtuzttEF3cOFm4bBB9/Toi2gUZOIiEFAqA2u/zoj11A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772223; c=relaxed/simple; bh=ofQg9FgdPDQqQAShgmMqDyWZORG0+F8zbwQrNcERnsU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=QMV7fjJ7sQF43N0eqMN5mJhJXwJnkB5jacqUErNQI37iWs6GOEi8hZ3uaUIrJXm4cpBcjf4W+aDjbI39YOljN27u3LWFvk0sTZ8mMNYpK8IeFkXQxlYTljb4DgBVcf3PCCwRA9KMDTolNojmxKNX94xFCFusKsDrETFB5h8AWsA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=fOEdVGa3; arc=none smtp.client-ip=209.85.214.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="fOEdVGa3" Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-1ecff927a45so1150235ad.0 for ; Fri, 03 May 2024 14:37:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772221; x=1715377021; darn=vger.kernel.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=8Y9nTdENQ7Wsy544i8JrWRgyMyQ3M74fjSP7BIF4QEI=; b=fOEdVGa3biIGHT6JfOdgWL+Hzz/c6l+VwGM1SQDQ/PKXzkp1LeTrnJp5glxW8q39De c3Bu+V/21JbzD2zSwnib5Fm0z2Mcxg0L4GQWh2PJYZu2L/n1VmOXIVm8EFT/oOQuazgV S3QVeiQhO4SkGWlySbYapPo1ud/umx6W+btO4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772221; x=1715377021; 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=8Y9nTdENQ7Wsy544i8JrWRgyMyQ3M74fjSP7BIF4QEI=; b=FbxNPQMN8iNj34JG5OYh7zC9RMVNp7BYbirDF3ybbMxDqy15Mrz4X7RjvANRxdB+Sb V3d6vhz9InKr/OkcGO0NJPwpGXXuAGDycIqnpbez7DSpw/NcKyd0wXsrsGfAYy+u1nGD Y1a1Cp+z5VQYmwMyq2lVucNIfJX4ht0rgcziQnh7fqrpiQDBzwaR204bufBS7zSMG2jA DQriyH+NTUf6UgwqgkPkjsoggDFtWd/pOMOG8UFj67Pm5xssLVFBgxL5VuPfQ9YMGKaW eW30D0SgE5/MbWLoGG9YvB+FAO6M3Mehq7p1k55Bu1txHccUiN54auR4u7E5NzHw2+ME 0XzQ== X-Forwarded-Encrypted: i=1; AJvYcCWDqAtL1GX4KCVtGZ/v93g4jMvsfaVsRtDgGjaR3fgA4FIysON7ykHWsMT4Z2dVc82SeSSsriemD/0743PkNiK7Sr5rq89XEqGVArFp X-Gm-Message-State: AOJu0YwakG9/2ycBPUNSzEA+LhrkWdUQvCYCCZiDxLrnp4K6pIKcclnf FxmUUyZfo0F+7s3+j6Pe/pzh2MSsnWqmzL2wMPDqpAuNhEDMAfrQUCQZ4W02yQ== X-Google-Smtp-Source: AGHT+IG9ldtVTieXA1Mk9918TqXU0GmNr1vS54kcAamhylLrurY6wy29CnNThSUyMLFqb7DbECdGsQ== X-Received: by 2002:a17:902:a60c:b0:1e4:6938:6fe3 with SMTP id u12-20020a170902a60c00b001e469386fe3mr3701239plq.58.1714772220922; Fri, 03 May 2024 14:37:00 -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.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:37:00 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , =?UTF-8?q?Heiko=20St=C3=BCbner?= , Quentin Schulz , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 15/48] drm/panel: ltk050h3146w: Don't call unprepare+disable at shutdown/remove Date: Fri, 3 May 2024 14:32:56 -0700 Message-ID: <20240503143327.RFT.v2.15.Ibeb2e5692e34b136afe4cf55532f0696ab3f5eed@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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: "Heiko St=C3=BCbner" Cc: Quentin Schulz Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard Reviewed-by: Quentin Schulz Tested-by: Quentin Schulz # PX30 Ringneck=20 Tested-by: Quentin Schulz # RK3399 Puma with=20 --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. .../gpu/drm/panel/panel-leadtek-ltk050h3146w.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c b/drivers/g= pu/drm/panel/panel-leadtek-ltk050h3146w.c index 5894bf30524a..292aa26a456d 100644 --- a/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c +++ b/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c @@ -673,27 +673,11 @@ static int ltk050h3146w_probe(struct mipi_dsi_device = *dsi) return 0; } =20 -static void ltk050h3146w_shutdown(struct mipi_dsi_device *dsi) -{ - struct ltk050h3146w *ctx =3D mipi_dsi_get_drvdata(dsi); - int ret; - - ret =3D drm_panel_unprepare(&ctx->panel); - if (ret < 0) - dev_err(&dsi->dev, "Failed to unprepare panel: %d\n", ret); - - ret =3D drm_panel_disable(&ctx->panel); - if (ret < 0) - dev_err(&dsi->dev, "Failed to disable panel: %d\n", ret); -} - static void ltk050h3146w_remove(struct mipi_dsi_device *dsi) { struct ltk050h3146w *ctx =3D mipi_dsi_get_drvdata(dsi); int ret; =20 - ltk050h3146w_shutdown(dsi); - ret =3D mipi_dsi_detach(dsi); if (ret < 0) dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); @@ -725,7 +709,6 @@ static struct mipi_dsi_driver ltk050h3146w_driver =3D { }, .probe =3D ltk050h3146w_probe, .remove =3D ltk050h3146w_remove, - .shutdown =3D ltk050h3146w_shutdown, }; module_mipi_dsi_driver(ltk050h3146w_driver); =20 --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:17 2024 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8CA85130A77 for ; Fri, 3 May 2024 21:37:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772224; cv=none; b=ZiR42a/80Ghycc++ySFUMwYiOcsp4G8juS+KHhnz1EN2WeKjYqbFO2kC4P7Xi1oXcbxi55F2pSwME0IOVTQRDIxsVwgRJxF3F1N5CBgtWKHpqmsQFLe4tzpI01xjuG4pOQRdDtZnt0y+9OQClaF/EuflvSc8il0BuZYR2Uy9584= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772224; c=relaxed/simple; bh=btGKXLjURzhe5xM/tx4DR6oxHtKq4a2amrCKwZa0vtc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=k8RDIuxuYYwPhIDYXqDkVFPaL/bzsHG8z/CcTX0iv6gHMCXnC9hGxD3x/WZvGP8JdZFhX9PxCYMbrscRTAYwraxe745LUNPvDScEcgpD1yo6Cxv2EnoeTbjBG+1pG+O0S746oO5BrJY8XCRR9ALzorBNMxjCUdtruCplV3sOU+E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=VxghZ9NU; arc=none smtp.client-ip=209.85.214.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="VxghZ9NU" Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1ecff927a45so1150465ad.0 for ; Fri, 03 May 2024 14:37:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772223; x=1715377023; darn=vger.kernel.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=WGe/o9E+2J3mWXQ+Ut7332ISLmsjuHNvcfhFlYYK3u0=; b=VxghZ9NUwz8oXKAK0uJYfGXv8cZTORQWDqKrr1JpGbWsjpm0R/+nJ5FzeBbUSFpmrh DEnqI7NuS0yfMBZhhFpfk7Mtg7OJyliKFsd3uYh57UyhL0F0tQB4M+j5IhjmcYJzq5nP G+B9DFMueq/nB8R+ZxkgV0W6chIWGSduDcQe4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772223; x=1715377023; 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=WGe/o9E+2J3mWXQ+Ut7332ISLmsjuHNvcfhFlYYK3u0=; b=YuLfzjgoHJOlijAPrpgyxO1WDATxBzkqVtBf90fJFuJMCRnHpdqc+tj5WpfwQvqe5E Jg90eaMijdx1Ra0Jm9JgPsNkw+OwCw2cOMs7QANRBhC17IVz2VBr6R4UM8egqDM23leb X2zEuueMtozkX58QoDIk358aVDIJKlN9ST3MFx6p6/FqyvyrIleu3wr1wD6Kh8cEK4sZ EEkqSyuazIwZoRIMrB+iAv30dmkSqVnvf1MyUXc1yIAcAOidZv6b50GV36m//50i7Dau 5Elin7sdeLFRe3SGRLthKVUo8Lna6bSv/fOxvbsgG8DmBM0vGsKyEyTA7rz7jqxDnxmH YAsA== X-Forwarded-Encrypted: i=1; AJvYcCX7QYjajAd05JqUTEpJ921K6DziFyNHwnVZ9JdwJ9NVrMh1i7CWCQ/bSz5IOqUPiMhzzm93qE2gkAcTZeVPh1CPBWsMvwB3I1up5smR X-Gm-Message-State: AOJu0Yw//tpEOtQ9fevsM3oOlocgtvC1XQk3ytFNztqD2ZOdCuGYpKFS MNAi1/AVTyfCm60sORQYAIhuMmZbGthW5/cBtMl+rw8cvVRItUyAymlRGLnkgw== X-Google-Smtp-Source: AGHT+IEgRFrCTmA76ZQ+ZA/ZsnLrxvKdZ+FvjBO/HzwbNFAg+uY38D+QTINvkSf/bzeDzCo33IN3pA== X-Received: by 2002:a17:902:d386:b0:1e7:d492:1206 with SMTP id e6-20020a170902d38600b001e7d4921206mr4129620pld.53.1714772222926; Fri, 03 May 2024 14:37:02 -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.37.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:37:02 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , =?UTF-8?q?Heiko=20St=C3=BCbner?= , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 16/48] drm/panel: ltk500hd1829: Stop tracking prepared Date: Fri, 3 May 2024 14:32:57 -0700 Message-ID: <20240503143327.RFT.v2.16.I4f574b87fe24765ddd4424437159b37a6481aa1a@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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: "Heiko St=C3=BCbner" Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. drivers/gpu/drm/panel/panel-leadtek-ltk500hd1829.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-leadtek-ltk500hd1829.c b/drivers/g= pu/drm/panel/panel-leadtek-ltk500hd1829.c index a4c9a5cb9811..ef27cab08f1d 100644 --- a/drivers/gpu/drm/panel/panel-leadtek-ltk500hd1829.c +++ b/drivers/gpu/drm/panel/panel-leadtek-ltk500hd1829.c @@ -40,7 +40,6 @@ struct ltk500hd1829 { struct regulator *vcc; struct regulator *iovcc; const struct ltk500hd1829_desc *panel_desc; - bool prepared; }; =20 static const struct ltk500hd1829_cmd ltk101b4029w_init[] =3D { @@ -492,9 +491,6 @@ static int ltk500hd1829_unprepare(struct drm_panel *pan= el) struct mipi_dsi_device *dsi =3D to_mipi_dsi_device(ctx->dev); int ret; =20 - if (!ctx->prepared) - return 0; - ret =3D mipi_dsi_dcs_set_display_off(dsi); if (ret < 0) dev_err(panel->dev, "failed to set display off: %d\n", ret); @@ -510,8 +506,6 @@ static int ltk500hd1829_unprepare(struct drm_panel *pan= el) regulator_disable(ctx->iovcc); regulator_disable(ctx->vcc); =20 - ctx->prepared =3D false; - return 0; } =20 @@ -522,9 +516,6 @@ static int ltk500hd1829_prepare(struct drm_panel *panel) unsigned int i; int ret; =20 - if (ctx->prepared) - return 0; - ret =3D regulator_enable(ctx->vcc); if (ret < 0) { dev_err(ctx->dev, "Failed to enable vci supply: %d\n", ret); @@ -568,8 +559,6 @@ static int ltk500hd1829_prepare(struct drm_panel *panel) goto disable_iovcc; } =20 - ctx->prepared =3D true; - return 0; =20 disable_iovcc: --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:17 2024 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E0CA5130AE6 for ; Fri, 3 May 2024 21:37:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772227; cv=none; b=C6blJSRu/4PQEICdKuzrYhXBsUHgLAcKav5yZTyxFKq51Ne9f03NmQ4g9YAEdKye27NCCqENvYhiz/KCJGTK2s8MWcyBe82LDk44FpMSzC5K7CTMLbpOMLTNhJIS3jM2DFMSbRhs6VfWgl6xzFP2NQ6mLaUfVdbu2bMgaoItsb4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772227; c=relaxed/simple; bh=lFIz7Wv/Gno+bqsodv/erUwQ6imEDad+1TPMruFsDME=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=r8D3Kyeo8gt4+HRjAQYcU/x11j81EnX4fIaCN83ZOUSR97LZcYUCb7QPXOT9NMja03ZdZaycWBoEQokpzk3Y36keXrJaFIxCroTfKffHDBQXk7v2Byvn088sEBllLRWKg7B3N+VT2o2kmE0pBUofz86q2Cg3Dvf9iJlp8WuQPhQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=oD8zRC2H; arc=none smtp.client-ip=209.85.214.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="oD8zRC2H" Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1e5715a9ebdso1040875ad.2 for ; Fri, 03 May 2024 14:37:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772225; x=1715377025; darn=vger.kernel.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=OurSfwTANRkudP5WoG3OHb0cRgGIUvtMPN3apL/0E6k=; b=oD8zRC2HIgKGEYYzfybZydwxjjkN+5mGDxSJ3gPX+N9zKMc/pgUZ/eYQM4Ow1yQ3rc eBvhiC1MulWD4JBOd0R77PNEhGB25pN7gBkl+f4jQal+4pqZBAJ5wkKIP/tLPQMuFq1J SPHJ2gloin1gX1RkABJV1U3fx5kTrWZgcwjWI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772225; x=1715377025; 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=OurSfwTANRkudP5WoG3OHb0cRgGIUvtMPN3apL/0E6k=; b=W+xvr+ZaF84C6PsgRPJ+vQWiI0PSW6Ew7aHZw9L3xR8ioclxErXCjddL8bH5hJtH55 QC2hNMmoxeBJi0Zl04eT36q+c0uu3a0trd9ufxqrqJkfz9r7xthQuQQbvwc6E/ueIm5J nxX0XherxiCvsytOSm8s9CdM28fBLpDedqh2VkXDpSyM3IYmfvq+C2A2oOy7X4Eb5ZoB qx1s8M3SrbZzoywtWFyCuWx1dg7rDcCKr+AO6wTecx0HQKvoHtF/wR/UcT3I++wDSjmK xp7Y8ENf6VzpLTE5MQFK5BbQ+S4MSI2smovrXbxF2jfdsoba+CAvJ8mUZ/3/OEHr7Ziy OdWg== X-Forwarded-Encrypted: i=1; AJvYcCUZ1EWyrmmrYjxHLFkuEquMLpfhTDPHQBAaInhBhvt2ZCmmiL6ZGGiMwBP680MbyfyNx+uyc3WOZ91+ehvRDXn12yN3Bmyu/Lq69ZJ4 X-Gm-Message-State: AOJu0YyOSYPrOgbHSIc7vbZ+SuSmmTJ9QTiayDySIMqQSQrzoMg28DtC Q9vj6TZw7ZIotP0w2vAgyYaStS9ZyQHh9FcCF83VwKqLlhTLdpPl2QGvqopjqQ== X-Google-Smtp-Source: AGHT+IH9vby0Or/VZX1bepw3qRTBDCpHhFvXpQCEjgbtETO8XlYEb0zz4N/sIP1EkhPbEGMjNfnqIA== X-Received: by 2002:a17:902:e802:b0:1e6:40f1:9357 with SMTP id u2-20020a170902e80200b001e640f19357mr4411172plg.8.1714772225244; Fri, 03 May 2024 14:37:05 -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.37.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:37:04 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , =?UTF-8?q?Heiko=20St=C3=BCbner?= , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 17/48] drm/panel: ltk500hd1829: Don't call unprepare+disable at shutdown/remove Date: Fri, 3 May 2024 14:32:58 -0700 Message-ID: <20240503143327.RFT.v2.17.If3edcf846f754b425959980039372a9fd1599ecc@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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: "Heiko St=C3=BCbner" Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. .../gpu/drm/panel/panel-leadtek-ltk500hd1829.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-leadtek-ltk500hd1829.c b/drivers/g= pu/drm/panel/panel-leadtek-ltk500hd1829.c index ef27cab08f1d..6b18cf00fd4a 100644 --- a/drivers/gpu/drm/panel/panel-leadtek-ltk500hd1829.c +++ b/drivers/gpu/drm/panel/panel-leadtek-ltk500hd1829.c @@ -662,27 +662,11 @@ static int ltk500hd1829_probe(struct mipi_dsi_device = *dsi) return 0; } =20 -static void ltk500hd1829_shutdown(struct mipi_dsi_device *dsi) -{ - struct ltk500hd1829 *ctx =3D mipi_dsi_get_drvdata(dsi); - int ret; - - ret =3D drm_panel_unprepare(&ctx->panel); - if (ret < 0) - dev_err(&dsi->dev, "Failed to unprepare panel: %d\n", ret); - - ret =3D drm_panel_disable(&ctx->panel); - if (ret < 0) - dev_err(&dsi->dev, "Failed to disable panel: %d\n", ret); -} - static void ltk500hd1829_remove(struct mipi_dsi_device *dsi) { struct ltk500hd1829 *ctx =3D mipi_dsi_get_drvdata(dsi); int ret; =20 - ltk500hd1829_shutdown(dsi); - ret =3D mipi_dsi_detach(dsi); if (ret < 0) dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", ret); @@ -710,7 +694,6 @@ static struct mipi_dsi_driver ltk500hd1829_driver =3D { }, .probe =3D ltk500hd1829_probe, .remove =3D ltk500hd1829_remove, - .shutdown =3D ltk500hd1829_shutdown, }; module_mipi_dsi_driver(ltk500hd1829_driver); =20 --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:17 2024 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C5D0A130E20 for ; Fri, 3 May 2024 21:37:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772229; cv=none; b=c4aPRQG3jSPiC6aBlqLoe0IH4yxzqEO1PSzLmz3/eKxcGOSYBrToHWk/MB40bfRu8XgqW2nZG4wqvt/KM6Vn3octFf+irE+fNT0haCWz1mCr/QAkB/P2nAhXQYdJfvQVAqcHcZbgy6OKQRUexMO6nCzYKsF2MsbsbseNmPPF9xg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772229; c=relaxed/simple; bh=r3hVR3bIOaoHmCPi1HOlyW0Sq7NKBMDtJZVIfjucJFI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=laBCkI6c7X+mCKCd0apYPYQGjTvR9H+eP3t1+Um9HmU7YZiOqmQ4PIazSk2/PUpMIUZY+Td1xxcYaTupZyeoBPa77t3ZvMO0bqSjii+WGuzS90PzJpWQ4KzUfz9PqKfbTy9kZgPKm8+Gkx3YGe+r50+lh0hTVqiKAWAYAylwzik= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=XQbib2HF; arc=none smtp.client-ip=209.85.214.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="XQbib2HF" Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1ecff927a45so1151025ad.0 for ; Fri, 03 May 2024 14:37:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772227; x=1715377027; darn=vger.kernel.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=9+/1qUyCdCzkVssOOJ1mxYlZquUA9CwegGnK+VEhW+o=; b=XQbib2HF7I8X3w4PLUxh7JO9jwaLs+j7O9ZZ1QjWZ8snEC3alv4tjehBVPS2IkqcH+ O7QHIjCXBf/nXKehm9cyUYSHaQ3OiN1LcP2NQ6k+oSJDTpXq3VVAti4nUJqAhoKAYuj2 FrQjXfqWwRke5ufMFoMN48jg/y/A2+mdNC3K8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772227; x=1715377027; 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=9+/1qUyCdCzkVssOOJ1mxYlZquUA9CwegGnK+VEhW+o=; b=bvd8cigxgFGLE7lHXVvXY9f7t6grc3+gsedrDCUicStb6DJtP0AAgYGn1BZwoXPfHP 1KclzIC0kpjucKvPDPWgu/llmtLtHzZqwQbgUqbl+A/kvGc3M9lVRWkFWPF75xkSCvI4 VihOs7pQPLdyEdC1J1ScydvvB9fwFrcZjuONRjCd5bZvby8pUrqNDSb9RjV/Gwp8+GHN H3vUlL0JUsr3aiCFlnGilU2K1BDEQseHU/iJucOg1IquswZD61yvY9WWkhGzcT1GGn2X f7O8pk30DAe1RNSoND32nmrubHO/8RzlbH92/sNdMPrkVv7fSzLoXewcx1A+th5g/DwG XLDA== X-Forwarded-Encrypted: i=1; AJvYcCX26UKmfOWwKImNkqu/md/MZXfo/1r3qsGA0pl8WvmxGINCf345jKsarYxCR7YTsDccJ0R8v5KxQcmzlunVpY8W18kH5HnbbXbnf0mw X-Gm-Message-State: AOJu0YwoTnYWhyjZush9afGqRpXu0v7bG4ZsKRjp3GsJv3jyxkmM9RAZ T3ykx1joPxzMjnvuziXRG2TS2+iGC6n5l1PyryzuJVcgVdcvPJKW8DavvzOzJg== X-Google-Smtp-Source: AGHT+IGTWXuB+YR8b+Za+D7wJjlj72NgkCjkNj7UREApXr3TOavCp/wlhNUfEqh97guBF+8UAksjJg== X-Received: by 2002:a17:903:2344:b0:1ec:2bca:5aa8 with SMTP id c4-20020a170903234400b001ec2bca5aa8mr5189630plh.6.1714772227116; Fri, 03 May 2024 14:37:07 -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.37.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:37:06 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , Sumit Semwal , Benni Steini , Joel Selvaraj , Marijn Suijten , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 18/48] drm/panel: novatek-nt36672a: Stop tracking prepared Date: Fri, 3 May 2024 14:32:59 -0700 Message-ID: <20240503143327.RFT.v2.18.I13a06b9e6f5920659b1e5d12543b3cd9066383b8@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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. Cc: Sumit Semwal Cc: Benni Steini Cc: Joel Selvaraj Cc: Marijn Suijten Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. drivers/gpu/drm/panel/panel-novatek-nt36672a.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-novatek-nt36672a.c b/drivers/gpu/d= rm/panel/panel-novatek-nt36672a.c index 3886372415c2..35aace79613a 100644 --- a/drivers/gpu/drm/panel/panel-novatek-nt36672a.c +++ b/drivers/gpu/drm/panel/panel-novatek-nt36672a.c @@ -72,8 +72,6 @@ struct nt36672a_panel { struct regulator_bulk_data supplies[ARRAY_SIZE(nt36672a_regulator_names)]; =20 struct gpio_desc *reset_gpio; - - bool prepared; }; =20 static inline struct nt36672a_panel *to_nt36672a_panel(struct drm_panel *p= anel) @@ -119,9 +117,6 @@ static int nt36672a_panel_unprepare(struct drm_panel *p= anel) struct nt36672a_panel *pinfo =3D to_nt36672a_panel(panel); int ret; =20 - if (!pinfo->prepared) - return 0; - /* send off cmds */ ret =3D nt36672a_send_cmds(panel, pinfo->desc->off_cmds, pinfo->desc->num_off_cmds); @@ -147,8 +142,6 @@ static int nt36672a_panel_unprepare(struct drm_panel *p= anel) if (ret < 0) dev_err(panel->dev, "power_off failed ret =3D %d\n", ret); =20 - pinfo->prepared =3D false; - return ret; } =20 @@ -179,9 +172,6 @@ static int nt36672a_panel_prepare(struct drm_panel *pan= el) struct nt36672a_panel *pinfo =3D to_nt36672a_panel(panel); int err; =20 - if (pinfo->prepared) - return 0; - err =3D nt36672a_panel_power_on(pinfo); if (err < 0) goto poweroff; @@ -221,8 +211,6 @@ static int nt36672a_panel_prepare(struct drm_panel *pan= el) =20 msleep(120); =20 - pinfo->prepared =3D true; - return 0; =20 poweroff: --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:17 2024 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9A9FE131184 for ; Fri, 3 May 2024 21:37:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772232; cv=none; b=Vf6d4p4bobTChIEARUwOFn9P6XM1nqtjuFEcJoKlvPn9KcTZ1U579wdmtZCwyBlBeFGcwLQ0G+EkuwZSqWpva6ODUMGf5/Wzm/Fsg8FWdjL96VAcZTowUesfnuDPzclGi+2n9H87PapMZAtcKraaTVeRQ8inG7CcCzAv41NJFwU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772232; c=relaxed/simple; bh=fBAyG8ZF/YZRA5320CSXCbxyFfF3cr2FGMyGleTMfpk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oXSRZPRh3k2Ev2nPq+nfuqRHZSxncM5iCyGc5z32HiYztPp8JbF3JVJElopWV/6PC6qBg5N3mRAGhiX/PKXXbMRWa+jh3x444ZBkFOD0u9Dl1qOnKf6505y8OwS0K+qsB22vuqFeMJqOlo+R10F9Hi3OTAfOiVYZNVUswZDUpew= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=Y1Dj/Fdc; arc=none smtp.client-ip=209.85.214.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Y1Dj/Fdc" Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1ed41eb3382so1029675ad.0 for ; Fri, 03 May 2024 14:37:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772229; x=1715377029; darn=vger.kernel.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=jCEzmsJkNVqJjLKEek1G559OvdmwxBqijlKTr/wX13A=; b=Y1Dj/Fdcrt28zdpemderW4vfG5nQpv7mSO1+ItxkOZ3HcvBsR6gXIuduHB5OARerfv PiXygsxbhrS/AHoAlSUKjgPq9WBr5RA0UdIgWSsOUIBurJQi+FtCoAJbE4aKFc5aljK4 eUYjzpaMmbiXyg5Yoky7KdwNsRyCsRnUURfD0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772229; x=1715377029; 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=jCEzmsJkNVqJjLKEek1G559OvdmwxBqijlKTr/wX13A=; b=oMEOucyma9O9seRpJlhGVzmlwdr7mcWxIuuukBqKtAam2ke9Pj4ppiwWWoGFSmSJBt mAKDJNoJ6g8fu4taVElRF77QxG/naN4NjRRtWdO7T9p4YtIh+avArGi4FGiaV4lb9yQp yzzaq/ABv0dv8XfBp+Zd8mFFuN4o+Fz6Tt9N/ZeCeR/K6mjLIzTD4ntXvY1GAzqsLQ6R 0ANoz9qDMFzhwalMQ3IjeE6qzhXjGEgLyxheWf+tTTbzdQnqe8JZsMLTCmQ83NXkT8fV ZcQevV8FYEvecmeGlPCPNUquyHl1cr5PpJFnEvrAe6LvFCJMzcyYcnmsXkDFGxdhIBUm 2SVQ== X-Forwarded-Encrypted: i=1; AJvYcCV1Piu9I9m0er2t2DZ1vA4D/X0delcMiUmpYsJN+/WfLSiA7Wj7oxAzLSEFq+Qx8nx23r+q7yaw/dhEW65fj8B9zFMuqFECouXj3d5t X-Gm-Message-State: AOJu0YzXcC22ETvFZsV/OZ1TcHNp+1hiOoLBK3SSbftbrDaJLHMkO6Wx 5OQHk6kKrGtXfP1OQrtPLX05j76mztopzI/lwwyJZ/8W1CoeebMvolVaH1lqWQ== X-Google-Smtp-Source: AGHT+IF/zJruBSwTUZM1XWyjeIBA3vGsxjzRfWQyTdUJXMgAkw1voDP5oQ1EzE0p/oXqEfQ5DM+Pdw== X-Received: by 2002:a17:902:bb17:b0:1ec:7b0d:9eb9 with SMTP id im23-20020a170902bb1700b001ec7b0d9eb9mr3415331plb.64.1714772229039; Fri, 03 May 2024 14:37:09 -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.37.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:37:08 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , Sumit Semwal , Benni Steini , Joel Selvaraj , Marijn Suijten , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 19/48] drm/panel: novatek-nt36672a: Don't call unprepare+disable at shutdown/remove Date: Fri, 3 May 2024 14:33:00 -0700 Message-ID: <20240503143327.RFT.v2.19.I67819ba5513d4ef85f254a68b22a3402b4cdf30f@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Qualcomm boards. The Qualcomm driver appears 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: Sumit Semwal Cc: Benni Steini Cc: Joel Selvaraj Cc: Marijn Suijten Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. drivers/gpu/drm/panel/panel-novatek-nt36672a.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-novatek-nt36672a.c b/drivers/gpu/d= rm/panel/panel-novatek-nt36672a.c index 35aace79613a..c2abd20e0734 100644 --- a/drivers/gpu/drm/panel/panel-novatek-nt36672a.c +++ b/drivers/gpu/drm/panel/panel-novatek-nt36672a.c @@ -656,14 +656,6 @@ static void nt36672a_panel_remove(struct mipi_dsi_devi= ce *dsi) struct nt36672a_panel *pinfo =3D mipi_dsi_get_drvdata(dsi); int err; =20 - err =3D drm_panel_unprepare(&pinfo->base); - if (err < 0) - dev_err(&dsi->dev, "failed to unprepare panel: %d\n", err); - - err =3D drm_panel_disable(&pinfo->base); - if (err < 0) - dev_err(&dsi->dev, "failed to disable panel: %d\n", err); - err =3D mipi_dsi_detach(dsi); if (err < 0) dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err); @@ -671,14 +663,6 @@ static void nt36672a_panel_remove(struct mipi_dsi_devi= ce *dsi) drm_panel_remove(&pinfo->base); } =20 -static void nt36672a_panel_shutdown(struct mipi_dsi_device *dsi) -{ - struct nt36672a_panel *pinfo =3D mipi_dsi_get_drvdata(dsi); - - drm_panel_disable(&pinfo->base); - drm_panel_unprepare(&pinfo->base); -} - static const struct of_device_id tianma_fhd_video_of_match[] =3D { { .compatible =3D "tianma,fhd-video", .data =3D &tianma_fhd_video_panel_d= esc }, { }, @@ -692,7 +676,6 @@ static struct mipi_dsi_driver nt36672a_panel_driver =3D= { }, .probe =3D nt36672a_panel_probe, .remove =3D nt36672a_panel_remove, - .shutdown =3D nt36672a_panel_shutdown, }; module_mipi_dsi_driver(nt36672a_panel_driver); =20 --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:17 2024 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2BCF57E116 for ; Fri, 3 May 2024 21:37:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772233; cv=none; b=ducluE/7sL4kJVrgjUbPH2HLHcDpHHbm7SeaTcgRnf7JW4N734NlRQICvC+biN07m5h9CqB+QiB0kNHY3xKXkdqmdxdhtMxS/pmoxjbZd2Y2+TrI7Wg+bUgnHDHE0n6E3BR+L7CeoSVSu4qp/Q6EjvQ9JSgLVDMGtFbzOWmav1E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772233; c=relaxed/simple; bh=olvoMor9lk9RgjsPtUNMpvGYduJbBc8bUMlTJb3Saag=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=adnZfpV4TvEp53LSJjpRTQVhniTvyVXunMNU/ZIRoDNoWVNlrC1kXa9GrlCg/7NRuyh2cCpYaW95IIYZUhPEDrMSqGF2G8xiUE0vfZa7JDiw7YXOOcWLEdkbdGjAUGHrICMQg72al+e0cSxGueaGsueUzlAibSVES6m3K3+WprE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=C9tIzGJ5; arc=none smtp.client-ip=209.85.214.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="C9tIzGJ5" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-1ec4dc64c6cso1158365ad.0 for ; Fri, 03 May 2024 14:37:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772231; x=1715377031; darn=vger.kernel.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=AkEQE93f5W3qrIiQKk9BZKKCez6HKRClYa+QpRpQRiA=; b=C9tIzGJ5MksCGHycLYWutyzPT52K0Oj0Xx147zwHjgUNY64s3sSFe/x3gOE1C7X28o IH0pDpjm3EEFp0/oX1uzd3BM2Cy5mX0x6Jf5stDa15gEvKq82fffWmfnXuFM7YdOJa7f 0rI2KC6NvgxHdVlNoIwH9Qg50ey8LVqWIpwe4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772231; x=1715377031; 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=AkEQE93f5W3qrIiQKk9BZKKCez6HKRClYa+QpRpQRiA=; b=dDjhMVX27m213BPtsD3hp3c2BD/JNlVXCukvwIxYvSrZJU3bylMhkSaWIC6Y8YEVAd RxL2pxG0tr8Ui2yRYQAsoLLG6pFIpP01DUZhnEOMHj+Fxujp4M1gk2RzodT6f9ZvvS8l IFaoF1Cdog3aC7IC7QyzY+K0NoYNvaxW+uQyv/+qCaCi6lEuh52SPJA6+UaXXDnM1sGH Npd6gigPGPFhLfhjOKw4rvFrIm0JSXb9auftcsfsdYBYjIOZ5a5oKy2KS/KnPIgfzysR JUeayhXJZZDCY7cm3hJyExlmBpj+2YhsbdldlTQKha+sqNTtrpg1ti+YWgDql6TJSXjI wG9g== X-Forwarded-Encrypted: i=1; AJvYcCVpFt334g9e9ydh/XA4S6a74RZAHv6IHlFpN87Z7dkIM2Qjor/s3/bCEa+dMYBh+ORr5anAp5UJsn3YzIbxBvdERiP443yvkm3sZCzy X-Gm-Message-State: AOJu0YzHU4uBnXmgX+52zyY9b/NxgeX61xeFDQTD8LnD2d0m7y4T5ACj bf18oQN/Sq/okfTfG5SpbjoKYregVfpQU4PF+hPoGRv2BEAVb5ck8i+Va+y2cA== X-Google-Smtp-Source: AGHT+IErDEdWQJDxA1HZWTCGw5TL3HdjrluPTuCRLtiAQGGfIJv8XgK1D0yAqk5RVYxDWbW7F4IUEA== X-Received: by 2002:a17:902:ecc7:b0:1e3:ca5a:2d9a with SMTP id a7-20020a170902ecc700b001e3ca5a2d9amr4783895plh.53.1714772231641; Fri, 03 May 2024 14:37:11 -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.37.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:37:10 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , Stefan Mavrodiev , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 20/48] drm/panel: olimex-lcd-olinuxino: Stop tracking prepared/enabled Date: Fri, 3 May 2024 14:33:01 -0700 Message-ID: <20240503143327.RFT.v2.20.I6a96d762be98321e02f56b5864359258d65d9da8@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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. Cc: Stefan Mavrodiev Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. .../drm/panel/panel-olimex-lcd-olinuxino.c | 41 ------------------- 1 file changed, 41 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-olimex-lcd-olinuxino.c b/drivers/g= pu/drm/panel/panel-olimex-lcd-olinuxino.c index 4819ada69482..8a687d3ba236 100644 --- a/drivers/gpu/drm/panel/panel-olimex-lcd-olinuxino.c +++ b/drivers/gpu/drm/panel/panel-olimex-lcd-olinuxino.c @@ -64,9 +64,6 @@ struct lcd_olinuxino { struct i2c_client *client; struct mutex mutex; =20 - bool prepared; - bool enabled; - struct regulator *supply; struct gpio_desc *enable_gpio; =20 @@ -78,30 +75,13 @@ static inline struct lcd_olinuxino *to_lcd_olinuxino(st= ruct drm_panel *panel) return container_of(panel, struct lcd_olinuxino, panel); } =20 -static int lcd_olinuxino_disable(struct drm_panel *panel) -{ - struct lcd_olinuxino *lcd =3D to_lcd_olinuxino(panel); - - if (!lcd->enabled) - return 0; - - lcd->enabled =3D false; - - return 0; -} - static int lcd_olinuxino_unprepare(struct drm_panel *panel) { struct lcd_olinuxino *lcd =3D to_lcd_olinuxino(panel); =20 - if (!lcd->prepared) - return 0; - gpiod_set_value_cansleep(lcd->enable_gpio, 0); regulator_disable(lcd->supply); =20 - lcd->prepared =3D false; - return 0; } =20 @@ -110,27 +90,11 @@ static int lcd_olinuxino_prepare(struct drm_panel *pan= el) struct lcd_olinuxino *lcd =3D to_lcd_olinuxino(panel); int ret; =20 - if (lcd->prepared) - return 0; - ret =3D regulator_enable(lcd->supply); if (ret < 0) return ret; =20 gpiod_set_value_cansleep(lcd->enable_gpio, 1); - lcd->prepared =3D true; - - return 0; -} - -static int lcd_olinuxino_enable(struct drm_panel *panel) -{ - struct lcd_olinuxino *lcd =3D to_lcd_olinuxino(panel); - - if (lcd->enabled) - return 0; - - lcd->enabled =3D true; =20 return 0; } @@ -195,10 +159,8 @@ static int lcd_olinuxino_get_modes(struct drm_panel *p= anel, } =20 static const struct drm_panel_funcs lcd_olinuxino_funcs =3D { - .disable =3D lcd_olinuxino_disable, .unprepare =3D lcd_olinuxino_unprepare, .prepare =3D lcd_olinuxino_prepare, - .enable =3D lcd_olinuxino_enable, .get_modes =3D lcd_olinuxino_get_modes, }; =20 @@ -264,9 +226,6 @@ static int lcd_olinuxino_probe(struct i2c_client *clien= t) lcd->eeprom.num_modes =3D 4; } =20 - lcd->enabled =3D false; - lcd->prepared =3D false; - lcd->supply =3D devm_regulator_get(dev, "power"); if (IS_ERR(lcd->supply)) return PTR_ERR(lcd->supply); --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:17 2024 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0215D57333 for ; Fri, 3 May 2024 21:37:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772235; cv=none; b=MEqppiF72M7t+gwDhQr1gbjEp9sd81LsLQuzjWsXR9m31tFz55pL43DfwoloboWLsblDEtLFYn57/vsJ5mf0cEI+i/nK2Kbq9rckV/PFa8Mtl6C1OMebfq8jSQTP0wzXkzAbaH7Fye3+Xb6Er1WEtRes6z2Dx8nnxiS8bMds9nQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772235; c=relaxed/simple; bh=SkP3AZxms+mqo4x1ENWm/qqAh/eG6ZxVE44b9/q+cLs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NCs+co+55XuaW2RJokzKQylTESzzAVG24cYnTOn8t/329ejaxCPrQrsA1SojHJCpwYvxDsDxS3vTiBHNdCO7XmxTRS8YV5y7FP0WSHmQS3LXvQp1cwrRjknAqkkG5g7lDZ5OmlfHEWhaDfxRZPfV5ioY7H28pI56ociUF1DBfOQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=M3XiLvl/; arc=none smtp.client-ip=209.85.214.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="M3XiLvl/" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-1e3ca546d40so1026125ad.3 for ; Fri, 03 May 2024 14:37:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772233; x=1715377033; darn=vger.kernel.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=tTn5MbULQaeKHbflLx1nU+BRyKgxWcgq1caqQZJZ4uA=; b=M3XiLvl/+M7pTJZd2D/ykj4+Hkr+yyY26vBscOY5gEgEvsX3koNMQ1i7jDoY/y26l4 vSVWXcb2HBfUL6ZFNcSvBCXhcWHq3vf+a9nX8arBkDNL0Po+aZbhwycXkkagAG1hSVdl if3W8VWjaDOkGJt/T/tLKWyWrAIXyvZnhyBmg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772233; x=1715377033; 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=tTn5MbULQaeKHbflLx1nU+BRyKgxWcgq1caqQZJZ4uA=; b=WcNOMrc/KXvkBnXTe0oZC6KpIW3P78c/eMoDObbCt2eOk9eDMZijCx8C3bF4l9iqf7 rqLQE9ORob9L9V+YzxoAs68mPVlhLHbVyYKvKsFNcNPVcWMQL8xwuHxmrJoY9Mxal9KN btLkTy8OcXLUAcNRQ/EPPQQwB5lnVJ96c+Q8IhRJX/YawYJIdSDwkYvgZqEcx5WpRYl1 ipgfAzuBsxJgSrSlaGyxZ1EELtlTg6iiu/JgkeZvhE/TG2xMh7YcJDwwolgub1njRZHq wQlhnRIn3DA2dMVeCEjZnMIrcY6Xqs6L0QSwlgGysjsSSLQ4CKiH5nLuIyM/RajVDKT4 XHlQ== X-Forwarded-Encrypted: i=1; AJvYcCV+W13MiTyQsVX5TO6c0k6HHjCscWd4DGq9FS2v1eVBLDDA3a3XF3w4C6f2+ysR3cepa40GGOWBl48JwjjnWSr9r2dVB995oFHjPR8K X-Gm-Message-State: AOJu0YyWsb69ycboxeiZuLsOH6+QrKDFCm0GYc2hRzYtxfhflOLT1yBN K5oeyp0UvvmEndSM01A/A6QB+yisT8wMGQj9sRVrirkIYAPWIFFhusDevc4emw== X-Google-Smtp-Source: AGHT+IEj6p7S/rBweU0qKixBlNVALPCuJKnvCSE6LujqLm3S0J98P3JUSBEGZTwGCVPY2YIYmiJT9w== X-Received: by 2002:a17:902:da87:b0:1e2:1915:2479 with SMTP id j7-20020a170902da8700b001e219152479mr4889534plx.12.1714772233439; Fri, 03 May 2024 14:37:13 -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.37.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:37:12 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , Stefan Mavrodiev , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 21/48] drm/panel: olimex-lcd-olinuxino: Don't call unprepare+disable at remove Date: Fri, 3 May 2024 14:33:02 -0700 Message-ID: <20240503143327.RFT.v2.21.I4c79deffb7551ecfb0378302f8dee1275fd1c060@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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: Stefan Mavrodiev Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. drivers/gpu/drm/panel/panel-olimex-lcd-olinuxino.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-olimex-lcd-olinuxino.c b/drivers/g= pu/drm/panel/panel-olimex-lcd-olinuxino.c index 8a687d3ba236..94ae8c8270b8 100644 --- a/drivers/gpu/drm/panel/panel-olimex-lcd-olinuxino.c +++ b/drivers/gpu/drm/panel/panel-olimex-lcd-olinuxino.c @@ -251,9 +251,6 @@ static void lcd_olinuxino_remove(struct i2c_client *cli= ent) struct lcd_olinuxino *panel =3D i2c_get_clientdata(client); =20 drm_panel_remove(&panel->panel); - - drm_panel_disable(&panel->panel); - drm_panel_unprepare(&panel->panel); } =20 static const struct of_device_id lcd_olinuxino_of_ids[] =3D { --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:17 2024 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 91976131BA1 for ; Fri, 3 May 2024 21:37:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772237; cv=none; b=t3rOAXSmOskSITrp1gL/P8tUq/4Wuyqlmwrtc9QhY0cY6afzzTZpaNVPdbGs8zZKeqPAT2AA8N1OJRTVUfcJFHz0AjrJhT7/p27TVt2AAACB2UfYesaL8YFoKgA+xjNxqGaeoZ6ovm+9VZ+CWkSZSdOSGirWej9jndhHebcZGDo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772237; c=relaxed/simple; bh=zY8ZWAOIu/t/wLzAduqlZW1TUKjgHOWfN+8MB5eXoLE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ah5hzWHghauwZmr/JLp9O56t+NGy2zFQO8QVQ8+fRPu773pptk6V2ojNu77OpKdMse2CUGwZzGdvb3dN2hCRTZRmWJVYBHHnPAZ0Z/9LqcFZe/e74JOQJkAeCUsR0ySnMC5dwS13F2HIZeVpWrZdWFJpexK4LjPtuGhdhp6l/4o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=dem3nHUg; arc=none smtp.client-ip=209.85.214.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="dem3nHUg" Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1e9ffd3f96eso787155ad.3 for ; Fri, 03 May 2024 14:37:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772236; x=1715377036; darn=vger.kernel.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=9kb398tnZbF7fJMJErZr2qa99FcR7DjSwRYR6pHqFAA=; b=dem3nHUgh+42WjTHkBD+BjWNO8fUEdq3tPZbtbPBq3vy7Jfa4jtaBVh0KkRCz6WUrq 3S3KU1HaIOHKBJEOSr4FZ9Yyv7QT+40+kw7hNCg1Af9Jfj2uNSVSbwNqkI8Xu5oTqwFn vkcd9W8kvgbddHuCSZyUQM+A8Bh7/SNVGP58c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772236; x=1715377036; 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=9kb398tnZbF7fJMJErZr2qa99FcR7DjSwRYR6pHqFAA=; b=ZGBEL94MG1N/PBxPoM/DPhRB4zVJ2wJaTkuPPe0wzqnOVup+oPhpdjwyGlZIou+I5T l5LSRbg2hQoXySryxaynaxRJ/FmjjlKptUM8w6PPqdfL7BZwfZ7x7x0tlrPuhcb+ynGt vqqmTuZpFMw1NcX70fwbDJmHeo2AJDbHhegvD+/uHcZ2EvqHOiOYGAQnCr+7rnHjZmV9 yTdkrinNQMxRcjI9q88aVmUU/O5bF1iAw6GPMp40riS4sesCLDggtupHRAnBPs33f5m6 yiH439Q/WDrqiskH6oKCtk5XPI7/ybn4bzKgERvJvthIXmsu66nuCA5L+qgfeu03l9g2 fZKA== X-Forwarded-Encrypted: i=1; AJvYcCXu3NXJgGPeQ51KAcvagHMdIm1puCtAmgYUbE1IwUfJ028dlX/CkCA3LjxYfzB31h9Z8Yw/wGYWr2yUBiwzEDyWCXJiWFVsPcelq7E0 X-Gm-Message-State: AOJu0Yyl/fK1Nei8kst/A+XYXuMfgCvUwgC9GIITqJSCvQJYRPoN6c5k vQYfCaKTen52PUKVYc5vz/4fye1Xvdd+BeheIMY/0UTPPHppVlLaKv+iZx57nA== X-Google-Smtp-Source: AGHT+IHwYPDlKJY3i9orrstWVpc4QIsGJstcoDV81Owbok8H8JVv/jrLAEu/UHN2wqnlkUP+yYrQEQ== X-Received: by 2002:a17:902:d2c5:b0:1eb:992b:789b with SMTP id n5-20020a170902d2c500b001eb992b789bmr4648219plc.2.1714772235805; Fri, 03 May 2024 14:37:15 -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.37.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:37:14 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , Peter Ujfalusi , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 22/48] drm/panel: osd-osd101t2587-53ts: Stop tracking prepared/enabled Date: Fri, 3 May 2024 14:33:03 -0700 Message-ID: <20240503143327.RFT.v2.22.Ic7f6b4ae48027668940a756090cfc454645d3da4@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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. Cc: Peter Ujfalusi Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. .../drm/panel/panel-osd-osd101t2587-53ts.c | 27 +------------------ 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.c b/drivers/g= pu/drm/panel/panel-osd-osd101t2587-53ts.c index 493e0504f6f7..c0da7d9512e8 100644 --- a/drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.c +++ b/drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.c @@ -21,9 +21,6 @@ struct osd101t2587_panel { =20 struct regulator *supply; =20 - bool prepared; - bool enabled; - const struct drm_display_mode *default_mode; }; =20 @@ -37,13 +34,8 @@ static int osd101t2587_panel_disable(struct drm_panel *p= anel) struct osd101t2587_panel *osd101t2587 =3D ti_osd_panel(panel); int ret; =20 - if (!osd101t2587->enabled) - return 0; - ret =3D mipi_dsi_shutdown_peripheral(osd101t2587->dsi); =20 - osd101t2587->enabled =3D false; - return ret; } =20 @@ -51,11 +43,7 @@ static int osd101t2587_panel_unprepare(struct drm_panel = *panel) { struct osd101t2587_panel *osd101t2587 =3D ti_osd_panel(panel); =20 - if (!osd101t2587->prepared) - return 0; - regulator_disable(osd101t2587->supply); - osd101t2587->prepared =3D false; =20 return 0; } @@ -63,16 +51,8 @@ static int osd101t2587_panel_unprepare(struct drm_panel = *panel) static int osd101t2587_panel_prepare(struct drm_panel *panel) { struct osd101t2587_panel *osd101t2587 =3D ti_osd_panel(panel); - int ret; =20 - if (osd101t2587->prepared) - return 0; - - ret =3D regulator_enable(osd101t2587->supply); - if (!ret) - osd101t2587->prepared =3D true; - - return ret; + return regulator_enable(osd101t2587->supply); } =20 static int osd101t2587_panel_enable(struct drm_panel *panel) @@ -80,15 +60,10 @@ static int osd101t2587_panel_enable(struct drm_panel *p= anel) struct osd101t2587_panel *osd101t2587 =3D ti_osd_panel(panel); int ret; =20 - if (osd101t2587->enabled) - return 0; - ret =3D mipi_dsi_turn_on_peripheral(osd101t2587->dsi); if (ret) return ret; =20 - osd101t2587->enabled =3D true; - return ret; } =20 --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:17 2024 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0B34E131E2E for ; Fri, 3 May 2024 21:37:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772240; cv=none; b=hbhIQmZfWJ8jV9AaJBWKtW/QCDxLJAqU/++bkGjmX74AvegFmIE9aFul4Nv05ME+5OMXDxfnyFO+BGRQXa/i0IfyID4cYQEWzIfKovDZFFFdLVbxcMYNB2veDygim1EHhD7e27VrUDJwONCqLgtVsOPHy+g/+2axNZFTXnkNgNk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772240; c=relaxed/simple; bh=GrL0PMxUJn2slEGcQnWTrRQLBVOUBqd7SqM84iVHzxk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qn/Eyw86+Gdy1KGgTAa+n23ZFg2UNwav4UwFglFhU2rTXxdl4M6CXg+7mERO6MfbRyyz1YttSUgDt00RFbAEb9avcDObPgqs67MN5bohJVoGvWjVzk6284L2zhX7JHfbJS9LxMLKveiVfwFX2oDJxlwxNbt3kng0wh4oLHpOdWU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=mpS3iNhL; arc=none smtp.client-ip=209.85.214.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="mpS3iNhL" Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1e834159f40so687015ad.2 for ; Fri, 03 May 2024 14:37:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772238; x=1715377038; darn=vger.kernel.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=YjHl+DB7wvFQ0erRTiSGp5Vkb60hgkc17VF3W8JYnEQ=; b=mpS3iNhLmQQjTSAr7syrIrGVgxA57QiefiW8s8Cpc4KMVjU78lEoaRbJ8R7AouGUw6 21rhprAfoJ8CbEQspF6psjAMGK3vGNMNY2Osxp8giyYagWCUWxgCB4kyLR7zeNpYgLa7 Hy+OTqN9CDYC8mH5lhsQyvO4ARsQZ24p3gkz4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772238; x=1715377038; 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=YjHl+DB7wvFQ0erRTiSGp5Vkb60hgkc17VF3W8JYnEQ=; b=FEkKD4d+a7bY3K3gskOT/ysNW3TFVufVlYQRv1F7VoBCmC4dYkiUgUSWu18lMPGvIb he3htlYzX6ONaOkZ/e+jMMe/tqOH+VdvakijQqlAw6dM03hlltPiSPFOFr8soscHcBxY R4IB31KPYXgkDUUIEI048KOEum3lXhmi/iZoP3TAkkYG/aSd8q5k7qy1F5qHpCG9yZqy PL52vvFUZ2E/xKBzDB3oK+1d5RL9TTD5KqaLYzhCt3fqMvNqdi2dNuIFwCTvTQDGsf4x ErStfZaxn6qaDrzTi079q7DitRTCIdVhdmhm4SuFne8YAAdJzfasGVrCYn5QThi/v6hR kO6A== X-Forwarded-Encrypted: i=1; AJvYcCUM0cl4rmEU65C541TE8fxHpjXqbkuY15UyKEMns9fLSBGxBnpYYzay9HDgEdfHLty+slt081ofFfXgYF1CvE+WYPDHHEySBpCnFOqq X-Gm-Message-State: AOJu0YwBahbL9VT298Cmam/lL5VShgKXevaix2jYH16+5DcE7EicM1nU gFotpOw9JoYXGGf71gQ0+quaKEe1XtIZrvggkUVGXFXx29YBIjFqB5hQMZZNjw== X-Google-Smtp-Source: AGHT+IHGkmJTrA+QEdoj0aZR/Y9uwm9CMi5KsoludQGf1jksEPkLR67IdZOHw27LEYo4LBKbqkaXGw== X-Received: by 2002:a17:902:e807:b0:1e5:556:60e2 with SMTP id u7-20020a170902e80700b001e5055660e2mr4570462plg.5.1714772238405; Fri, 03 May 2024 14:37:18 -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.37.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:37:17 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , Peter Ujfalusi , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 23/48] drm/panel: osd-osd101t2587-53ts: Don't call unprepare+disable at shutdown/remove Date: Fri, 3 May 2024 14:33:04 -0700 Message-ID: <20240503143327.RFT.v2.23.Ic533ce1323b94230d4155f9364c2b7c1bc47e798@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 TI OMAP boards. The OMAP driver appears 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: Peter Ujfalusi Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.c b/drivers/g= pu/drm/panel/panel-osd-osd101t2587-53ts.c index c0da7d9512e8..dbea84f51514 100644 --- a/drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.c +++ b/drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.c @@ -186,11 +186,6 @@ static void osd101t2587_panel_remove(struct mipi_dsi_d= evice *dsi) struct osd101t2587_panel *osd101t2587 =3D mipi_dsi_get_drvdata(dsi); int ret; =20 - ret =3D drm_panel_disable(&osd101t2587->base); - if (ret < 0) - dev_warn(&dsi->dev, "failed to disable panel: %d\n", ret); - - drm_panel_unprepare(&osd101t2587->base); drm_panel_remove(&osd101t2587->base); =20 ret =3D mipi_dsi_detach(dsi); @@ -198,14 +193,6 @@ static void osd101t2587_panel_remove(struct mipi_dsi_d= evice *dsi) dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", ret); } =20 -static void osd101t2587_panel_shutdown(struct mipi_dsi_device *dsi) -{ - struct osd101t2587_panel *osd101t2587 =3D mipi_dsi_get_drvdata(dsi); - - drm_panel_disable(&osd101t2587->base); - drm_panel_unprepare(&osd101t2587->base); -} - static struct mipi_dsi_driver osd101t2587_panel_driver =3D { .driver =3D { .name =3D "panel-osd-osd101t2587-53ts", @@ -213,7 +200,6 @@ static struct mipi_dsi_driver osd101t2587_panel_driver = =3D { }, .probe =3D osd101t2587_panel_probe, .remove =3D osd101t2587_panel_remove, - .shutdown =3D osd101t2587_panel_shutdown, }; module_mipi_dsi_driver(osd101t2587_panel_driver); =20 --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:17 2024 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6E84113248D for ; Fri, 3 May 2024 21:37:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772242; cv=none; b=tmuOlfw9cyidA1IcBzoX3qlWdvNDDjtGiRk+hnEqXchPp2K7CM9zohiCrGg/urZwG2ZGKYhSVZSP9dhWZQ3Shk/6e/ME87klCVp0LJeZfLSMvT4swAIRXw4AMT2arO/T5aerqIignhVFNIxRo3zFwlw1tka8N2vcTWr30UfKXBA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772242; c=relaxed/simple; bh=GX4HIAvO+VZX4N8pwlhT++o+kYYGJe0qQHHVtQMYJ/4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BwXybGJ4HnLfzT5AjQiQQaxu0h8mW6uAOK7mgzXZaVN8XTJ62ff8cb/12uKsZ0+m0WYSvBcI9jgr+IyZ/zQdHNupMvaixIKQzUQLp5gSVVGTICLjdIl5a63QXFrEHQ0r2GZyCyaFBh7cIgxMvjCXoxF/1JUem9DOhzh92xxCrWY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=WwpHQ++f; arc=none smtp.client-ip=209.85.214.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="WwpHQ++f" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-1e5c7d087e1so1048565ad.0 for ; Fri, 03 May 2024 14:37:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772241; x=1715377041; darn=vger.kernel.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=T4ZnBWaIKiuSZ6rYgD6PXXRcgsfalihno55gNzam3kQ=; b=WwpHQ++fSV1kqSAHqQ/5r6IqAwsvkk0Vep+T0JlwzDhVbDgeP9V/m2bmnpoK+kn48E fHesmArLB/2nrg/YRJ0JkDx91F1KwnrxPiILhel1QxZUVbLmbEJEa5XLahcC2kxLnsAT uGSXo6y6dtEHuznIK8F9Gnpog+/BnoKjABkKQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772241; x=1715377041; 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=T4ZnBWaIKiuSZ6rYgD6PXXRcgsfalihno55gNzam3kQ=; b=rU68hPGk+3TCDHWklTuZB5diZ2RQlPjjBgts4lAEF6Dm04ZZw1xUKRObPPNEfcVifz LfmT+lUgPSv9ln3VPX/m5b5WqnCEPolNg1XmxeEq2b6l0e3sWqIlbSoEfhleczDWoVta q3Yeo83oSfNZeCavnu/QcTs8Mv0UlXOGCAdr/SbOH5DgQhodS/AtR5N3AjWFApTboca8 zCjYWcIe0PnUyEcIQPKhP3lBIe5j5u+y11WKBPhzguDIUYuPIJzoZfHu1/sIVkI5ac8D L8yaF0Q/G5TriXQstspckBOURTFEbtyF15PnDp/9rwl/YHRyB3Vl3rgIZLMQFalI6kKd hATA== X-Forwarded-Encrypted: i=1; AJvYcCVLmvZTYpPQdrD9lJcgGvevjprK+m1KpVQqGxCewKUKPvbhSHQTgm447qpi8LOlDptzgwTez5cET8O5c9ExsrfuuklE2Bsaxs+fKQ5c X-Gm-Message-State: AOJu0YxwfUe0dmKlmL647Ua44IaeBnW2pEff/UkdI3ImmJ0ytGXdZoqc P1ugu4K4Xd6ehajgFZ3IuHGFpxzk7CpuOGwaHjogX+SL8qFjr1CXIRwsxLdwZA== X-Google-Smtp-Source: AGHT+IFBu/Hjhl9CXDDNgZhms0TZtEM8WWT7JEQNvy6BxJ5HNCgPTDI2jWO6fbS+Td4nj2A1qpFYHw== X-Received: by 2002:a17:902:6503:b0:1e0:a3dd:82df with SMTP id b3-20020a170902650300b001e0a3dd82dfmr4006853plk.38.1714772240760; Fri, 03 May 2024 14:37:20 -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.37.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:37:19 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 24/48] drm/panel: samsung-atna33xc20: Stop tracking prepared/enabled Date: Fri, 3 May 2024 14:33:05 -0700 Message-ID: <20240503143327.RFT.v2.24.Ibb4f923363a27167c480a432e52884b117221974@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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. Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. .../gpu/drm/panel/panel-samsung-atna33xc20.c | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-samsung-atna33xc20.c b/drivers/gpu= /drm/panel/panel-samsung-atna33xc20.c index a9f0d214a900..a322dd0a532f 100644 --- a/drivers/gpu/drm/panel/panel-samsung-atna33xc20.c +++ b/drivers/gpu/drm/panel/panel-samsung-atna33xc20.c @@ -25,8 +25,6 @@ =20 struct atana33xc20_panel { struct drm_panel base; - bool prepared; - bool enabled; bool el3_was_on; =20 bool no_hpd; @@ -143,13 +141,8 @@ static int atana33xc20_disable(struct drm_panel *panel) { struct atana33xc20_panel *p =3D to_atana33xc20(panel); =20 - /* Disabling when already disabled is a no-op */ - if (!p->enabled) - return 0; - gpiod_set_value_cansleep(p->el_on3_gpio, 0); p->el_on3_off_time =3D ktime_get_boottime(); - p->enabled =3D false; =20 /* * Keep track of the fact that EL_ON3 was on but we haven't power @@ -173,10 +166,6 @@ static int atana33xc20_enable(struct drm_panel *panel) { struct atana33xc20_panel *p =3D to_atana33xc20(panel); =20 - /* Enabling when already enabled is a no-op */ - if (p->enabled) - return 0; - /* * Once EL_ON3 drops we absolutely need a power cycle before the next * enable or the backlight will never come on again. The code ensures @@ -195,20 +184,14 @@ static int atana33xc20_enable(struct drm_panel *panel) atana33xc20_wait(p->powered_on_time, 400); =20 gpiod_set_value_cansleep(p->el_on3_gpio, 1); - p->enabled =3D true; =20 return 0; } =20 static int atana33xc20_unprepare(struct drm_panel *panel) { - struct atana33xc20_panel *p =3D to_atana33xc20(panel); int ret; =20 - /* Unpreparing when already unprepared is a no-op */ - if (!p->prepared) - return 0; - /* * Purposely do a put_sync, don't use autosuspend. The panel's tcon * seems to sometimes crash when you stop giving it data and this is @@ -220,26 +203,19 @@ static int atana33xc20_unprepare(struct drm_panel *pa= nel) ret =3D pm_runtime_put_sync_suspend(panel->dev); if (ret < 0) return ret; - p->prepared =3D false; =20 return 0; } =20 static int atana33xc20_prepare(struct drm_panel *panel) { - struct atana33xc20_panel *p =3D to_atana33xc20(panel); int ret; =20 - /* Preparing when already prepared is a no-op */ - if (p->prepared) - return 0; - ret =3D pm_runtime_get_sync(panel->dev); if (ret < 0) { pm_runtime_put_autosuspend(panel->dev); return ret; } - p->prepared =3D true; =20 return 0; } --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:17 2024 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5886558AA5 for ; Fri, 3 May 2024 21:37:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772244; cv=none; b=CrLavkx8iQEP37iCR+wxq03JHtBj7kFyRhqisdcIaOkgOrpt52gPL4KAS8YgByq1T8OKk2wNJGMqG+dqE6Fig43+CIv8KqJXzdsEjGfrvKaQhlAijkq84RA3aPHOWr8ReY7J7XiSZQzA8OONQN7df4hB4ZgF6AB9GTJVMAw5aJY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772244; c=relaxed/simple; bh=MwnlaM489yP+C9bmKLyltsY0MI3Q8BhgFJLPRXwGLlw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TKO3ENFPijMf25aXLcfU70VdPOn51pABDnQLM2+LvKgYm085YK/Ckud7u6UFoauNwMOSXO/OOK/FPqgCHma1E7mB1rUBnW5aYZ+h2jwHV6CB6RVfPCW323p/MvBPZ0vA5FLWYk0itA4CVkVOlHjakfTGZhSeGnDcJEhpyGFDqAo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=bbrXolp/; arc=none smtp.client-ip=209.85.214.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="bbrXolp/" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-1e86d56b3bcso1254135ad.1 for ; Fri, 03 May 2024 14:37:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772242; x=1715377042; darn=vger.kernel.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=HRQb/I07011T3t9lbY5bJjPOFJ2fx1sx6agjLTdJWzE=; b=bbrXolp/yxIrUNsBCWm4I6Wg6xzuPZg1N3aPSA+0xuCb5QK+ZVgNuWuAKivH6u+ran 9kpxJ2VU+Qws15JWtK5eAM7zUvFMKQJSYTBMSBT17bcXcLTPRkW19ZWBAaE1PGivA+qq gKlLVlOWyOIYukJIt9eHUNMAeE/vG3OEnkG/k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772242; x=1715377042; 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=HRQb/I07011T3t9lbY5bJjPOFJ2fx1sx6agjLTdJWzE=; b=nDrlx2fMwERzgU9tWz+GFI0Hrxq1hSgIeq3wOLLYIlGweD261nSB5mJvofKwY2e+Tb xpQc0+Pw/Zx5kiF0nD9HFR2PNjBipEKpuLj+MXiGD+37JNGyvwpLeL1wd1A5T7mzuyGV KW8bYJjOiGYbA4F0nwGkdQ5lp7M+j/+9GcTus1zOE0pjmvlepBHWlPBM4iH3kreu6FPN SibJdECPTHIJaS7GQpt1x9mP/ezhg/t2SLSHbtpPTUK+5yT5uvAJ5qAyPp8xYhTtTEXu 7VwGBVKrdS69lo4eH/Op3Qt9C0U1vQyLSN0VxighjYCl9c4HNX264jvvQElwKsCSxKR6 jORw== X-Forwarded-Encrypted: i=1; AJvYcCUkH6ZJ9Y5lazdufe+hbS9Z963LlwK4LXGdhXavfW2beHRSRMpM8gRaW4exdxQBtTEm0AbHkiFOnCkgLLJIlc1Qd6ymQNcISDb80FXf X-Gm-Message-State: AOJu0YzZMF1H2+jlHCTu+g3wutmT9SAn9iS0ivSaF5N+oLpAdBLzujmD 8qIBkX9OmEBar+j9FAZLx6nCnEFzudAztAarbNNQVh4AGAFusXnzlCjsGt7gHw== X-Google-Smtp-Source: AGHT+IF6CDvqfSrYxn7iKNnjnE2VAXasLzRdp4BnWV2DoDu3VKywSCP3Ny+zWphkbKiYpV8TR9pS2g== X-Received: by 2002:a17:902:cec7:b0:1e2:817b:460a with SMTP id d7-20020a170902cec700b001e2817b460amr4432991plg.34.1714772242613; Fri, 03 May 2024 14:37:22 -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.37.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:37:21 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 25/48] drm/panel: samsung-atna33xc20: Don't call unprepare+disable at shutdown/remove Date: Fri, 3 May 2024 14:33:06 -0700 Message-ID: <20240503143327.RFT.v2.25.Iaeacccf98e6cb729b8fc3a782725769cd66812ad@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Qualcomm boards. The Qualcomm driver appears 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 Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. drivers/gpu/drm/panel/panel-samsung-atna33xc20.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-samsung-atna33xc20.c b/drivers/gpu= /drm/panel/panel-samsung-atna33xc20.c index a322dd0a532f..9a482a744b8c 100644 --- a/drivers/gpu/drm/panel/panel-samsung-atna33xc20.c +++ b/drivers/gpu/drm/panel/panel-samsung-atna33xc20.c @@ -327,21 +327,10 @@ static void atana33xc20_remove(struct dp_aux_ep_devic= e *aux_ep) struct atana33xc20_panel *panel =3D dev_get_drvdata(dev); =20 drm_panel_remove(&panel->base); - drm_panel_disable(&panel->base); - drm_panel_unprepare(&panel->base); =20 drm_edid_free(panel->drm_edid); } =20 -static void atana33xc20_shutdown(struct dp_aux_ep_device *aux_ep) -{ - struct device *dev =3D &aux_ep->dev; - struct atana33xc20_panel *panel =3D dev_get_drvdata(dev); - - drm_panel_disable(&panel->base); - drm_panel_unprepare(&panel->base); -} - static const struct of_device_id atana33xc20_dt_match[] =3D { { .compatible =3D "samsung,atna33xc20", }, { /* sentinal */ } @@ -362,7 +351,6 @@ static struct dp_aux_ep_driver atana33xc20_driver =3D { }, .probe =3D atana33xc20_probe, .remove =3D atana33xc20_remove, - .shutdown =3D atana33xc20_shutdown, }; =20 static int __init atana33xc20_init(void) --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:17 2024 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 40B37132C1B for ; Fri, 3 May 2024 21:37:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772247; cv=none; b=Usjc8JLTTO5TL8U1mjh1z5XzqyffN9lSXJ+wa5ySMs+0ZViC4g/QTG+BiXE0Z+ZtYwcNxHt1fc4WDoZlCj97WmVZv5hTi830Lz+DQ+V09rSxOZqsyoQFkjdhpIb/FAoaU7ZD42VzREf+ZM4EhFJiHB8P9a1PeBriu3dOr0UM2I0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772247; c=relaxed/simple; bh=05gtrOeEcREq4hvpJoIjfeQYqWEadvX+bGZawKnk+qI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BGEfbmlilgZJPdijVwr359qmMMYDHjPQbe7k8etX6Ef9SSP0h4rjIaBMu2K7auZUbSuRAwmxnEApGjuBugHzhCN3U/L+Ycro5fH+MzfHNyNt0tkiF3iNegFnt4Ji8ZskF8D/vy7eWDekQd1zsJzE6TxpcbeMCZ1/SbUNydiCr14= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=W8TirT8k; arc=none smtp.client-ip=209.85.214.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="W8TirT8k" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-1eab16c8d83so859245ad.3 for ; Fri, 03 May 2024 14:37:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772246; x=1715377046; darn=vger.kernel.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=M2B/kTWdyUau2alXgEoUxYv1c4k3su/yovwNR5wduBo=; b=W8TirT8kTmbRwEVOcn5doiFArZL3pXEnpSmXjOWgYJ+j01hdcV0av1VE0SyUVybUaB oSi8SLzyPTKEXcUnlImExNBvkBjeS8mjyNisB1qM9SuJ0YAt9e4Vwx1CVC3HiRvBV31W Tf4smy1Bz0Mox1BU2cg9w3RIiM7ph95dNbZkI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772246; x=1715377046; 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=M2B/kTWdyUau2alXgEoUxYv1c4k3su/yovwNR5wduBo=; b=NJ/tI8zilEYX2yaHqwDCKyZrdeosw1qjfDRR1O83FlPsO+r2G5aspJ0ZkIVPOMj5RZ gMgTR7kRJ5CIL39b0wzkfMxRVI/bc7w7oKMvUdkd12mmXdEzxcIJIZUcGJXTlUiC1CoP ND/OgRO8bR+/OOxsCchi94Fcn4kRgmXxT4XNS6f+/Xmy7WecfplDA9af18VNmurcrTEn WJfeVrAX4QJLoV5D1lx3dykNQJ1yXUIO4gMvRU+II7cSM6RlJunfZalKMxUQjQkmVUdV uvT6iqwi/cv1bqeEiw1DeRm0c3SDoYVhIXW30hXajoutiaHmRy2bvltf0I7J626/Y1Tc ACug== X-Forwarded-Encrypted: i=1; AJvYcCUbpuSP3qhoiYtsAq/tDIZYi/Lfdh/nWMBXE+nGWicFNTMDFRvK+GrQVmt3HC3TLx+WHi2hEtV966d+VEPd0pNfWoN/8c3Br4OB4Rlr X-Gm-Message-State: AOJu0YwkwHC0skkJxD3z7N5nUGfPQQ1sGtqqq8Wq86PZDnGZRCsHoYoy +CumYXN8YdLYwZt5ZIYsQRcpsg7GgC7VLQLVxE518vhNSIf8OwgeB0eFB27VVg== X-Google-Smtp-Source: AGHT+IHeLoFfHMC/OUeeJoDhqoJSJfOwPhDJNHriFCGoke4s3Yn0fXRdNzl+m82UbjoOonNJKwQK5Q== X-Received: by 2002:a17:902:d386:b0:1eb:519e:e05f with SMTP id e6-20020a170902d38600b001eb519ee05fmr3748669pld.45.1714772245858; Fri, 03 May 2024 14:37:25 -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.37.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:37:24 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 26/48] drm/panel: simple: Stop tracking prepared/enabled Date: Fri, 3 May 2024 14:33:07 -0700 Message-ID: <20240503143327.RFT.v2.26.I865be97dd393d6ae3c3a3cd1358c95fdbca0fe83@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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. Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard Acked-by: Sui Jingfeng --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. drivers/gpu/drm/panel/panel-simple.c | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/p= anel-simple.c index dcb6d0b6ced0..42d902d2bbbe 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -138,9 +138,6 @@ struct panel_desc { =20 struct panel_simple { struct drm_panel base; - bool enabled; - - bool prepared; =20 ktime_t unprepared_time; =20 @@ -290,14 +287,9 @@ static int panel_simple_disable(struct drm_panel *pane= l) { struct panel_simple *p =3D to_panel_simple(panel); =20 - if (!p->enabled) - return 0; - if (p->desc->delay.disable) msleep(p->desc->delay.disable); =20 - p->enabled =3D false; - return 0; } =20 @@ -317,18 +309,12 @@ static int panel_simple_suspend(struct device *dev) =20 static int panel_simple_unprepare(struct drm_panel *panel) { - struct panel_simple *p =3D to_panel_simple(panel); int ret; =20 - /* Unpreparing when already unprepared is a no-op */ - if (!p->prepared) - return 0; - pm_runtime_mark_last_busy(panel->dev); ret =3D pm_runtime_put_autosuspend(panel->dev); if (ret < 0) return ret; - p->prepared =3D false; =20 return 0; } @@ -356,21 +342,14 @@ static int panel_simple_resume(struct device *dev) =20 static int panel_simple_prepare(struct drm_panel *panel) { - struct panel_simple *p =3D to_panel_simple(panel); int ret; =20 - /* Preparing when already prepared is a no-op */ - if (p->prepared) - return 0; - ret =3D pm_runtime_get_sync(panel->dev); if (ret < 0) { pm_runtime_put_autosuspend(panel->dev); return ret; } =20 - p->prepared =3D true; - return 0; } =20 @@ -378,14 +357,9 @@ static int panel_simple_enable(struct drm_panel *panel) { struct panel_simple *p =3D to_panel_simple(panel); =20 - if (p->enabled) - return 0; - if (p->desc->delay.enable) msleep(p->desc->delay.enable); =20 - p->enabled =3D true; - return 0; } =20 @@ -609,7 +583,6 @@ static int panel_simple_probe(struct device *dev, const= struct panel_desc *desc) if (!panel) return -ENOMEM; =20 - panel->enabled =3D false; panel->desc =3D desc; =20 panel->supply =3D devm_regulator_get(dev, "power"); --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:17 2024 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC7461332A0 for ; Fri, 3 May 2024 21:37:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772250; cv=none; b=qmGjq6DQixf5iffgJVXjQGrKnISo6a9fvmN8rUFHcl+IX2iNLmYggRuaTUkzKXIkbjUugkWE4tZCihBZ14Njg4OEqAYM2J2RaVuq+ktlsgEyYqmTAnV3f4+w01qKGPJwAix9kBM/3D3ndYB+56OgSwV/UBwSBGjQUozg9gYQXfQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772250; c=relaxed/simple; bh=Z07k6LmvrCqJVYhqJqW7ZsjRIaRSeJkSq0Its1w6ixE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=o2THu8exQIAUofC0abhf95jnVK1bTJexC/OFoD6y4U1GKFrelEL2yUrVkBU8OnOmoEN7XowdmkNl7oQWV930A3hxhWFsZbbAvnLVn22PGJ3xmLMOd7PEdKL7l7IvvDE9MDkuUxaH1UJamR4zF7Ox0YUhbL0pJInn8H7QHmU28Xo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=YsZETJWm; arc=none smtp.client-ip=209.85.214.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="YsZETJWm" Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-1ec69e3dbe5so1226655ad.0 for ; Fri, 03 May 2024 14:37:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772248; x=1715377048; darn=vger.kernel.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=Vm5pMW+JcxQoAhIpk954JqF6buuPfxcd3q3C5XmFPm8=; b=YsZETJWmABhnVgXi/GijDgbwFXw4t7xU4i1Ib8zciuOx40Wdxeglc0dISitIZHOr0k O8iCn5dpqx4NLlZ7rb5J0imkHGCZ0iCArMKbLPFRPPXETZMchqLHIqfK9BVI3DrsFvaN IL45myX+XQZD2kQIoG5YFr/edl/oAozJ8aW4k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772248; x=1715377048; 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=Vm5pMW+JcxQoAhIpk954JqF6buuPfxcd3q3C5XmFPm8=; b=CiUZJ6XfZkb4EnOjqg1/904ZMUkDu1Yl9poi/NOMNn1fx8lKIosbfjVqRHFuP6vV3Y TK5uXmKqJ+c60AUzrGijTBnqglVSNVPhrJedeJXN7Mr4TUNeBkiw1gxDHzR+5HlhmoYA PfYeDAsq/C76J03xrPZ7n7sZiw9u9y580SW3kbcZtC7KWg6fcmdHrmLWkkdUQVWlvx2C 1lZervBuJtenQZW4NgRRRPm6QgCrByxUv+OPlgbS9eoKEC+/KNtzuuO353kUS3wqwTdH TSgRf4ITMH5/8E7jgw/Bo40UAjWDYfuG8MMrRpB3zETSmF+/qhItwPANr8Na0cCbxnA8 ACKQ== X-Forwarded-Encrypted: i=1; AJvYcCXUhRh+zG5azmNRf1X9GjVYChu/SSFJzRsFPi58uG2F9sDFPpBJMH1cY6Ykng+JZrLQrN4uM43PJq9UPX5yJBeIYPhr24E/fZphiADw X-Gm-Message-State: AOJu0YxsSjVbN9zu0yyw6E+QVGgYofjDbM31BBgSny+wbwkLAPtFEPxs n257td9vA26FQ8KFu7aYpBJziSm2MHWGR1AcfN8T53rj6cINdrgaLQRdNgmS1ww27HVjhneFB6+ fqQ== X-Google-Smtp-Source: AGHT+IFYxFgWOwV/QXfwpPyO6iPfA33qW7XGRgN/4aov9d0tBWLiBcNJ5IccHks/fAhE+4fNaDTPow== X-Received: by 2002:a17:902:e54d:b0:1e6:7731:80 with SMTP id n13-20020a170902e54d00b001e677310080mr5258220plf.11.1714772248114; Fri, 03 May 2024 14:37:28 -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.37.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:37: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 , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 27/48] drm/panel: simple: Add a comment about unprepare+disable at shutdown/remove Date: Fri, 3 May 2024 14:33:08 -0700 Message-ID: <20240503143327.RFT.v2.27.I639183ac987e139092491a94e22d46a5d857580c@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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, it's very difficult to know exactly which DRM modeset drivers are using panel-simple due to the sheer number of panels it handles. For now, we'll leave the calls and just add a comment to keep people from copying this code. [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 Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. - panel-edp and panel-simple just get a comment now. drivers/gpu/drm/panel/panel-simple.c | 33 +++++++++++++++++++--------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/p= anel-simple.c index 42d902d2bbbe..f39122ffdead 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -716,26 +716,39 @@ static int panel_simple_probe(struct device *dev, con= st struct panel_desc *desc) return err; } =20 -static void panel_simple_remove(struct device *dev) +static void panel_simple_shutdown(struct device *dev) { struct panel_simple *panel =3D dev_get_drvdata(dev); =20 - drm_panel_remove(&panel->base); + /* + * NOTE: the following two calls don't really belong here. It is the + * responsibility of a correctly written DRM modeset driver to call + * drm_atomic_helper_shutdown() at shutdown time and that should + * cause the panel to be disabled / unprepared if needed. For now, + * however, we'll keep these calls due to the sheer number of + * different DRM modeset drivers used with panel-simple. The fact that + * we're calling these and _also_ the drm_atomic_helper_shutdown() + * will try to disable/unprepare means that we can get a warning about + * trying to disable/unprepare an already disabled/unprepared panel, + * but that's something we'll have to live with until we've confirmed + * that all DRM modeset drivers are properly calling + * drm_atomic_helper_shutdown(). + */ drm_panel_disable(&panel->base); drm_panel_unprepare(&panel->base); - - pm_runtime_dont_use_autosuspend(dev); - pm_runtime_disable(dev); - if (panel->ddc) - put_device(&panel->ddc->dev); } =20 -static void panel_simple_shutdown(struct device *dev) +static void panel_simple_remove(struct device *dev) { struct panel_simple *panel =3D dev_get_drvdata(dev); =20 - drm_panel_disable(&panel->base); - drm_panel_unprepare(&panel->base); + drm_panel_remove(&panel->base); + panel_simple_shutdown(dev); + + pm_runtime_dont_use_autosuspend(dev); + pm_runtime_disable(dev); + if (panel->ddc) + put_device(&panel->ddc->dev); } =20 static const struct drm_display_mode ampire_am_1280800n3tzqw_t00h_mode =3D= { --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:17 2024 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 99D2813340A for ; Fri, 3 May 2024 21:37:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772253; cv=none; b=fZtkPZzcK8c5OX7Lw8f0sIMlsIxpjAUzPaZYGbFygVYnl53lhv5EfXgPxv8tGaZmz9CdWR8oIa4yMPvHhw7KxUhHz3crl2nVrdxBQKUyxgrxEh0ykgRjPrkQQpsavBsgd7QriWdp7oaLGxSxNbGYlQD8XrwKHAPPOhpbn044KmY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772253; c=relaxed/simple; bh=6fe49YSjC4fc9GTEHnSGsu0MOQDQF/+C3YTKVOAm1sI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fVU6G13vYnR8a6J8EKLeQUYqdxL8iTxUFFnhNP0IJgXVN9D06OJEtKccMLkXrk0dY6pv+YOdddgXvxj31weGWWz3sDnFj8MjJDdEhJ/ZPBh1tdfiijZt1TWRNxBc/RUOfFqOrIlvo8DAlrd/M7/dGT45FtrbG6QAacP380QeCb8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=do4ZuScf; arc=none smtp.client-ip=209.85.214.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="do4ZuScf" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-1ec486198b6so946505ad.1 for ; Fri, 03 May 2024 14:37:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772251; x=1715377051; darn=vger.kernel.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=Qk2LC4K5RJqsx2QB9+nJgz+tBqijGejd/DYbrsWwU0M=; b=do4ZuScfLSh6LbMmS8dwFNsxsklId2q2gmRNI3TCZLVkwdTguVZf1ju/TZW4LTLj5K dgEzzXkc33yPV7FgQABmal6NvXzE3UgJvUMcOMhoiYFBm6okg8erjG2A3J1t8uJXsbv1 NDSJbQ8nucIbUr3L/Td+5sSG+u0rFy+J+lT/o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772251; x=1715377051; 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=Qk2LC4K5RJqsx2QB9+nJgz+tBqijGejd/DYbrsWwU0M=; b=LpOn/RV0TA3Y7M+jrzouOo88Wi+9RTFJe6VbL7hh+zRIiIJhcdqIHZO7LKwte4GmCI WXyGTKoXh7vC7Us5DX5CgWBKPFa7dh2tJkuE8UCoYOZUQeKy73a9I+1IMvGG7A1BpGlr UStqV04XG8svmtC2IFegSKV52LiDSnZO/xzOqZ3dFah8AHDPI0V6kqAfjEpp+Agi+0At DzPklN04VLUq80UGJxxxDDZDCeXgxs5fGECa6AoOpRvmdzSnHJkMWXKj2hkzHn8KS7OW HdSjxwQT0OBpRr8PYiUReUHi+6wS54Z2yE1mg/xrk+oP34QkpZPG8K+cOFfMSRGChfYT SA6w== X-Forwarded-Encrypted: i=1; AJvYcCVLIV6Sz6cFvLel4ZEe+1Xn9evWQVgTTqyupUujwJkrGI9/0l8H1tDOaFenWOKVdEPRmrywaNHEUY+jjIYY1h7YPYAKj8BgYcjEXZnA X-Gm-Message-State: AOJu0YxnGBqZ8V3pA0a/zBJHtgToBXX7EaemOtcQlfgSf+Y5huhl0gKN AKD24LyF27MUY5vJD9KLNXI55s798q8YuUYbJlotDcSITrsbDy71QFJbWLbyEA== X-Google-Smtp-Source: AGHT+IF25tSPTopP9g7n30MtXJROijO2HKPmfXJa+9xCs2KvJx4G7kvTTz0Y7toa0BkNX3wlMPNHNw== X-Received: by 2002:a17:902:f685:b0:1eb:309a:ebdc with SMTP id l5-20020a170902f68500b001eb309aebdcmr5394677plg.30.1714772250902; Fri, 03 May 2024 14:37: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.37.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:37: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 , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 28/48] drm/panel: tdo-tl070wsh30: Stop tracking prepared Date: Fri, 3 May 2024 14:33:09 -0700 Message-ID: <20240503143327.RFT.v2.28.I5025ab14adc2efeef1be1843648547fb725106be@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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. Cc: Neil Armstrong Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c b/drivers/gpu/drm= /panel/panel-tdo-tl070wsh30.c index d8487bc6d611..36f27c664b69 100644 --- a/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c +++ b/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c @@ -24,8 +24,6 @@ struct tdo_tl070wsh30_panel { =20 struct regulator *supply; struct gpio_desc *reset_gpio; - - bool prepared; }; =20 static inline @@ -39,9 +37,6 @@ static int tdo_tl070wsh30_panel_prepare(struct drm_panel = *panel) struct tdo_tl070wsh30_panel *tdo_tl070wsh30 =3D to_tdo_tl070wsh30_panel(p= anel); int err; =20 - if (tdo_tl070wsh30->prepared) - return 0; - err =3D regulator_enable(tdo_tl070wsh30->supply); if (err < 0) return err; @@ -74,8 +69,6 @@ static int tdo_tl070wsh30_panel_prepare(struct drm_panel = *panel) =20 msleep(20); =20 - tdo_tl070wsh30->prepared =3D true; - return 0; } =20 @@ -84,9 +77,6 @@ static int tdo_tl070wsh30_panel_unprepare(struct drm_pane= l *panel) struct tdo_tl070wsh30_panel *tdo_tl070wsh30 =3D to_tdo_tl070wsh30_panel(p= anel); int err; =20 - if (!tdo_tl070wsh30->prepared) - return 0; - err =3D mipi_dsi_dcs_set_display_off(tdo_tl070wsh30->link); if (err < 0) dev_err(panel->dev, "failed to set display off: %d\n", err); @@ -103,8 +93,6 @@ static int tdo_tl070wsh30_panel_unprepare(struct drm_pan= el *panel) =20 regulator_disable(tdo_tl070wsh30->supply); =20 - tdo_tl070wsh30->prepared =3D false; - return 0; } =20 --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:17 2024 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3B86D1332BD for ; Fri, 3 May 2024 21:37:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772255; cv=none; b=o54tkPMAHwySmP8wNe2B6dl5Jk/ewi2iqmY5Sn0RZqKrP+LxsEAzg1dryiH6k8wkSfdEoEfuqjPsNKsH2+BHE9D1ldCHiuZz8IKL1lIVNZA9o/JwHKT/M/fjAR5VMiIMk5+oNr/lG2eibSIDtMrp9b2TjWOfUYRhharUxGg005s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772255; c=relaxed/simple; bh=B87t9irMwa1Woziqob9gKqOueiGVlqkiYIMNBao3tAo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=n9tX9D3LPEB92WSxH9g/3tkl5Wz5u+yNVEJxV784Zfi0cWV3l7fJkXOmvAvE+zTTcGPfjqQXekdPSYX0P6auaH4Zq2rIm6IZRY0kOiFpRgqZEZkVnd6fvFafPszk2ME42dQEK4/QdX9PMW6U76UYFBxq53QgAGd4muHEoBFCerw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=PlEPWiBn; arc=none smtp.client-ip=209.85.214.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="PlEPWiBn" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-1ec5387aed9so1020455ad.3 for ; Fri, 03 May 2024 14:37:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772253; x=1715377053; darn=vger.kernel.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=j0ij9ytrBMTlh/tBwBQfGeyqwsUC3qnXNREpsQEX2pQ=; b=PlEPWiBnBDTDORmTMHlrEDOnDreTNMCRIcrBp/ThpsczWdBGDFsCfyRdYl7Gxyp9yC OAPYwYQy/bfGoChRuCbUQHdjcDefUW1KNJsUlMVXeL6tOwiI2z80DAep5yY9o6xpoLOg GHp/9TBDqT1hzha7HLN8vXSJ/u4vRZubi/6ao= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772253; x=1715377053; 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=j0ij9ytrBMTlh/tBwBQfGeyqwsUC3qnXNREpsQEX2pQ=; b=Ob3t2PQHDFK5+reNwSkRz6FH+YeTrCXdTo8DSpQXsDtQ3XGbyabtUfPdtJVUwo4pow +Yat7g1rtlyp447rU5cXkxMeWUZyo7kvT6QWHjh2tOCOj7IBJCdBa96NCl7US4J85w1u lzwaW64lk/zEU7MsrYcl6YKonSxmKhjAGQwRqupHpmNIjjxhRGmVKZHwK/PjszGfmAuK H++X2DWEFXILQ5f9nBJ+hJbMCvrnGtF5s1PygqILlfZcrHj06XP3kavTkArwNJCktGrL STmVYAVNru6gRaK7U4zX4TR3pkdlVGb0WP4MMWBcwz1CSu7kXb8JY3wbQSCn9pB88NsG vfoQ== X-Forwarded-Encrypted: i=1; AJvYcCUuCFgMrU4q/JdFvcnfWmErLKOEoc+IJL1ZG65oEkxUJDZODMl1JGrJJPg3SWEhkgFS1ksNVFOKZYpcg2BxMac7eyDS/TR7JyKUP1ap X-Gm-Message-State: AOJu0YwH+R5w6ciRV1TDqL8cCtVe9S3sT72sef9p5MsUoX5bukWnD6IB MREaf7cDbZOUvzv4QTSFsSakZZalBmuQ4mTf4KlkethBqYYNCKYa1bgjUuJhnw== X-Google-Smtp-Source: AGHT+IGZhFFrirxel2mH4hhJVW+YPU9/55QLc4j01+5DJlTA0WMSbmDxlLpFOw990mv8yfllPRRAHg== X-Received: by 2002:a17:902:ef8b:b0:1e2:c554:a93c with SMTP id iz11-20020a170902ef8b00b001e2c554a93cmr2868203plb.29.1714772253398; Fri, 03 May 2024 14:37:33 -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.37.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:37: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 , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 29/48] drm/panel: tdo-tl070wsh30: Don't call unprepare+disable at shutdown/remove Date: Fri, 3 May 2024 14:33:10 -0700 Message-ID: <20240503143327.RFT.v2.29.I46ff4e28c260bcd8e81205debd0994e76fd8aeac@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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: Neil Armstrong Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c b/drivers/gpu/drm= /panel/panel-tdo-tl070wsh30.c index 36f27c664b69..227f97f9b136 100644 --- a/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c +++ b/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c @@ -208,16 +208,6 @@ static void tdo_tl070wsh30_panel_remove(struct mipi_ds= i_device *dsi) dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err); =20 drm_panel_remove(&tdo_tl070wsh30->base); - drm_panel_disable(&tdo_tl070wsh30->base); - drm_panel_unprepare(&tdo_tl070wsh30->base); -} - -static void tdo_tl070wsh30_panel_shutdown(struct mipi_dsi_device *dsi) -{ - struct tdo_tl070wsh30_panel *tdo_tl070wsh30 =3D mipi_dsi_get_drvdata(dsi); - - drm_panel_disable(&tdo_tl070wsh30->base); - drm_panel_unprepare(&tdo_tl070wsh30->base); } =20 static struct mipi_dsi_driver tdo_tl070wsh30_panel_driver =3D { @@ -227,7 +217,6 @@ static struct mipi_dsi_driver tdo_tl070wsh30_panel_driv= er =3D { }, .probe =3D tdo_tl070wsh30_panel_probe, .remove =3D tdo_tl070wsh30_panel_remove, - .shutdown =3D tdo_tl070wsh30_panel_shutdown, }; module_mipi_dsi_driver(tdo_tl070wsh30_panel_driver); =20 --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:17 2024 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C9D4D13343F for ; Fri, 3 May 2024 21:37:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772258; cv=none; b=YQqO75STdXYhZAEA56DSZdjZJCCUb7Cc51nWLfd1IOmIrMQuvbCydT28q97AxSlPJMAiweDtaobcJugbNtOyEgVX5GghFAGoB0Lmvlyf6L8+zIMsJ0msU9NK0bOxSHgym5Ak7MVmI595PY5fBc0ckQxHTsgcY60jIKXofsm0XiE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772258; c=relaxed/simple; bh=DzF0LuqgWgJiKJScMe6Jcg8gTZgCyWUsbhFN4tw2nSw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=SXVOM5bsKCj9T7T3n8+vYrjusbgxo9TiulqBVt3/TeB9j9/iRoRVvqcNtr+5Qy73aj/J8H16hI9vd3Zxs7+hogM1nWkZMw79Q1nNml1M7pKGQPOlNdcY8S1m9jnfi3GUb7FM7UuwmpTlYv5tXi1L1kRMeHzpvlU38A/f2HUmXCU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=BJTtGeG4; arc=none smtp.client-ip=209.85.214.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="BJTtGeG4" Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-1ec69e3dbe5so1227255ad.0 for ; Fri, 03 May 2024 14:37:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772256; x=1715377056; darn=vger.kernel.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=uiw1xydznhtSh3tRBtRhpS0zYaaoLUo2meLrU+lEUtM=; b=BJTtGeG4h0a8kZ+e7/uqU3aAN54RtbR9+ZrHgPA3yztRVTJcSzzzCfev6cJb5NRZ+j 5JtV3UxplkGCANX8auKLp9OI7SjgSBeeRQgAFe7hSA3r4yAVHrSNN5s6L681TnumBquX 2hKjKT5jniLKaE0KUCRAojaoS6TkSsK/J4ngI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772256; x=1715377056; 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=uiw1xydznhtSh3tRBtRhpS0zYaaoLUo2meLrU+lEUtM=; b=dJIWNnGXRwtQF8LnaJowTOw14zf50RAE8NE2wq9n0QVVAtMzvGuueV3d2doQHBnGMY vNQJEfOhByfw7FvXgz52pk858fi6w041vIdWrWVUPV991WD1920Wgfdc602xn7iVNx/7 J9/KIGbi8BEqu7u6BUXccU39OdtDY2yKbKEUeQL9n3ShYWdaTok0xlJym717I55gGm4e wvi2ZRGqpOPoIZt7JVz718GZKQ9K6Rr9A93QtS1Ok21o1tfV6M5Cle2cVziAPoqVxzXy +OBdyOSTVarWuJrxjR1FksvxTJ7bAtK1WgBqNKI/bY2poTET9a9CI7nwTMDKZynqGm+M 8Lqw== X-Forwarded-Encrypted: i=1; AJvYcCXoP41wkhumlUh7RnD+/rnNGNlI0WGfPPf1LHJEWqaGU8PU/6bFT1FihyTiIsR6uYDt8sP+CoiqjuMbASEbN3GjhMXJJF2eoF/YvgIj X-Gm-Message-State: AOJu0YzCJbfeOhcOiWx20DDNbDp0mva9AIxVvnAYkbisAyZo6tW8n4fd snX2KuNioIyMwEdVUaqbdbsmqN+BSM9Gkz8GyrP3nIiFlR9U+tOf5SMULbRazX9EL0sR5LPDUO2 AHg== X-Google-Smtp-Source: AGHT+IFe81rGj8McqUJlsjyFTCj7SugLiyekq3wZXTXyN5wCjggXDovNiqeay6g57DA6tB8RQd7/nQ== X-Received: by 2002:a17:902:e750:b0:1e7:b7a7:9f20 with SMTP id p16-20020a170902e75000b001e7b7a79f20mr5609022plf.59.1714772256078; Fri, 03 May 2024 14:37:36 -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.37.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:37:35 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , =?UTF-8?q?Heiko=20St=C3=BCbner?= , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 30/48] drm/panel: xinpeng-xpp055c272: Stop tracking prepared Date: Fri, 3 May 2024 14:33:11 -0700 Message-ID: <20240503143327.RFT.v2.30.I2145be78ce28327f4588c2c21370f22fd79d28b8@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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: "Heiko St=C3=BCbner" Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. drivers/gpu/drm/panel/panel-xinpeng-xpp055c272.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-xinpeng-xpp055c272.c b/drivers/gpu= /drm/panel/panel-xinpeng-xpp055c272.c index 8670386498a4..8262c00670cf 100644 --- a/drivers/gpu/drm/panel/panel-xinpeng-xpp055c272.c +++ b/drivers/gpu/drm/panel/panel-xinpeng-xpp055c272.c @@ -52,7 +52,6 @@ struct xpp055c272 { struct gpio_desc *reset_gpio; struct regulator *vci; struct regulator *iovcc; - bool prepared; }; =20 static inline struct xpp055c272 *panel_to_xpp055c272(struct drm_panel *pan= el) @@ -136,9 +135,6 @@ static int xpp055c272_unprepare(struct drm_panel *panel) struct mipi_dsi_device *dsi =3D to_mipi_dsi_device(ctx->dev); int ret; =20 - if (!ctx->prepared) - return 0; - ret =3D mipi_dsi_dcs_set_display_off(dsi); if (ret < 0) dev_err(ctx->dev, "failed to set display off: %d\n", ret); @@ -152,8 +148,6 @@ static int xpp055c272_unprepare(struct drm_panel *panel) regulator_disable(ctx->iovcc); regulator_disable(ctx->vci); =20 - ctx->prepared =3D false; - return 0; } =20 @@ -163,9 +157,6 @@ static int xpp055c272_prepare(struct drm_panel *panel) struct mipi_dsi_device *dsi =3D to_mipi_dsi_device(ctx->dev); int ret; =20 - if (ctx->prepared) - return 0; - dev_dbg(ctx->dev, "Resetting the panel\n"); ret =3D regulator_enable(ctx->vci); if (ret < 0) { @@ -209,8 +200,6 @@ static int xpp055c272_prepare(struct drm_panel *panel) =20 msleep(50); =20 - ctx->prepared =3D true; - return 0; =20 disable_iovcc: --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:17 2024 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4CDD413442A for ; Fri, 3 May 2024 21:37:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772260; cv=none; b=qpg1N4uF4JiFjLf/gi/2hJpsDSu4kOJ8ls6lzsZiFeYZYSwUF2ZPl+FmzF634eedWYA9c/x4f9La40a3J2d8UVBDKxHf2D1GUpDZTDBfA9y578oiPagpZIuQ4YjUxiQyXaua3hAcBpvr7ISTmNgRORpiMdCfFJ6NM8QTRm32mws= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772260; c=relaxed/simple; bh=8AL4/BrmmLegJmpkJf63Gl5oIOD38PWXABHHgefe0OQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=g2gQ1cnxaZSv+QynpMqaIpqTmCM9p02A3ChRSMgyF0XleTO5NT7HKXzonXpGFDbz9uGsXZJryn+iukLe2QxkLXxzTbCQhihV76RYBa9E2362+zRzFDSKtQfJx4zRfjqdkbZmPjVTG2l98EzBDfOfzNjscekDcU1stmCV65/eoN4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=dxgRrXyU; arc=none smtp.client-ip=209.85.214.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="dxgRrXyU" Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-1e651a9f3ffso687465ad.1 for ; Fri, 03 May 2024 14:37:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772258; x=1715377058; darn=vger.kernel.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=/OkjbvX0C1irAjMh4DggDyOVbw/aLDxkOK/5mqNSwoE=; b=dxgRrXyU4/suDsAuhhvmlmvkUTu/Q9rTBcyrzCFaDZO5/W7WcTm5UStp7gW2i9FjpR lVwa4gBB1Nf4jDfap6jRYgt14GY5ktmTgw3pdl+7O7hJuCu5IynumUgYeAS9nzPqyCOg cXk5dHM7q3mjwIKtZViYLVzosNzbabPRhwlas= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772258; x=1715377058; 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=/OkjbvX0C1irAjMh4DggDyOVbw/aLDxkOK/5mqNSwoE=; b=iZlYVhIJoiP3B9qp9F5lTplmqmhFAJgMWsE9xxX/Wlcj4eqz0l/qqQFJ5Y3RsE+1E8 Jf1b+DrExGf936jCbx9b3HgBN3kaw3ztbdhTlWomDPnWhEG8Gyr1PZMSMdKaM8OGL49Q kEI4SefpAwBi51VPJ7u2QvhZS2hP6iKD7+N2JgxqzFRcjzFgkjnJV5n2AM5QLTsZAcUR gtx+8InkjvUbuKZwpZe6sYEa2NijUw8FXGVrfsKpqLSvx76xBWxI5vpg2n+fXSvM2yZt OGcDYi6fINDT34YAeSX9lzwx4mDOEZohAsQmzHDxJ3gSKFMwsWlqNk9yrs2DAI2TNDNz WaAQ== X-Forwarded-Encrypted: i=1; AJvYcCWxe6Ujov8C1/76eYN/Wqx70I6bAjAaYnBIoC/A2MeMAVRiZS4fCr7HVx+X4gk3kYD4w/rIjGKchcL02maiuBaacqFrYPD0eatc3R7x X-Gm-Message-State: AOJu0YwU32D+vwchROFrKlMQ4ELqaMR4opwbyAFJHf2a2B0NYCDmRqBr 4U+fd4gTzXhlzJYqgl3hceCB+Z9y4Izrgy8ADjXj4I728jC+Oj4NUjMvFATwrw== X-Google-Smtp-Source: AGHT+IGYHi4nDiwk/CzlytVTK20zaPGarGSgcOiG/MYrHHmtbd3gAzexe8vp7KqG0wrEiuiufOiKDQ== X-Received: by 2002:a17:903:1108:b0:1e5:5bd7:e2b7 with SMTP id n8-20020a170903110800b001e55bd7e2b7mr3948148plh.34.1714772258578; Fri, 03 May 2024 14:37:38 -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.37.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:37:38 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , =?UTF-8?q?Heiko=20St=C3=BCbner?= , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 31/48] drm/panel: xinpeng-xpp055c272: Don't call unprepare+disable at shutdown/remove Date: Fri, 3 May 2024 14:33:12 -0700 Message-ID: <20240503143327.RFT.v2.31.Ib97e67a9877070698afbec4f8ede091b2bf89a1f@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 Rockchip boards. The Rockchip driver appears 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: "Heiko St=C3=BCbner" Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. .../gpu/drm/panel/panel-xinpeng-xpp055c272.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-xinpeng-xpp055c272.c b/drivers/gpu= /drm/panel/panel-xinpeng-xpp055c272.c index 8262c00670cf..22a14006765e 100644 --- a/drivers/gpu/drm/panel/panel-xinpeng-xpp055c272.c +++ b/drivers/gpu/drm/panel/panel-xinpeng-xpp055c272.c @@ -306,27 +306,11 @@ static int xpp055c272_probe(struct mipi_dsi_device *d= si) return 0; } =20 -static void xpp055c272_shutdown(struct mipi_dsi_device *dsi) -{ - struct xpp055c272 *ctx =3D mipi_dsi_get_drvdata(dsi); - int ret; - - ret =3D drm_panel_unprepare(&ctx->panel); - if (ret < 0) - dev_err(&dsi->dev, "Failed to unprepare panel: %d\n", ret); - - ret =3D drm_panel_disable(&ctx->panel); - if (ret < 0) - dev_err(&dsi->dev, "Failed to disable panel: %d\n", ret); -} - static void xpp055c272_remove(struct mipi_dsi_device *dsi) { struct xpp055c272 *ctx =3D mipi_dsi_get_drvdata(dsi); int ret; =20 - xpp055c272_shutdown(dsi); - ret =3D mipi_dsi_detach(dsi); if (ret < 0) dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); @@ -347,7 +331,6 @@ static struct mipi_dsi_driver xpp055c272_driver =3D { }, .probe =3D xpp055c272_probe, .remove =3D xpp055c272_remove, - .shutdown =3D xpp055c272_shutdown, }; module_mipi_dsi_driver(xpp055c272_driver); =20 --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:17 2024 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 577A6134724 for ; Fri, 3 May 2024 21:37:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772264; cv=none; b=ET/U88NzM5AuBoYg41CPfpzs0SCAy2HULstp07GzcnVqQTzQnBP5gV9DliwU1879FkX5sK1q0BUzrZo907A0HFGaAo7bGJy7QtYsZ5OJw/bco9i2nGuMyg17COHzRVmxMYLqTE/OF0n6c56ZeRuPT1siet5dfdg20KEvRoBGOwA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772264; c=relaxed/simple; bh=EW9EHA19HYq7AAGYskgYbnLH9iMVmfN0mFfb448TwtQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=b7uKhzRBEaxc0gCIuOocMGSvqRyiuxi+khDJw08stqkYYeJlOPu1wEWCN2Jke0LIci/q9/AIrb6gN561JnI9aHtvvhJGj8DtA/6Od0RSb6rzQYALwRe7D3MUPLQzZH5ZfSIywXUgVTnY8d000HwsKFZTY11t11A8kG/zfRUNzRU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=gAOLYe0N; arc=none smtp.client-ip=209.85.214.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="gAOLYe0N" Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-1ecc23e6c9dso730515ad.2 for ; Fri, 03 May 2024 14:37:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772260; x=1715377060; darn=vger.kernel.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=O/Sm++Egsx8q7rlUkwUyB5q6Cu7fnuL8sFgKBvzduqs=; b=gAOLYe0NaIFchFC93Jn5JiiBP4D7dKHJegy+bOBSHt6trTgrxevXj1sWZgyEDqOGBT O3RU26ktsfsZ59pGgmax/K08GkWnJWEmJMabx1ahQZ1MB3Dr2vLCEn46HSZkblDCj+9m pZ2EBoJF8gsIxFXRl2s4tXqinGWKSv+6Dzf/k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772260; x=1715377060; 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=O/Sm++Egsx8q7rlUkwUyB5q6Cu7fnuL8sFgKBvzduqs=; b=uhDoHRCOsCdtSRJfNG4bXrPgaFNmqhypC2fB8uF4wD7JzVKiuSI0Hgeq4M/SiNeost zzRI8xbfiK8xPKsdmF0+aQSX5qFNrUAjxMo9xdgJSZU6Vm1kGW2myFGaMUhCavt2zl9d JFBBm1CadUcuWPLqeBn0pzNPDVBrOT3LeNCvH1SMaCpBg8a7EaOH5rAdHikrm0z8Ok4w O5Gm3b61u8uLjglWb2GPr6jAoupyElNvjVQRXlh0yQAAIHJWLxJi3YsxndczhRHSD62N J2tt2iVokeGLLR8aSpLyTSUuod2i2FtvxlQlGYJgthZmc5w7+D5jAnFGbtpSGdS8ku/E 29GQ== X-Forwarded-Encrypted: i=1; AJvYcCUo5ZhErzRkOB31kRCqOIHJkuzle+/K25FBuIr0KJ6o1Y5B+XhMRFjgefuV4AcSAKP2dpZWRO87q7p/Cqp+SME7DlTjIvd0OCI0Q5ia X-Gm-Message-State: AOJu0Yw05voPWP/Ew28lDOwYRKEGppW7SMlXhK4cWEAFhHE2zipgH820 GFmbuH+/VwSr1h0hRoW5rWjbwwFdbQG7RAiBlunkAmGHy4GWbyycxbndGSboBg== X-Google-Smtp-Source: AGHT+IGCLyeRka7bEbj1rtJf7J0U2tyRPC1SfBgt3k9U7tPl56QaTyO/M7OMcuQw3XwRdMK87YcijA== X-Received: by 2002:a17:902:cec2:b0:1e4:47bf:6926 with SMTP id d2-20020a170902cec200b001e447bf6926mr5145949plg.4.1714772260615; Fri, 03 May 2024 14:37:40 -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.37.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:37:39 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , Vinay Simha BN , Sumit Semwal , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 32/48] drm/panel: jdi-lt070me05000: Stop tracking prepared/enabled Date: Fri, 3 May 2024 14:33:13 -0700 Message-ID: <20240503143327.RFT.v2.32.I2e991044def6644c18ad8d7d686f4f3006f278de@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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. NOTE: as part of this, transition the panel's direct calls to its disable function in shutdown/remove to call through DRM panel. Cc: Vinay Simha BN Cc: Sumit Semwal Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard --- Note: since we are able to identify that this panel only appears to be used on Qualcomm boards and we have to touch the shutdown/remove path in this patch anyway, we could possibly squash this with the next patch that removes the disable call in shutdown/remove. For now I'm keeping them separate just to keep the concepts separate. Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. .../gpu/drm/panel/panel-jdi-lt070me05000.c | 27 ++----------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c b/drivers/gpu/d= rm/panel/panel-jdi-lt070me05000.c index f9a69f347068..4ddddee6fa1e 100644 --- a/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c +++ b/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c @@ -37,9 +37,6 @@ struct jdi_panel { struct gpio_desc *dcdc_en_gpio; struct backlight_device *backlight; =20 - bool prepared; - bool enabled; - const struct drm_display_mode *mode; }; =20 @@ -176,13 +173,8 @@ static int jdi_panel_disable(struct drm_panel *panel) { struct jdi_panel *jdi =3D to_jdi_panel(panel); =20 - if (!jdi->enabled) - return 0; - backlight_disable(jdi->backlight); =20 - jdi->enabled =3D false; - return 0; } =20 @@ -192,9 +184,6 @@ static int jdi_panel_unprepare(struct drm_panel *panel) struct device *dev =3D &jdi->dsi->dev; int ret; =20 - if (!jdi->prepared) - return 0; - jdi_panel_off(jdi); =20 ret =3D regulator_bulk_disable(ARRAY_SIZE(jdi->supplies), jdi->supplies); @@ -207,8 +196,6 @@ static int jdi_panel_unprepare(struct drm_panel *panel) =20 gpiod_set_value(jdi->dcdc_en_gpio, 0); =20 - jdi->prepared =3D false; - return 0; } =20 @@ -218,9 +205,6 @@ static int jdi_panel_prepare(struct drm_panel *panel) struct device *dev =3D &jdi->dsi->dev; int ret; =20 - if (jdi->prepared) - return 0; - ret =3D regulator_bulk_enable(ARRAY_SIZE(jdi->supplies), jdi->supplies); if (ret < 0) { dev_err(dev, "regulator enable failed, %d\n", ret); @@ -250,8 +234,6 @@ static int jdi_panel_prepare(struct drm_panel *panel) goto poweroff; } =20 - jdi->prepared =3D true; - return 0; =20 poweroff: @@ -272,13 +254,8 @@ static int jdi_panel_enable(struct drm_panel *panel) { struct jdi_panel *jdi =3D to_jdi_panel(panel); =20 - if (jdi->enabled) - return 0; - backlight_enable(jdi->backlight); =20 - jdi->enabled =3D true; - return 0; } =20 @@ -475,7 +452,7 @@ static void jdi_panel_remove(struct mipi_dsi_device *ds= i) struct jdi_panel *jdi =3D mipi_dsi_get_drvdata(dsi); int ret; =20 - ret =3D jdi_panel_disable(&jdi->base); + ret =3D drm_panel_disable(&jdi->base); if (ret < 0) dev_err(&dsi->dev, "failed to disable panel: %d\n", ret); =20 @@ -491,7 +468,7 @@ static void jdi_panel_shutdown(struct mipi_dsi_device *= dsi) { struct jdi_panel *jdi =3D mipi_dsi_get_drvdata(dsi); =20 - jdi_panel_disable(&jdi->base); + drm_panel_disable(&jdi->base); } =20 static struct mipi_dsi_driver jdi_panel_driver =3D { --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:17 2024 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 66FEC134CCA for ; Fri, 3 May 2024 21:37:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772265; cv=none; b=FqcvUuh4qLDvhrRUfS/YIwCqBluuiWdbi70Szo1POj/oyYBa3Ie2IedDN1ojToLheRjwLXU5Gcou54YCHytkdxStc75ie2ROTnSStRe/L8CTsD1cebz2t3qXM3f2p68N0f4/FWrrRc2t5BumZ46kIZR1Dk8WCUvNUljBm5WS4bI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772265; c=relaxed/simple; bh=BF3dCpXK+NdR+9fZmJzvRA35PnI5/Esc/CrBPmmzn04=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DG0vZdIbDmhZS/UFCs/qnUqPovVF8dDIPj05LtDuEzvgM0wsSzavT5ZfjXHwcvVxR0phwAHMg+E2Nk1X7UwmAuT9qqgvB8PAtzPdwkrO3BJ46pmCsbD2Wma3GLL1F8W406fvVXwaGED70+T3BhnGxCAjg6+CfrephBWl75UPUCQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=W0P2j7zj; arc=none smtp.client-ip=209.85.214.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="W0P2j7zj" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-1ecd9dab183so19701325ad.1 for ; Fri, 03 May 2024 14:37:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772262; x=1715377062; darn=vger.kernel.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=HlKkW94AChnsvIhCVySiJbRiNalT5tOJ34PXKTcPDbA=; b=W0P2j7zjZIcPhUzYYNNGaG17xzxoF7u89nO60go5ZjlA9Qjpjdr3J8pzD8ftCaXuuz yM4b0ZcIWuv/h40VkU7J9S92NOutnlOFKUMt+8TPhqgZ002I7smRCJ7AxtKnU90qWz3F HXJByypXcKSO+/nwRJPsCqQTFc9uQa9xAWXgY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772262; x=1715377062; 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=HlKkW94AChnsvIhCVySiJbRiNalT5tOJ34PXKTcPDbA=; b=HqDpTqqPhmJw5W5Xp+/PL7vpRul3rPWzlEAX9hcPQNnE7G77Krvh7j4aVhku2rBtvh rwQQ66OSSCuZG99KVc4XQLcuM9MGG7IhxmXx3/h1djX9sFnfKI4L+hiG83agr3+dCMRc 9M6vdqFeghfbJBSY2rMO+HOf1lQ/BKQfef1gWGUVAtuqLKgSt8XJp+pIOd8ehJimHeVx d88FaUhNb8IEVYXX5I/BoS4MVinIf/gRuAuHEvbGNPqldEeP/sN1SXbdB8XjJXtRNzNZ BcckPrbfj3zU8cq+LeZVrtqAmI23F6pFP3zTDB8zXNqglVdltRrJqrB4IgjMSVJvImpm EdDw== X-Forwarded-Encrypted: i=1; AJvYcCU86m2k3tvgVzT5SfmKhTNjVOeZ+4K2Gx1uMkuehKN58YjujEH+zqxpIOXJ2kpEIHHsSmetl4lAzY23eiTFSVthtOnKvakgp0pRzLFS X-Gm-Message-State: AOJu0YyseGBVM+y4cXtxoQRhB/TYDX7OBmp6Z6/x5TBzDMz6oPSLGB1Z mVMSXAATB95HqcX3O3wyoagKMzKxmpHQ2kIG7W7bM5KVKavt78Plp57NzdpOxQ== X-Google-Smtp-Source: AGHT+IEq5AgUw6GyV8pe9okGVdoOhJW8iWaIkyS1EF9ClHC3n8yX96iFTRmuWTK/fQ6r8ShwT0dFzQ== X-Received: by 2002:a17:903:41cb:b0:1eb:8299:db35 with SMTP id u11-20020a17090341cb00b001eb8299db35mr10401266ple.32.1714772262650; Fri, 03 May 2024 14:37:42 -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.37.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:37:41 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , Vinay Simha BN , Sumit Semwal , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 33/48] drm/panel: jdi-lt070me05000: Don't call disable at shutdown/remove Date: Fri, 3 May 2024 14:33:14 -0700 Message-ID: <20240503143327.RFT.v2.33.I5f3426e511e77b93c247e0aac114bd12b2b2a933@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Qualcomm boards. The Qualcomm driver appears 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: Vinay Simha BN Cc: Sumit Semwal Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. drivers/gpu/drm/panel/panel-jdi-lt070me05000.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c b/drivers/gpu/d= rm/panel/panel-jdi-lt070me05000.c index 4ddddee6fa1e..b1ce186de261 100644 --- a/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c +++ b/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c @@ -452,10 +452,6 @@ static void jdi_panel_remove(struct mipi_dsi_device *d= si) struct jdi_panel *jdi =3D mipi_dsi_get_drvdata(dsi); int ret; =20 - ret =3D drm_panel_disable(&jdi->base); - if (ret < 0) - dev_err(&dsi->dev, "failed to disable panel: %d\n", ret); - ret =3D mipi_dsi_detach(dsi); if (ret < 0) dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", @@ -464,13 +460,6 @@ static void jdi_panel_remove(struct mipi_dsi_device *d= si) jdi_panel_del(jdi); } =20 -static void jdi_panel_shutdown(struct mipi_dsi_device *dsi) -{ - struct jdi_panel *jdi =3D mipi_dsi_get_drvdata(dsi); - - drm_panel_disable(&jdi->base); -} - static struct mipi_dsi_driver jdi_panel_driver =3D { .driver =3D { .name =3D "panel-jdi-lt070me05000", @@ -478,7 +467,6 @@ static struct mipi_dsi_driver jdi_panel_driver =3D { }, .probe =3D jdi_panel_probe, .remove =3D jdi_panel_remove, - .shutdown =3D jdi_panel_shutdown, }; module_mipi_dsi_driver(jdi_panel_driver); =20 --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:17 2024 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6AAA2134CDC for ; Fri, 3 May 2024 21:37:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772266; cv=none; b=h/ZXcjY4nnnZ1TkPPQUqSoymMchthO9LrEU3Lz6cCmi7jnWPLF9AkTtZelUjfEaUw1xNUTBaHhq0f9RxW3ohq6zm+bGLgAUGGb4HRh2Qse8zw4+lkV8BZoxld6+KiLsgTk5w/CmBzMzdqgywdiBMyrg4mSI78KJEszsiRyy7t4g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772266; c=relaxed/simple; bh=0C7Ml53z9t79QGcTfL88T3+BhLGG1chLfgvfo7p+NnY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ouph/0bKk72b536YZHQISCSmcJYGHFSBW4ThlclihxiIBm2Pmw+CwtpN9amQKHjUDbfJjstKwU8kI/A8MR6GpOzAMcOWcbfk0Sf0FOM4NKHz6HVZVxEC4rR3WvAho3Zp+ZuSPZPB2+Fwg1Ze9gRVZHI4IIJ0m1z0tuZ3ec2osYA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=WmeVzNH8; arc=none smtp.client-ip=209.85.214.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="WmeVzNH8" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-1eab16c8d83so861345ad.3 for ; Fri, 03 May 2024 14:37:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772265; x=1715377065; darn=vger.kernel.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=wZDXX5+LO4KCYTMyL9bFp7mWqxckeafU4NqU6b6Zl+A=; b=WmeVzNH8Qw1O7QZA00O3UJ7+L4wV/q02V8OYkwGFWcpTtFWNw1xrOwAYuY7F6L0fGI KinINz/AmRsMP48a+Gjc3qkgWndttBkfWXPoCkgGY7UV8b9UMQazenpm1TW9sEmDYygg ov5gVMO9L4JxoAqkcZrtp02lKO/qADcliGjYE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772265; x=1715377065; 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=wZDXX5+LO4KCYTMyL9bFp7mWqxckeafU4NqU6b6Zl+A=; b=Tozqtf50xZLomiJ89NvvHelvELuGz4Y36GzibePznPnYeH+pW7+vYvBBGbPafklLIx dCM11e9NG+CBuevzkjoe1rr/xK3vW2WlZoDI5e+KL8jvI9zZ5T57Ij8sk41iU3XKoBjk 1LCBUwtcdrXTvbU8P43lsAgAUJpyArcwrlm/+lUW12ER6Re0zix0qige3+6innsU9X4n H7KAQ8k3FJzecuW1Ubh2aXVHoOlLbQfT4ApjnG9CKTXTBpyE0lsejFmPf5m+pulfephI tDFpdHM4r3/GD62u/pfizZE2nJrA8++vc+C+mqF9pIDctYgKKxHgB+j7fThChJtehQS8 C+pg== X-Forwarded-Encrypted: i=1; AJvYcCWH8SU7qs3clNHV8/vP9UX4aYpyNYu67MO3W7KSN/YLoDh4ma9cpzcVyWS8nZ1UUpsDozFIzxsbMuilVW/8HnNwf5CvF3YfW0gRueUr X-Gm-Message-State: AOJu0YzLUfq1TwFrZjoKS9sZ0zc7VNu+2/1SnC3ovwwwGisjRW8/O/km m6zxzxkcHeK96crgOthJZ5ggenHuLcYo2qPetBxFy9WVMmOIbag2O4y6c2/gdg== X-Google-Smtp-Source: AGHT+IEM/QZtMkwvjlLIFbPnkF0+gcBny1uUrL28BGWnqjNaJ9gJCfvZsyvZC8Acyq8l9IiCgiHpFQ== X-Received: by 2002:a17:903:41d1:b0:1ec:22ca:b290 with SMTP id u17-20020a17090341d100b001ec22cab290mr5158303ple.21.1714772264830; Fri, 03 May 2024 14:37:44 -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.37.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:37:44 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , Werner Johansson , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 34/48] drm/panel: panasonic-vvx10f034n00: Stop tracking prepared/enabled Date: Fri, 3 May 2024 14:33:15 -0700 Message-ID: <20240503143327.RFT.v2.34.I7278e956ffd1cf686e737834578d4bb3ea527c7f@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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. Cc: Werner Johansson Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. .../drm/panel/panel-panasonic-vvx10f034n00.c | 35 +------------------ 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c b/drivers= /gpu/drm/panel/panel-panasonic-vvx10f034n00.c index 8ba6d8287938..822ca2f971eb 100644 --- a/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c +++ b/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c @@ -32,9 +32,6 @@ struct wuxga_nt_panel { =20 struct regulator *supply; =20 - bool prepared; - bool enabled; - ktime_t earliest_wake; =20 const struct drm_display_mode *mode; @@ -53,28 +50,16 @@ static int wuxga_nt_panel_on(struct wuxga_nt_panel *wux= ga_nt) static int wuxga_nt_panel_disable(struct drm_panel *panel) { struct wuxga_nt_panel *wuxga_nt =3D to_wuxga_nt_panel(panel); - int mipi_ret, bl_ret =3D 0; - - if (!wuxga_nt->enabled) - return 0; - - mipi_ret =3D mipi_dsi_shutdown_peripheral(wuxga_nt->dsi); - - wuxga_nt->enabled =3D false; =20 - return mipi_ret ? mipi_ret : bl_ret; + return mipi_dsi_shutdown_peripheral(wuxga_nt->dsi); } =20 static int wuxga_nt_panel_unprepare(struct drm_panel *panel) { struct wuxga_nt_panel *wuxga_nt =3D to_wuxga_nt_panel(panel); =20 - if (!wuxga_nt->prepared) - return 0; - regulator_disable(wuxga_nt->supply); wuxga_nt->earliest_wake =3D ktime_add_ms(ktime_get_real(), MIN_POFF_MS); - wuxga_nt->prepared =3D false; =20 return 0; } @@ -85,9 +70,6 @@ static int wuxga_nt_panel_prepare(struct drm_panel *panel) int ret; s64 enablewait; =20 - if (wuxga_nt->prepared) - return 0; - /* * If the user re-enabled the panel before the required off-time then * we need to wait the remaining period before re-enabling regulator @@ -117,8 +99,6 @@ static int wuxga_nt_panel_prepare(struct drm_panel *pane= l) goto poweroff; } =20 - wuxga_nt->prepared =3D true; - return 0; =20 poweroff: @@ -127,18 +107,6 @@ static int wuxga_nt_panel_prepare(struct drm_panel *pa= nel) return ret; } =20 -static int wuxga_nt_panel_enable(struct drm_panel *panel) -{ - struct wuxga_nt_panel *wuxga_nt =3D to_wuxga_nt_panel(panel); - - if (wuxga_nt->enabled) - return 0; - - wuxga_nt->enabled =3D true; - - return 0; -} - static const struct drm_display_mode default_mode =3D { .clock =3D 164402, .hdisplay =3D 1920, @@ -178,7 +146,6 @@ static const struct drm_panel_funcs wuxga_nt_panel_func= s =3D { .disable =3D wuxga_nt_panel_disable, .unprepare =3D wuxga_nt_panel_unprepare, .prepare =3D wuxga_nt_panel_prepare, - .enable =3D wuxga_nt_panel_enable, .get_modes =3D wuxga_nt_panel_get_modes, }; =20 --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:17 2024 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 632891353E1 for ; Fri, 3 May 2024 21:37:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772268; cv=none; b=f+FTyWl2sqhm1FrMwqAkv9sC3V9EXfuJukhVb/2GQ8WqbR4xg8iUDBa0+i6wl778789l2/SUqREWUQDjN/aemE7M+eW2Bm83OKDVzd5ODVNcEIDYgxi/Ua282LuBBP3kOBMOAl7cjFETSrL4Gh4p1DbNd/oGJILWGnq++zonixM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772268; c=relaxed/simple; bh=0c2PVXNgA4nlOkkqlvM45fh6+dC0inZ9PV3m/UHMawM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BTVa/euLU4eAAT7lHlsSbTUN1QWAu3OfhO90PSZIuKzvOfKi2n7X+m05069LHpmzRxvX5dWVeh3FPX9GZsseiviCqBsqZizedOGQ3ERP9YNmEmxk+h5kp74MlbVGFn13KjJxuVx3Iaa4g7jrVs6VKFGp2rnF8sCNqHKuTkX58w4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=PvV2Hg4S; arc=none smtp.client-ip=209.85.214.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="PvV2Hg4S" Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1ec69e3dbe5so1228245ad.0 for ; Fri, 03 May 2024 14:37:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772267; x=1715377067; darn=vger.kernel.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=JIn+sWO9dEDf1DvG5c+RzmcIdDo8LI3xPQg/VI7zljA=; b=PvV2Hg4Sc1J3CW1rGaUx9E/Nhq4Z0rzwuQ42f0fAPwMFQgkzXSVTOB6DZaE3GXhowA Ujkg33H0T5XZmUWaYQ4Axf63V28uIPCDgZKXENIRoioZk8nwITInCiPiurIc9gb03C1q 9+jiFb5kv3L8CCQeeDprMyRZdK2GvByvIM/nc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772267; x=1715377067; 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=JIn+sWO9dEDf1DvG5c+RzmcIdDo8LI3xPQg/VI7zljA=; b=YRBWWMg2W5m8h2GEX+Zgo54WhVyns/q0KdAtQ3UrUHHapY2A/nQmIzMgVAilWWTqUP d5SvfRYP14dgXU58Yz3uSDWwYHfJDiH6aK/LQw9FH2axqg5h7I2EevRV2syoLdPr04DN xfXZSHcCMUofBOpiz+luwEhP0knHuJ1zGN6vaRtVDz3nGFzPvch4Hsu0mAXH2bE5mDy9 V8TBloYCn/qaXooe5+6j0+nGKl3aV70OEvFo5YdTzVc7Wz9unMbDLokJJQzExZdWpDc0 UbV7Nrn8Uoz69sL7yEd6jvaItkLVU1/p3Pp4AvMYp4O3ZGyYU6EgXpzoyohumFOTgJGL GdOg== X-Forwarded-Encrypted: i=1; AJvYcCUDn9NS1H9gP1judrqQs/DF0sAvn6BsJjGq9qsfy0ui6e8k93tAOEl7s7aIYBcQ/qTSbMf6AW0joVgogRq/u2+7Otd/ZdGNnPIAH8rq X-Gm-Message-State: AOJu0YzgvRDqaFtXUR1MAqrlLL0MjP70l2Gm7fVXNdLWrefJVYICqkdf 12PNfRxRjrwGlvTa8Ivf/WAdrzF+/sFPH+pj95g7HWiUuQMRihoKeQ2YnB6AnQ== X-Google-Smtp-Source: AGHT+IFgOtsvmnCpgD9YCuirDNOd6sEAldzPJUUEeKJ2LJEqLasuF33MZxCdPNTGTti/0Ofhqu2Ztw== X-Received: by 2002:a17:902:f54c:b0:1eb:5b59:fab9 with SMTP id h12-20020a170902f54c00b001eb5b59fab9mr5096772plf.53.1714772266832; Fri, 03 May 2024 14:37:46 -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.37.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:37:46 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , Werner Johansson , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 35/48] drm/panel: panasonic-vvx10f034n00: Don't call disable at shutdown/remove Date: Fri, 3 May 2024 14:33:16 -0700 Message-ID: <20240503143327.RFT.v2.35.I1562c864ee35a9c166765488c95104b7e4e562da@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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: Werner Johansson Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c b/drivers= /gpu/drm/panel/panel-panasonic-vvx10f034n00.c index 822ca2f971eb..d1c5c9bc3c56 100644 --- a/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c +++ b/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c @@ -222,10 +222,6 @@ static void wuxga_nt_panel_remove(struct mipi_dsi_devi= ce *dsi) struct wuxga_nt_panel *wuxga_nt =3D mipi_dsi_get_drvdata(dsi); int ret; =20 - ret =3D drm_panel_disable(&wuxga_nt->base); - if (ret < 0) - dev_err(&dsi->dev, "failed to disable panel: %d\n", ret); - ret =3D mipi_dsi_detach(dsi); if (ret < 0) dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", ret); @@ -233,13 +229,6 @@ static void wuxga_nt_panel_remove(struct mipi_dsi_devi= ce *dsi) wuxga_nt_panel_del(wuxga_nt); } =20 -static void wuxga_nt_panel_shutdown(struct mipi_dsi_device *dsi) -{ - struct wuxga_nt_panel *wuxga_nt =3D mipi_dsi_get_drvdata(dsi); - - drm_panel_disable(&wuxga_nt->base); -} - static struct mipi_dsi_driver wuxga_nt_panel_driver =3D { .driver =3D { .name =3D "panel-panasonic-vvx10f034n00", @@ -247,7 +236,6 @@ static struct mipi_dsi_driver wuxga_nt_panel_driver =3D= { }, .probe =3D wuxga_nt_panel_probe, .remove =3D wuxga_nt_panel_remove, - .shutdown =3D wuxga_nt_panel_shutdown, }; module_mipi_dsi_driver(wuxga_nt_panel_driver); =20 --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:17 2024 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C2EA8135A47 for ; Fri, 3 May 2024 21:37:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772271; cv=none; b=r3Yt1L9tQMJD37PyzPhHFScYjhZkCa41rvq8hm8knIvcXp+O+CuuCdRoE7l7puFIOgAUyomZDWAtt3CgZnmTHXPYkVz0nQSuR3NfvhdNK2o3PhecNnhCoqrFk4dqWfbY5G90veIzXO+0wFT4dRJC3Mzrz8M67o71DklDHyKNAMg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772271; c=relaxed/simple; bh=axmCxiLmm7juCKxfHqZtD6qpzVBDjoTLtSOaskdPvC4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gzaUv4upnFVso5wOY0RqUTau/gqSAts0GbVqwDuFUb/yfNqyEaW2PG744AZn85tto8BHXYl/J1myP9V6IrBXK3R1MrdgJSE3oSBIjNsRCoq8mVncFDTelo1K5VAtU1ptjLJFJLV5Qi+yYxg9Dvyug18ydZWOTJ2MTU1K6bNApog= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=gt2Vmvg/; arc=none smtp.client-ip=209.85.214.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="gt2Vmvg/" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-1ec69e3dbe5so1228525ad.0 for ; Fri, 03 May 2024 14:37:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772269; x=1715377069; darn=vger.kernel.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=L0iO3yAQ8KkSt7Wokb68l77QkaHVGUqroVg9qjrT7Jw=; b=gt2Vmvg/boNoBeBH9SiFssil1wPIC4CxxS9p7fgLhLQWoDorkrXlWAIbh14eFRYZG+ DFCysT+TK1rvCQ03WSgmsZE+pzppltWxhhhdhBalMyIkLqBeB04qHH58ZnbGXP8KmpIG E9nnHJuwXcDjkqLMI0jie9v/J4LDfK/WGlVhA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772269; x=1715377069; 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=L0iO3yAQ8KkSt7Wokb68l77QkaHVGUqroVg9qjrT7Jw=; b=KZbs5nn19BYOaguuE58YnY7nDCCEE2v9csFfGtzEgcO7TiTOvSI8utbhdMP/f0/PvP rmsRd4UbLrNgQdWcqfzRKkY6yeTUN3g5YU+NocBIXB4C68BCH7z9moXDt6FGJIBZPWxn R9PPDsejoWL0DQMiXsWHFFCeutVjdHzbunoL/9Lu9p5x0EoAe/l/gWrJPaYrMiPKMrQi wuCsu8WxRFVleeoUnUSPXgfWE+JIaItNaP2VQdRFk9vJ3r3nV1jlsC5tGuLDefyYaP6c N97l7UolKl157nYpltLpaITa1aqLvUgy+/iYnaN3aHVtoIIaXXQwfye41Cy+Hi2bsNkb SuRg== X-Forwarded-Encrypted: i=1; AJvYcCXwzGrBzQfO+VkjWflqoZXHeUqMwGuL/9TxfXBAO3tUQkdq/JcZMXglxtYKtB9160Yi41nh6yqrqzSsGfjD0UHYrg/NI4Xq2F5MIDLO X-Gm-Message-State: AOJu0YyByF303DcA3odYJNkB+8dvLLq8RgOrKKZJjCqBZv/gUeOQCI8y USslaN3yACMrZRr+h4DdW+Ptl1hnu7wAEdIJzKuffDRyppJ7j/CKJjExF8N68w== X-Google-Smtp-Source: AGHT+IEJXRtPeQGcDuRFCN51uInhuJn+mY1i1wPYgk00iOIMC5r7aJDHEYH9EmcUpqfMP7eJW7lrPw== X-Received: by 2002:a17:902:7797:b0:1e3:e39a:2e49 with SMTP id o23-20020a170902779700b001e3e39a2e49mr3858363pll.18.1714772269071; Fri, 03 May 2024 14:37:49 -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.37.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:37:48 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , Marco Franchi , Fabio Estevam , Laurentiu Palcu , Pengutronix Kernel Team , imx@lists.linux.dev, Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 36/48] drm/panel: seiko-43wvf1g: Stop tracking prepared/enabled Date: Fri, 3 May 2024 14:33:17 -0700 Message-ID: <20240503143327.RFT.v2.36.Idda91d310ca2e4f5a4ab4ca6eaf1afdaf14eeb51@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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. Cc: Marco Franchi Cc: Fabio Estevam Cc: Laurentiu Palcu Cc: Pengutronix Kernel Team Cc: imx@lists.linux.dev Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. drivers/gpu/drm/panel/panel-seiko-43wvf1g.c | 40 --------------------- 1 file changed, 40 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c b/drivers/gpu/drm/= panel/panel-seiko-43wvf1g.c index 658c7c040570..98480904126c 100644 --- a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c +++ b/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c @@ -44,8 +44,6 @@ struct seiko_panel_desc { =20 struct seiko_panel { struct drm_panel base; - bool prepared; - bool enabled; const struct seiko_panel_desc *desc; struct regulator *dvdd; struct regulator *avdd; @@ -122,25 +120,10 @@ static int seiko_panel_get_fixed_modes(struct seiko_p= anel *panel, return num; } =20 -static int seiko_panel_disable(struct drm_panel *panel) -{ - struct seiko_panel *p =3D to_seiko_panel(panel); - - if (!p->enabled) - return 0; - - p->enabled =3D false; - - return 0; -} - static int seiko_panel_unprepare(struct drm_panel *panel) { struct seiko_panel *p =3D to_seiko_panel(panel); =20 - if (!p->prepared) - return 0; - gpiod_set_value_cansleep(p->enable_gpio, 0); =20 regulator_disable(p->avdd); @@ -150,8 +133,6 @@ static int seiko_panel_unprepare(struct drm_panel *pane= l) =20 regulator_disable(p->dvdd); =20 - p->prepared =3D false; - return 0; } =20 @@ -160,9 +141,6 @@ static int seiko_panel_prepare(struct drm_panel *panel) struct seiko_panel *p =3D to_seiko_panel(panel); int err; =20 - if (p->prepared) - return 0; - err =3D regulator_enable(p->dvdd); if (err < 0) { dev_err(panel->dev, "failed to enable dvdd: %d\n", err); @@ -180,8 +158,6 @@ static int seiko_panel_prepare(struct drm_panel *panel) =20 gpiod_set_value_cansleep(p->enable_gpio, 1); =20 - p->prepared =3D true; - return 0; =20 disable_dvdd: @@ -189,18 +165,6 @@ static int seiko_panel_prepare(struct drm_panel *panel) return err; } =20 -static int seiko_panel_enable(struct drm_panel *panel) -{ - struct seiko_panel *p =3D to_seiko_panel(panel); - - if (p->enabled) - return 0; - - p->enabled =3D true; - - return 0; -} - static int seiko_panel_get_modes(struct drm_panel *panel, struct drm_connector *connector) { @@ -228,10 +192,8 @@ static int seiko_panel_get_timings(struct drm_panel *p= anel, } =20 static const struct drm_panel_funcs seiko_panel_funcs =3D { - .disable =3D seiko_panel_disable, .unprepare =3D seiko_panel_unprepare, .prepare =3D seiko_panel_prepare, - .enable =3D seiko_panel_enable, .get_modes =3D seiko_panel_get_modes, .get_timings =3D seiko_panel_get_timings, }; @@ -246,8 +208,6 @@ static int seiko_panel_probe(struct device *dev, if (!panel) return -ENOMEM; =20 - panel->enabled =3D false; - panel->prepared =3D false; panel->desc =3D desc; =20 panel->dvdd =3D devm_regulator_get(dev, "dvdd"); --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:17 2024 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8E684135A66 for ; Fri, 3 May 2024 21:37:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772273; cv=none; b=iSNqaQRhPTKtwTco/02gOK0UPxgpV9IN/CpBEM7YbjPHDRgMlusNw+nPDfXn98uqFIMIbLEPGChRPoefUaLPZ/SSYDJfZhpZZzgJPPtUvOFWcDKGJfOXmYgXyZ2uZ0dVSdwI+K/N/RnwPUzqLTagfCxDqd7pi1S8T1kznkP24Bw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772273; c=relaxed/simple; bh=Ag630NMyOKc2REE64wl78IRaThiGetixkU0G1oxt3RY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ntR1PlVNQ7Er9uJderY84VSSFMKO3gcLU8YfIGOl/X+9zzmIZM4Hqu+P+128l0Xi+f7/Gz+7IfRWApcA3p1jaybEMkXlNxhpY0cjlnTrLbCFakxYVIfq6huR2a938FmKqYbc8s9tTNe2bhl/tP+MtleXGa0Z3zEx4Vbvr1khwEM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=fQfOx7fR; arc=none smtp.client-ip=209.85.214.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="fQfOx7fR" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-1ec5387aed9so1022185ad.3 for ; Fri, 03 May 2024 14:37:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772271; x=1715377071; darn=vger.kernel.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=rL+8TR+FVEOGHEmIclktS5Eo1OM2fp+pjfqU2SfLZsA=; b=fQfOx7fRQtlyYf2h1dOclH0+NCJy7FYl9MR3PJmxd7WBI0HvgudnXUtauABCd37p3K ThBeQUSbBNMKrz/54zWvNMHndEZmD6HbvzmFjpM79XladC6pYE3PdBzr+qEwZ5OH75id 3pYIAySvTKvsXm2CL1GalzHVecPxbkWaieyIY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772271; x=1715377071; 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=rL+8TR+FVEOGHEmIclktS5Eo1OM2fp+pjfqU2SfLZsA=; b=RyXgEAwNdJcagkeN8+DiwD9p5NhR2B0Ix5QgoBBgmcUZI/mcJarTbnKfXIwrg09LKh SvTLPP+Gc8TNATAZMNaJTEtGUcEiygss9lnBxa0zhMjscTIUCaGVEWc93kfwXp98OK7X sPw6KCb1OkwUeiHiRQsxA22CprBXxj1Jx44cFzsq6M+Dig85K7Be9WcVCr5u961Fr2xK u6Gr67jBp0BySiRCGXhZyZ0zudIwWIiPSogAXzYC0Nj6A7oOimBGaVH+LrwOwyTHkujF Q3O+xxyvQNBoD/E0HvUH80//GkWnBLMmRbGRjCuu1VbuZYHRUxWil29NZaB5at5wQUCd zmxg== X-Forwarded-Encrypted: i=1; AJvYcCXIvlr3rMauJVCW81jSdIhU+900D+pITUq7cH5bvbP8sz7TA0tiea3r5wy0LoWgL/jgHk5N4/uhs2GfpKshiIg9zQ8/JPHVvpJ+DRbL X-Gm-Message-State: AOJu0Yx1uPEBu8SNjQEhTv6KBtQNA0ePrML0qho3aK7e3SG/017pl4to iZnFX2uJRLVK1YfrgQNzuXMO1cpt+wfqMwPkhGdzqHV467LMyK099CaaQupqVmAyh0koiyLGkYg 1aQ== X-Google-Smtp-Source: AGHT+IGqOILtOMpTQpdNPww4A4HTkoN+afOAFJGfdSt9UtYlGc1IDjYPsnnRSAg9cfQkss7IrOZqZQ== X-Received: by 2002:a17:902:b495:b0:1ea:f7d4:cf2b with SMTP id y21-20020a170902b49500b001eaf7d4cf2bmr3601945plr.17.1714772271011; Fri, 03 May 2024 14:37:51 -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.37.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:37:50 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , Marco Franchi , Fabio Estevam , Laurentiu Palcu , Pengutronix Kernel Team , imx@lists.linux.dev, Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 37/48] drm/panel: seiko-43wvf1g: Don't call disable at shutdown/remove Date: Fri, 3 May 2024 14:33:18 -0700 Message-ID: <20240503143327.RFT.v2.37.Ief712fb6720cb98bdf9ec8644362d028b6554f9b@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 IMX boards. As far as I can tell, all IMX boards are now 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: Marco Franchi Cc: Fabio Estevam Cc: Laurentiu Palcu Cc: Pengutronix Kernel Team Cc: imx@lists.linux.dev Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. drivers/gpu/drm/panel/panel-seiko-43wvf1g.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c b/drivers/gpu/drm/= panel/panel-seiko-43wvf1g.c index 98480904126c..8a3fe531c641 100644 --- a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c +++ b/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c @@ -243,14 +243,6 @@ static void seiko_panel_remove(struct platform_device = *pdev) struct seiko_panel *panel =3D platform_get_drvdata(pdev); =20 drm_panel_remove(&panel->base); - drm_panel_disable(&panel->base); -} - -static void seiko_panel_shutdown(struct platform_device *pdev) -{ - struct seiko_panel *panel =3D platform_get_drvdata(pdev); - - drm_panel_disable(&panel->base); } =20 static const struct display_timing seiko_43wvf1g_timing =3D { @@ -306,7 +298,6 @@ static struct platform_driver seiko_panel_platform_driv= er =3D { }, .probe =3D seiko_panel_platform_probe, .remove_new =3D seiko_panel_remove, - .shutdown =3D seiko_panel_shutdown, }; module_platform_driver(seiko_panel_platform_driver); =20 --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:17 2024 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 92BAE135A69 for ; Fri, 3 May 2024 21:37:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772275; cv=none; b=XUUQFP9HUYfNMvLfRrxvi+aU3UgDTB4rQ5FuV7EKteD1GNXGwPVtOeok//wbr5LA+zG0yI3JYupa89MSOqXY5DOXHs84BWlnCF10o1tOKJYhrfHhFD4Ug1sQRMq1QPZ97IQji9Bu/qfiKHfwimZNdtv32HUfsh/T8bpD4RjQZDw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772275; c=relaxed/simple; bh=rH2R2AgAIrcdVtcKMrwr+cwucTsYW77aotJ+kwwjhJs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=vCIRyxAmHooLD751dZ0E7+jPvsCE9njIwEH8sKiZEoF/brQu1espf8tVgprwT3iEl8VvFDupDCwmrgRP/safB/hKHOL2mpslijmUsCoiQfUinNZHIOo0wSG8rn+2DOnmbgCwKcBusKc7UShfKFvHr7w/PxZGWzNcWdoYQNyGt8A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=c4feMluk; arc=none smtp.client-ip=209.85.214.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="c4feMluk" Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1ec5387aed9so1022435ad.3 for ; Fri, 03 May 2024 14:37:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772273; x=1715377073; darn=vger.kernel.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=ltVsqzMHcXWQrzEkIaopepMP6yzxK8+ru/cwzj6Xja4=; b=c4feMlukqgKAMtKstiJVZ9HCucjwDx/YUBZr0Fu39/bmvrkQgrtzbXbeUPow5Y2645 9KU3x9bpkzaxBFd1OGoTxiiiN8/irzH3s4wlwnf5BAwux62inr2kn9aYB3dKZ8Jx3vAS p0FtxS1H8QJEwmMl/xf6r3c/u7EanApNCtavo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772273; x=1715377073; 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=ltVsqzMHcXWQrzEkIaopepMP6yzxK8+ru/cwzj6Xja4=; b=LGyvod/66DQ1wOhbOrgvC2VsXnb6E/ViANiVPT9Gdu0X62NEmQSCfQY7tTgLFR46E6 sKy6b+gT8RwtSxFnWkfFg8CwEL8uqv1CbGaj2NLWQ7TG0zKG9a6S9ik1eM3GN1xDFh9E f3DpYAchngklcXgxvbYx6LOG8JkInEhYIQURjdG5aQJXuJ3j7AM8FROofWcrWyYgCUb1 mw4hKcjW0a8NTPezkQahX/A7g5A0ixxmGCjCo8txp9YzeaZOQEy1yWS4GdpolFlB3Nk3 jya1D0CnS8g82aazyanAGldXUsl8Lb+ETEW3HDybhlrmm8dh84UmeohsnCqV195vcyk8 FOHg== X-Forwarded-Encrypted: i=1; AJvYcCUvF2eM5oQfTmnEFbWALJ7HMXlztT38Ee6JB5PJrDKqgVhdC7j2ThcVK17JW1zan+Q70uwHP+Kwto3lSVsEkvxxG50gIIiLTEY/W9AF X-Gm-Message-State: AOJu0Yw1o+lQtEl399PU5yORsHnlBpOK8rBQ2Bx+c8B+GmBWTCYu5uTK JUlC9Lybz8AHllt3Ub7exJd/g92JL9zeoGjlP29VRgRpoZoDNwoQJHPGgyhA0A== X-Google-Smtp-Source: AGHT+IGYZcCvztVAnqAetSOocHorxHkEiQPDfYYRF0RW3qXwcDIlheeCC9kdMyrxGDD9aFGgBa5DWQ== X-Received: by 2002:a17:903:1111:b0:1e5:3684:617e with SMTP id n17-20020a170903111100b001e53684617emr4153719plh.52.1714772272986; Fri, 03 May 2024 14:37:52 -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.37.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:37:52 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , Thierry Reding , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 38/48] drm/panel: sharp-lq101r1sx01: Stop tracking prepared/enabled Date: Fri, 3 May 2024 14:33:19 -0700 Message-ID: <20240503143327.RFT.v2.38.Ifd6b12b8a4bca7d492e892ea7455e83f5c0ab5a8@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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. Cc: Thierry Reding Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. .../gpu/drm/panel/panel-sharp-lq101r1sx01.c | 39 ------------------- 1 file changed, 39 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c b/drivers/gpu/= drm/panel/panel-sharp-lq101r1sx01.c index 14851408a5e1..8f6c21b99522 100644 --- a/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c +++ b/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c @@ -24,9 +24,6 @@ struct sharp_panel { =20 struct regulator *supply; =20 - bool prepared; - bool enabled; - const struct drm_display_mode *mode; }; =20 @@ -85,26 +82,11 @@ static __maybe_unused int sharp_panel_read(struct sharp= _panel *sharp, return err; } =20 -static int sharp_panel_disable(struct drm_panel *panel) -{ - struct sharp_panel *sharp =3D to_sharp_panel(panel); - - if (!sharp->enabled) - return 0; - - sharp->enabled =3D false; - - return 0; -} - static int sharp_panel_unprepare(struct drm_panel *panel) { struct sharp_panel *sharp =3D to_sharp_panel(panel); int err; =20 - if (!sharp->prepared) - return 0; - sharp_wait_frames(sharp, 4); =20 err =3D mipi_dsi_dcs_set_display_off(sharp->link1); @@ -119,8 +101,6 @@ static int sharp_panel_unprepare(struct drm_panel *pane= l) =20 regulator_disable(sharp->supply); =20 - sharp->prepared =3D false; - return 0; } =20 @@ -164,9 +144,6 @@ static int sharp_panel_prepare(struct drm_panel *panel) u8 format =3D MIPI_DCS_PIXEL_FMT_24BIT; int err; =20 - if (sharp->prepared) - return 0; - err =3D regulator_enable(sharp->supply); if (err < 0) return err; @@ -235,8 +212,6 @@ static int sharp_panel_prepare(struct drm_panel *panel) goto poweroff; } =20 - sharp->prepared =3D true; - /* wait for 6 frames before continuing */ sharp_wait_frames(sharp, 6); =20 @@ -247,18 +222,6 @@ static int sharp_panel_prepare(struct drm_panel *panel) return err; } =20 -static int sharp_panel_enable(struct drm_panel *panel) -{ - struct sharp_panel *sharp =3D to_sharp_panel(panel); - - if (sharp->enabled) - return 0; - - sharp->enabled =3D true; - - return 0; -} - static const struct drm_display_mode default_mode =3D { .clock =3D 278000, .hdisplay =3D 2560, @@ -295,10 +258,8 @@ static int sharp_panel_get_modes(struct drm_panel *pan= el, } =20 static const struct drm_panel_funcs sharp_panel_funcs =3D { - .disable =3D sharp_panel_disable, .unprepare =3D sharp_panel_unprepare, .prepare =3D sharp_panel_prepare, - .enable =3D sharp_panel_enable, .get_modes =3D sharp_panel_get_modes, }; =20 --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:17 2024 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A08DC136671 for ; Fri, 3 May 2024 21:37:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772277; cv=none; b=oM+ON59geGhVuSeWXCDNLV5yubRT7/0y46+7T2FWbKS1Hk8rEWMRbgrFUddv4st8gnuvq1/g+rNzLOvqIa9FGF58R61WJTaL5q8OeAORJyKXTZ3X1/RvEAEzPaIfDgwkb8uyOBCIns2K6j9SI4BLSKclf2zzdRiwzbdrJ+ORQR4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772277; c=relaxed/simple; bh=NyKOElo7sVYzjTbWVk81v0plZbxckd0wXadRZmZkbOY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=shpNqBLbuu27A2MKw3i8jceDeA8nl/E0V9nGbQwUTAUV6tqdUyZkemhriQHBHxOOpAqY7Evu4J/4WTF1CWhYoBDIZDziREMJI8mcd3TNtkdDHFWn+SNpjqV78t4RGC1B44e8+cKKI2rCRgbGp4jDtLSExqePs9yJ+h5QAqC1Ta4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=Wku1IRIK; arc=none smtp.client-ip=209.85.214.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Wku1IRIK" Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-1e86d56b3bcso1257475ad.1 for ; Fri, 03 May 2024 14:37:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772275; x=1715377075; darn=vger.kernel.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=IZ2bcwxBHMvzwpRFsoGmIetgpC7SnvJGS8R4x5ACAaI=; b=Wku1IRIKWvAzNsEGU5VjgyQYnJQZvScHU+9b7inR3utV+f0C5yBLe0Zzz4UBDrd22o smBSoWe56WyQh0Mk0tVUo0bGLbeIe4TgGelu6TzF7rP2VXTLd3sEaBW1uo7TlKX7GoJJ A5Azm7aHg9oZUpng1ftBQk3cJf37g+vB5W/Y4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772275; x=1715377075; 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=IZ2bcwxBHMvzwpRFsoGmIetgpC7SnvJGS8R4x5ACAaI=; b=HyamWEQimYHTmT1v0Mg3SOcb2+M3VOUQCF9bEOmMoxTwkuM0gJGi0fLSQquqzEroL7 /5YnSgiJQG3Q/k7UU27e7AcVCn4zGm0BdAXwAhcqndGBUElhEScOlDQsvaCGaViwBziX D9BHhAvX6zMEU0dmPQ97dE76IBYWsZnxqK5AghbghAPLt4PJIl0SWl5BytxJ1oPX56f5 ehbxW5/FGMYtYFxAYYc5Kjn6ASsuVl847vxs1ZNHE2one4iyzlw8LKWwZyC4QGrjR/FN PQBBuNWcmdEJBvih/0GhwUIFemFs5TXjsUrdqRGN/uHnjDgywWzK+iwmxa+qiB6QdJDx XfoA== X-Forwarded-Encrypted: i=1; AJvYcCU+HjNvx0lq/yskkYI1Jn2rlqEwa5XosYE2xj4/qdKH5SY11eMUlfHCJxTjOlR4yglw8HA42ibq1azLZk/aoCPIMZC/HLtUD811KD8G X-Gm-Message-State: AOJu0Yy2X3tQXQZPn4dzvfJAsBp+DLIanY8VBG1hKOcSC7Trx1Wjk+mx vDSJUhzG51mN7IxvlOFjc/vvLgYreoIM9iq0OnlK8C8yAlj7we5Emq3MD0EdaQ== X-Google-Smtp-Source: AGHT+IF4B6Nfr3ZtrpYHNA9pejG1rE3AiUgc8H89qrn9KVvMkhOXg6EYM81DsPyLvBFCo2ge0DZf3A== X-Received: by 2002:a17:903:2306:b0:1eb:1af8:309f with SMTP id d6-20020a170903230600b001eb1af8309fmr5575949plh.4.1714772274987; Fri, 03 May 2024 14:37:54 -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.37.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:37:54 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , Thierry Reding , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 39/48] drm/panel: sharp-lq101r1sx01: Don't call disable at shutdown/remove Date: Fri, 3 May 2024 14:33:20 -0700 Message-ID: <20240503143327.RFT.v2.39.I6a87fce1ee027c96f71c7adf74248b865f50b336@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Tegra boards. The Tegra driver appears 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: Thierry Reding Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. .../gpu/drm/panel/panel-sharp-lq101r1sx01.c | 24 ++----------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c b/drivers/gpu/= drm/panel/panel-sharp-lq101r1sx01.c index 8f6c21b99522..edc9425bb143 100644 --- a/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c +++ b/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c @@ -357,32 +357,13 @@ static void sharp_panel_remove(struct mipi_dsi_device= *dsi) struct sharp_panel *sharp =3D mipi_dsi_get_drvdata(dsi); int err; =20 - /* only detach from host for the DSI-LINK2 interface */ - if (!sharp) { - mipi_dsi_detach(dsi); - return; - } - - err =3D drm_panel_disable(&sharp->base); - if (err < 0) - dev_err(&dsi->dev, "failed to disable panel: %d\n", err); - err =3D mipi_dsi_detach(dsi); if (err < 0) dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err); =20 - sharp_panel_del(sharp); -} - -static void sharp_panel_shutdown(struct mipi_dsi_device *dsi) -{ - struct sharp_panel *sharp =3D mipi_dsi_get_drvdata(dsi); - - /* nothing to do for DSI-LINK2 */ + /* only detach from host for the DSI-LINK2 interface */ if (!sharp) - return; - - drm_panel_disable(&sharp->base); + sharp_panel_del(sharp); } =20 static struct mipi_dsi_driver sharp_panel_driver =3D { @@ -392,7 +373,6 @@ static struct mipi_dsi_driver sharp_panel_driver =3D { }, .probe =3D sharp_panel_probe, .remove =3D sharp_panel_remove, - .shutdown =3D sharp_panel_shutdown, }; module_mipi_dsi_driver(sharp_panel_driver); =20 --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:18 2024 Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 66446136992 for ; Fri, 3 May 2024 21:37:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772278; cv=none; b=sMotxhVOI57Dpib3mFehcSgClHdE2daiZ5yNTCjMAiXh/jl4JZKwLe+C+u+od1KWGVDCXry5OFgtIDuUPgBPjZKfqCoomJMjH1DPTsNjCSfbJx+5uFBUCfPvuho4bF+HCnkXfygvc6DkujHYoFNBZHjB6T7CycNMBNP+5klP1Nc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772278; c=relaxed/simple; bh=24YRgd+bMU8QhFuBpmcHLr3V7mmVueRyG88apmBnS24=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IAcg5JYl9j6tg4ZQ0DeCCZWlHg6scBe+K142JUA5svoKC24QEkd6/OPIKaj62WYBocIcmKnXxSG68nIcEx2mm9EDJ8nPqraEuq/o2zfm+FL/91beXjaVeny7NWYqTiiNpLoSWG4jVv1mdkLA4zeyOX2I8TlP7iDOXnCmNx3gBLA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=U/CazDPa; arc=none smtp.client-ip=209.85.214.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="U/CazDPa" Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-1ec5387aed9so1022795ad.3 for ; Fri, 03 May 2024 14:37:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772277; x=1715377077; darn=vger.kernel.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=cC/7w7cvbMIg1H0tLbovKCpsSruQDzBcns5w6WWFLNE=; b=U/CazDPaQqjv/OLLZUtlgtr5LeQiKcPrJi/Vrf19DgQkaLtx3GQqKUSyVpK/Sa6WXh jv+mVoi4Dw/KcdehTYvObj8EcyyjoWRFLmnZfjXy1MHbQAs6XtYwwayUbKzVZmGaMiSM 1Z0gUpuGp77H4fzjSNB2LKtobrlzZn+ortDVU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772277; x=1715377077; 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=cC/7w7cvbMIg1H0tLbovKCpsSruQDzBcns5w6WWFLNE=; b=O7DBSLnI/ohLDexSZ23Bq0kvUEAtTxTqfXYeLZ4q3NyhFabiA1iyHiCyUhUVn08B8C axHmbA76R2cUhsjsfVqyrMfJhnERHZcIJlJ+jtSLp0YFNXjhhIW0PFQENourFv/swlJU 09W434yfG7CzI5tHzaKLBFUgMOEUiHEfq1lzOR7xpYZ0cg95J/w54Mp1k1epZvh6r/EK YkZAz/g3MBcTlW3yt65+7bG/T5cNhBKxJbXPHUgNYLLzUpdwGMoT/cCzHhFl1XFof5Kc eTNFn7RoG/05KVkRWQVHc2CXeiiwqXsq5jwSNowfgtTsCCsNjE7DW6+qSPMR4j8h1IHd 8TEA== X-Forwarded-Encrypted: i=1; AJvYcCU2mSXiS9lj1Ggth0dejXgN2DiDxGamhODq8GlvLqAsjABUM31B9CEEIU7sKndI7jk0FdilFXBc2eZuQiMTg87h1lIpC3xSxEUQyTzD X-Gm-Message-State: AOJu0YxSIg+cp7JQl03430fmRLEncZCGzUBQAhb/wmLe3gXv9pKvjHfR boT6CnLtQNVUXwrTWYRMGGg3pkJ/pKnPj5VF73xhNH/Vzvp+RPFhWlLZKYzjH+lPiOeAHx2ISAD EnA== X-Google-Smtp-Source: AGHT+IG4SIdj15z6GG8hET0eYzMhdd/lRGVRHEH1MacWakPy0nnB+jvXlG5KXqoNJ3o0nqOGfLsZdA== X-Received: by 2002:a17:902:ecc2:b0:1e8:c993:a13c with SMTP id a2-20020a170902ecc200b001e8c993a13cmr4897231plh.25.1714772276873; Fri, 03 May 2024 14:37:56 -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.37.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:37:56 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , Werner Johansson , Dmitry Baryshkov , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 40/48] drm/panel: sharp-ls043t1le01: Stop tracking prepared Date: Fri, 3 May 2024 14:33:21 -0700 Message-ID: <20240503143327.RFT.v2.40.I56849dbe7c906f0cff076dc5286fd05c7e3e9c18@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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. Cc: Werner Johansson Cc: Dmitry Baryshkov Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c b/drivers/gpu/= drm/panel/panel-sharp-ls043t1le01.c index 855e64444daa..c86337954ad7 100644 --- a/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c +++ b/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c @@ -26,8 +26,6 @@ struct sharp_nt_panel { =20 struct regulator *supply; struct gpio_desc *reset_gpio; - - bool prepared; }; =20 static inline struct sharp_nt_panel *to_sharp_nt_panel(struct drm_panel *p= anel) @@ -99,9 +97,6 @@ static int sharp_nt_panel_unprepare(struct drm_panel *pan= el) struct sharp_nt_panel *sharp_nt =3D to_sharp_nt_panel(panel); int ret; =20 - if (!sharp_nt->prepared) - return 0; - ret =3D sharp_nt_panel_off(sharp_nt); if (ret < 0) { dev_err(panel->dev, "failed to set panel off: %d\n", ret); @@ -112,8 +107,6 @@ static int sharp_nt_panel_unprepare(struct drm_panel *p= anel) if (sharp_nt->reset_gpio) gpiod_set_value(sharp_nt->reset_gpio, 0); =20 - sharp_nt->prepared =3D false; - return 0; } =20 @@ -122,9 +115,6 @@ static int sharp_nt_panel_prepare(struct drm_panel *pan= el) struct sharp_nt_panel *sharp_nt =3D to_sharp_nt_panel(panel); int ret; =20 - if (sharp_nt->prepared) - return 0; - ret =3D regulator_enable(sharp_nt->supply); if (ret < 0) return ret; @@ -152,8 +142,6 @@ static int sharp_nt_panel_prepare(struct drm_panel *pan= el) goto poweroff; } =20 - sharp_nt->prepared =3D true; - return 0; =20 poweroff: --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:18 2024 Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 987481369AE for ; Fri, 3 May 2024 21:37:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772281; cv=none; b=l/z6rMONbMJBEoKxKQq8L8S8FICJeK5wSH/SXumQm0PGD+BwMAx68by0QYqrcEn/0nL934HZDoZWEpN13E4wKxIsThZrfbMNMymYxT/f5pZ3To7Q4RYZIrRjGx4vl2fD9uX3mnizZWPRghUI45bkIk0UwHfeeY5CNUT+LENy07I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772281; c=relaxed/simple; bh=0gjF3n43Y5wOexAtiOvGFTLJ9QIRsnvOFeO64QgZYsY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lXrSVpAItMq9ulZYW/3pxQjWdWjtyb8i3g5l6C1qLScWUihlcuz0TvuuSJif9uL7yfZTYzq0yxwpl4Edu/DsR7r+VlINRpSp+18SrlHHpAPtOPYLa24fGKx8j2K8p6Va41Y3h5nb0SC/QerKCesEuMaWff3OL373KKw/bhluUAw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=jqb2USmW; arc=none smtp.client-ip=209.85.214.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="jqb2USmW" Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-1ec5387aed9so1023035ad.3 for ; Fri, 03 May 2024 14:37:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772279; x=1715377079; darn=vger.kernel.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=/dXwPdbkXokcaTdukxLAHZJBTCR2jkjSjRsL5uHOD/8=; b=jqb2USmWu1MT7/Ts1XN17RIGNuQ8R72KFF2em3/PvbfSIOH6Hsz5T5N6dZtKF8Doav 1gOuNs0zM2HDxl/5hayme3kr5ILAQHWuYAio88E2SnU6B9QxhuNyFu+67kTxOKJwo9M/ OTqUey8IbtzPj/0An5Q9mUNYYly+PsJO9NgBU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772279; x=1715377079; 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=/dXwPdbkXokcaTdukxLAHZJBTCR2jkjSjRsL5uHOD/8=; b=Xoknzu5hdxXqdCpLWo86jJvo5/R95SPHODrrcxpKfBWO8Y/q6XN3cKUj8+PbLS5Iv4 vjMsPkFeQ5D0xh/xL5b1Zh2/J12HNsnL77r7GJUqkueofoKXy708g0OcANCkZ08K8nix qzzo32aMhOWEKl4rNLoaKeFYSfSgjrsG87u7i4OEubt9Znp7Mjk0qUOZP/Rnil87Y237 6oNuyiD7SLamcrzEyh+Oi8A2Y8QArgQE6q0fS1gRqYBkkNs6W/mg3D4+2wPNFCvHfAf4 JvV3dIRkq9gDhkNPB0O0c5ePYQbVIt1wVlZiDvyFqJA+H/LfVaDfud6a1T95bal1rs69 XNXA== X-Forwarded-Encrypted: i=1; AJvYcCXewbtKrKBzlsONqGH15Nk4Va1Td7NqU3jBtPY7nGng3EGIWP4WI6Wg+Qmc3z3ndfH4kx/cYWbU82cyHnIQTCR47kH36XXVah08ikBx X-Gm-Message-State: AOJu0YyJBlv6iAUK0n3cqqCnSbeT/fWRKiyZdtPf2FeIyTvSyHAc/3b7 X1//VButiE5WF7vhsN/QFVwMtML4SSzNITmgT/WhVKZQENNf+D/5cOndLlQKkA== X-Google-Smtp-Source: AGHT+IE/1VVEigXJzCYmydTc9NCW51n7kNBmzsc64scd/SOgSmiWWb87c07CAccSkm9G8TiEnbdUIA== X-Received: by 2002:a17:902:8f96:b0:1e2:6d57:c1bb with SMTP id z22-20020a1709028f9600b001e26d57c1bbmr3584215plo.21.1714772279072; Fri, 03 May 2024 14:37:59 -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.37.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:37:58 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , Werner Johansson , Dmitry Baryshkov , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 41/48] drm/panel: sharp-ls043t1le01: Don't call disable at shutdown/remove Date: Fri, 3 May 2024 14:33:22 -0700 Message-ID: <20240503143327.RFT.v2.41.I89ee53f7fc2f0806cab318128e5fa927990d830f@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Qualcomm boards. The Qualcomm driver appears 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: Werner Johansson Cc: Dmitry Baryshkov Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c b/drivers/gpu/= drm/panel/panel-sharp-ls043t1le01.c index c86337954ad7..729cbb0d8403 100644 --- a/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c +++ b/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c @@ -267,10 +267,6 @@ static void sharp_nt_panel_remove(struct mipi_dsi_devi= ce *dsi) struct sharp_nt_panel *sharp_nt =3D mipi_dsi_get_drvdata(dsi); int ret; =20 - ret =3D drm_panel_disable(&sharp_nt->base); - if (ret < 0) - dev_err(&dsi->dev, "failed to disable panel: %d\n", ret); - ret =3D mipi_dsi_detach(dsi); if (ret < 0) dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", ret); @@ -278,13 +274,6 @@ static void sharp_nt_panel_remove(struct mipi_dsi_devi= ce *dsi) sharp_nt_panel_del(sharp_nt); } =20 -static void sharp_nt_panel_shutdown(struct mipi_dsi_device *dsi) -{ - struct sharp_nt_panel *sharp_nt =3D mipi_dsi_get_drvdata(dsi); - - drm_panel_disable(&sharp_nt->base); -} - static const struct of_device_id sharp_nt_of_match[] =3D { { .compatible =3D "sharp,ls043t1le01-qhd", }, { } @@ -298,7 +287,6 @@ static struct mipi_dsi_driver sharp_nt_panel_driver =3D= { }, .probe =3D sharp_nt_panel_probe, .remove =3D sharp_nt_panel_remove, - .shutdown =3D sharp_nt_panel_shutdown, }; module_mipi_dsi_driver(sharp_nt_panel_driver); =20 --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:18 2024 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CEB56136E11 for ; Fri, 3 May 2024 21:38:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772283; cv=none; b=CKHCKyuSMgjl/Zbn5Uf2NgFiFiyz7NqORTJ4MTENfQftfSqGIWvWUqreWu4i3YJAhTbVh/jQnzHPq1rdUNbm/02Y5/rxfGJzCxAME+Ujua0qGSAO8FCQjHXFVU1d3dR1AxCY1Iu7BKK1HXe3CT9yt7ln4Woi75c919yUMrCTaV4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772283; c=relaxed/simple; bh=p2r3mEXPVq4U9AmL2VfNexuyR3rhW1JY39L1T4gDQwA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=JldSM3EVCSRtJX3Ut1nArGpskvefMPpvQJLttlSVueXzYvRM34EeWeuF92EQikhFJ7iVWiI4dfSgXrjiB66J3H877MdZhLDjr/jrDumL34KRUQbA99oRL1OT5BgdJSe30zaWWtynD5AuONCBcnIt7nfpMyU8rJrJXXRXRKMaODY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=Wt7wtQzG; arc=none smtp.client-ip=209.85.214.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Wt7wtQzG" Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-1ec69e3dbe5so1229475ad.0 for ; Fri, 03 May 2024 14:38:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772281; x=1715377081; darn=vger.kernel.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=LOvFNgXxe6qEzRRoKPzkEzJ39gwB1A9FbXbUkRknuEw=; b=Wt7wtQzGDvK67/PxUMmf/aMBIQ7IgpIhA6djyCoAobXGV+Ak9nDiFRq0AjmDEeLmdC jpPe5BbLVFohJsmQbk7onue2NepTLTUrRbYi7e/N3BDxum7Fp4ZkNmmkp/4SooYaaOKB o55k3e978ZlgYwovqEitAzWuRiUeCUEFlGxdY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772281; x=1715377081; 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=LOvFNgXxe6qEzRRoKPzkEzJ39gwB1A9FbXbUkRknuEw=; b=XmCpqOdItBdwxt72BIjUS0yU25e00vfJ18kZsIBeuOW+VkuHSyWK8KdCvFE6PtNLuD ErBbbxf0UaafKCIZ+ZTYs+f3DelYWbYZge83Ds8vYJmA7HCPim+ImvQVOUr++Vzz6adN R7rEXZ+Vpdv/JXo112tCVPC6f/hWc2ktccCjcJ8YKDCU8vclaqZzGTL4DD8FFEP4Jqph jdWMEYGlYXw5HSP9BHFIyVUOWUXhf9SMQwZGDs6tScDBDyitScvvvkSmZJ1IMPzL334y DPogMTkxDK1nag8wJ8FwmCWfAmEjlYAmWt97S65WWjOFhaNO+Rtin9BUScyL+8jIkvPk P9mQ== X-Forwarded-Encrypted: i=1; AJvYcCVKWD2ZvJiXI/B0Znf0Z37q92EGflRlysUcQyLjfkKtic6dECxfIgLEHMFTJZuZZVjbmhljOTxQF6zrsdCMtuYUsPau3XlJ5wz4zw0y X-Gm-Message-State: AOJu0YyTk2eL6GSoCxQVDvq9DtZu+aZuJK4Jr4qHsagC4kbKqlEKfBkH CH+ca/YKcZKNRpIwb2CJVFBKCXGNErxTtp60/A9t/hixTMySBhU8wuZr8FwvRA== X-Google-Smtp-Source: AGHT+IHrBPFGeCVyz9PhiRgLD7O2XHD+TE0AOUrKe6M9eH4/MHjdlKw55SmMJ/LL6GSiVhzwWHgbFw== X-Received: by 2002:a17:902:f70b:b0:1ec:ad62:fe87 with SMTP id h11-20020a170902f70b00b001ecad62fe87mr4441606plo.56.1714772281144; Fri, 03 May 2024 14:38:01 -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.37.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:38:00 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , =?UTF-8?q?Guido=20G=C3=BCnther?= , =?UTF-8?q?Ond=C5=99ej=20Jirman?= , Frank Oltmanns , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Purism Kernel Team , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 42/48] drm/panel: sitronix-st7703: Stop tracking prepared Date: Fri, 3 May 2024 14:33:23 -0700 Message-ID: <20240503143327.RFT.v2.42.Ifc436b262d72f1a33ddef10adfd7578d4acb60d8@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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. One thing to note for st7703 is that it has a special "allpixelson" debugfs file. When this file is written the driver hacks a disable/unprepare and then a prepare/enable to try to reset the panel. Potentially that might have been relying on the old booleans we removed. It'll still "work" because of the checks in the core but it deserves a comment. This debugfs file didn't appear to be particularly safe to use even before this patch since it would cause a disabled/unprepared panel to become prepared/enabled. Cc: "Guido G=C3=BCnther" Cc: "Ond=C5=99ej Jirman" Cc: Chris Morgan Cc: Frank Oltmanns Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard --- Changes in v2: - Split removal of prepared/enabled from handling of remove/shutdown. drivers/gpu/drm/panel/panel-sitronix-st7703.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c b/drivers/gpu/dr= m/panel/panel-sitronix-st7703.c index 7d8302cca091..6b2d940640ca 100644 --- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c +++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c @@ -58,7 +58,6 @@ struct st7703 { struct gpio_desc *reset_gpio; struct regulator *vcc; struct regulator *iovcc; - bool prepared; =20 struct dentry *debugfs; const struct st7703_panel_desc *desc; @@ -752,13 +751,9 @@ static int st7703_unprepare(struct drm_panel *panel) { struct st7703 *ctx =3D panel_to_st7703(panel); =20 - if (!ctx->prepared) - return 0; - gpiod_set_value_cansleep(ctx->reset_gpio, 1); regulator_disable(ctx->iovcc); regulator_disable(ctx->vcc); - ctx->prepared =3D false; =20 return 0; } @@ -768,9 +763,6 @@ static int st7703_prepare(struct drm_panel *panel) struct st7703 *ctx =3D panel_to_st7703(panel); int ret; =20 - if (ctx->prepared) - return 0; - dev_dbg(ctx->dev, "Resetting the panel\n"); gpiod_set_value_cansleep(ctx->reset_gpio, 1); =20 @@ -793,8 +785,6 @@ static int st7703_prepare(struct drm_panel *panel) gpiod_set_value_cansleep(ctx->reset_gpio, 0); usleep_range(15000, 20000); =20 - ctx->prepared =3D true; - return 0; } =20 @@ -854,7 +844,13 @@ static int allpixelson_set(void *data, u64 val) dev_dbg(ctx->dev, "Setting all pixels on\n"); mipi_dsi_generic_write_seq(dsi, ST7703_CMD_ALL_PIXEL_ON); msleep(val * 1000); - /* Reset the panel to get video back */ + + /* + * Reset the panel to get video back. NOTE: This isn't a + * particularly safe thing to do in general because it assumes + * that the screen was on to begin with, but this is just a + * debugfs file so it's not a huge deal. + */ drm_panel_disable(&ctx->panel); drm_panel_unprepare(&ctx->panel); drm_panel_prepare(&ctx->panel); --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:18 2024 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 020965B1E9 for ; Fri, 3 May 2024 21:38:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772285; cv=none; b=UOkCO8zH+dktNYmrlVlswpFf5LZD897XuEOHBW3HFZ8LaNut4FYGffQWyBsZY1YqQwAY92GgTnBD5F5kzrfzXCSYdSr2YdZckJGcAGoJhxHdtOgu7rraWT1tNOwPzNrslHiX/betmqiiKrtkwIZILplAT5Vl3Qt3wIlWAM1/F2k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772285; c=relaxed/simple; bh=kJpO3gyrfbbb9Uz3lEEMOXm5oGJ96WuhGuKz+E1GyzE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=s4c6CtA0vX1s7XnyTZMoCGMpeg8uHtU+RhGLVF+mQztVMKxdoEIvCDa3tCWHHyXuWp40BRodj/FdchyMHVZuexKbWYXZM8fHNTXde/aqSMq3W5PUr3/2mn80Ul4CP4yseCMDiXYaOYhfQncPv20K75XKyiJS9F2dvOrFYMsAvUQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=gcjQYI8w; arc=none smtp.client-ip=209.85.214.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="gcjQYI8w" Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1ed41eb3382so1033785ad.0 for ; Fri, 03 May 2024 14:38:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772283; x=1715377083; darn=vger.kernel.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=2Avvw3HtD9t825/57o/WJV3t+qgm+MjAo1zab7qfrAw=; b=gcjQYI8wgbln7HionxbuDf/OmIDoXbZd5pmcCoAUHja4XSWWqwLhIkH9qv6bU7l93F yrGIaSkT1aIT8fv2/EtD9O1aJOgsUWMf/yihhT6T9fZKV6fzD8+wbhBly4pKx3Acv4lP nXB2fwopQRSnSH8yR5P3D6rIMJVndDhyayUGw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772283; x=1715377083; 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=2Avvw3HtD9t825/57o/WJV3t+qgm+MjAo1zab7qfrAw=; b=u8PJfZ9Swb6ao5gBNxl0r+4Zbd4kNvlRwkthOhoINDJgdXPvOQVMi5U/FcxoW84OA1 lIdLbSUxQ/oqs9yBo2kc5hcYIAhYJz5bIoiOaaXV3msTDbNnO8kCFVIV2Rtm1WsZe4DF e2ecJTl9IUJOMU4JaPvmQeSMJZ0ejNp9A65yLyhV9QHLU3ZfqS4GiakYuRUcqEw7qgIP kSNqRDjYGEyz/+2B3p9i2sxCgfOAFpAY5UeMu1YjAdr94UHlIbwlTT+aDSFzeYvEWt4U 5ErA9ZvQpuRJcILj6SBMR2f0VEWOGTroCcrNeUUz+dJVJA2OSEbRoNS96WAj81hdhxm5 /GVg== X-Forwarded-Encrypted: i=1; AJvYcCVLUo8w0bXgK1gguG9hO74S+rHTSEmPertc7HHDLRLzkPo4hYepZXi+0p1UFGpH5B7Ml3GaszOl0ryR1trCwFEgi/TjTGKYlusGGq/M X-Gm-Message-State: AOJu0YzyRHhEIdPYEgF3tDUQYD4uoFF11/oRUem9TiZuQXc2SihFiD1X fahwWEbN24qsd4SEtAN0K5gjF+WrRSntSEauiFBdOnYQBhxukUZ+GQbuwo8vwg== X-Google-Smtp-Source: AGHT+IEu82XmRy0lY1T4aUx77LcpN+15wj25rF0IIbfio5kewqFsMtXS5VE3myBBns7XneJTh6xgPw== X-Received: by 2002:a17:902:b784:b0:1e5:a025:12f9 with SMTP id e4-20020a170902b78400b001e5a02512f9mr4001966pls.28.1714772283235; Fri, 03 May 2024 14:38:03 -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.38.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:38:02 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , =?UTF-8?q?Guido=20G=C3=BCnther?= , =?UTF-8?q?Ond=C5=99ej=20Jirman?= , Frank Oltmanns , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Purism Kernel Team , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 43/48] drm/panel: sitronix-st7703: Don't call disable at shutdown/remove Date: Fri, 3 May 2024 14:33:24 -0700 Message-ID: <20240503143327.RFT.v2.43.I08ba0d4e2d534c06ab0ede9c148bb14cc7c1a9d7@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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. The compatible strings used by this driver seem to show up across boards using a variety of DRM drivers. It appears that the relevant drivers have been converted, but at least one compatible string doesn't seem to be found in any mainline dts files so we can't be 100% sure. 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: "Guido G=C3=BCnther" Cc: "Ond=C5=99ej Jirman" Cc: Chris Morgan Cc: Frank Oltmanns Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard --- Changes in v2: - Split removal of prepared/enabled from handling of remove/shutdown. drivers/gpu/drm/panel/panel-sitronix-st7703.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c b/drivers/gpu/dr= m/panel/panel-sitronix-st7703.c index 6b2d940640ca..77b30e045a57 100644 --- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c +++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c @@ -937,27 +937,11 @@ static int st7703_probe(struct mipi_dsi_device *dsi) return 0; } =20 -static void st7703_shutdown(struct mipi_dsi_device *dsi) -{ - struct st7703 *ctx =3D mipi_dsi_get_drvdata(dsi); - int ret; - - ret =3D drm_panel_unprepare(&ctx->panel); - if (ret < 0) - dev_err(&dsi->dev, "Failed to unprepare panel: %d\n", ret); - - ret =3D drm_panel_disable(&ctx->panel); - if (ret < 0) - dev_err(&dsi->dev, "Failed to disable panel: %d\n", ret); -} - static void st7703_remove(struct mipi_dsi_device *dsi) { struct st7703 *ctx =3D mipi_dsi_get_drvdata(dsi); int ret; =20 - st7703_shutdown(dsi); - ret =3D mipi_dsi_detach(dsi); if (ret < 0) dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); @@ -981,7 +965,6 @@ MODULE_DEVICE_TABLE(of, st7703_of_match); static struct mipi_dsi_driver st7703_driver =3D { .probe =3D st7703_probe, .remove =3D st7703_remove, - .shutdown =3D st7703_shutdown, .driver =3D { .name =3D DRV_NAME, .of_match_table =3D st7703_of_match, --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:18 2024 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 43DC38564D for ; Fri, 3 May 2024 21:38:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772289; cv=none; b=gdhh6+TapsN4fXhxyyrtN4cKjM9lSeDTa/kNkrD2XWKhhocXlXMlEK6p23tNkMR9+q4wmUMz/QIS+y+yLM2Cst97K3hHgCLaek+ksDrc+9vtDW6FomuL4/yBN9BdfA43a3iM+nbdXJXkZC3khgbM/STie/8ywOsmSvyffYYRI6o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772289; c=relaxed/simple; bh=AqXmeERjnXg7zaGdjwwFP08nCPLkPR3oger7zvpxqFE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GqnUenIk4vjo1Xy9LGTwpXqqaNMmkxP4cHJVUIFAloqeJxbpmXg8Z7eDXzTerhIUo7UwG0JIBon7A+FeX7CiKZhuxXcKkibWY9kqgm8hYZ/PKmopYw1G3e55qLKd6nUn4cSc5OXEN6CppzEhGHW866vgE+g4OGhSe2L/QKYoccw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=Mo1fiC6o; arc=none smtp.client-ip=209.85.214.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Mo1fiC6o" Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-1e3f17c6491so786455ad.2 for ; Fri, 03 May 2024 14:38:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772288; x=1715377088; darn=vger.kernel.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=BIFkEzqD+TIhqStDpaYlErlu7+fCFfSMn8LHhnvMED8=; b=Mo1fiC6oiut9Ga3mRHDWeK+Y/XnxdxP2H8vyRLoEPCBLIHY2u2AWs5TO6oMYNOBBFz 79Dxlcf96v6UAyxQdoWZRDx6fxBdLNHgFA/E4EuZZ2R3c1uRNkzfCC+WEI3h7tmqvuJo 96aDL3E/ZcOqwjgImIt65a58hCEUEIrBGo/fs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772288; x=1715377088; 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=BIFkEzqD+TIhqStDpaYlErlu7+fCFfSMn8LHhnvMED8=; b=BQHTfeeihwHj/hHaCWb7eShQ4Rs2Zn3fmNnRAvM7XbeL9S4cKor3X2zUi7jZm5dA3H KWVeA6Qeu4vw60efRdVr0jxo5Cmho5RGi54KMPMR3j68OUuzahatcDFQwvZpswfEaN3o EfvKE2StpE4aIHSECMSDFELXBAHLYplGMvlNUTw3ix018f34hljF833BxDJEbR40R13H rm7fbfrc1gfa6nBnAuhQCGASnoNqk7FSRKOGaAXFGzYSnggPe/BK3CpvlzyZANIFBsuV h9mXtc6kHu+FAPIV5puR4hBKAfQqtSRxLgmWvSNnjv3wD8KNrS8AQC8aroH4n5HwZBh6 7iMA== X-Forwarded-Encrypted: i=1; AJvYcCXlt9BgLaCWvl1tLOQyGfwnxcfnrO4arhxq6jFHZsN1Yqj0v7EYi8FdYtGXZZgf+L+j3eE4StzCDc+vBFqnqu41k06nM3CTba5R3LxP X-Gm-Message-State: AOJu0Ywj+PHT+kzo+J1Z5JLaoU6ITYr9zSFviurDAxF7fGvlEHhLh9/E ubc/dj4H+1UiPMxAomP2KSYrh7ef1qy7QC+a1IAfWmPZ3Z8yYG2ywdKt/fLtiw== X-Google-Smtp-Source: AGHT+IEppDICkxPotojV6v+5Nxi2QTdXAAGWwbdKCVuRTx7nnbpoKjn0h1KLaB5gimMRVhmWkqxAGw== X-Received: by 2002:a17:902:e943:b0:1eb:7aeb:54f3 with SMTP id b3-20020a170902e94300b001eb7aeb54f3mr5417928pll.36.1714772287701; Fri, 03 May 2024 14:38:07 -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.38.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:38:07 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , Robert Chiras , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 44/48] drm/panel: raydium-rm67191: Stop tracking enabled Date: Fri, 3 May 2024 14:33:25 -0700 Message-ID: <20240503143327.RFT.v2.44.I20f82e9dd1597a14ae37a64c6b8275add60fbdb1@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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. The conversion of the rm67191 panel driver follows many of the other panel drivers but has a few differences that need to be called out. Like in commit 1e0465eb16a4 ("drm/panel: otm8009a: Don't double check prepared/enabled"), this panel also uses the "prepared" flag to prevent the backlight functions from running when the panel is powered off. This is probably not the safest thing to do but the old behavior was preserved. See the discussion in the otm8009a patch. Because of this, I've left the driver tracking "prepared" but removed its tracking of "enabled". NOTE: as part of this, transition the panel's direct calls to its disable/unprepare functions in shutdown to call through DRM panel. Cc: Robert Chiras Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard --- Changes in v2: - Split removal of prepared/enabled from handling of remove/shutdown. drivers/gpu/drm/panel/panel-raydium-rm67191.c | 21 ++----------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-raydium-rm67191.c b/drivers/gpu/dr= m/panel/panel-raydium-rm67191.c index dbb1ed4efbed..fa9bf89d3bb5 100644 --- a/drivers/gpu/drm/panel/panel-raydium-rm67191.c +++ b/drivers/gpu/drm/panel/panel-raydium-rm67191.c @@ -205,7 +205,6 @@ struct rad_panel { unsigned int num_supplies; =20 bool prepared; - bool enabled; }; =20 static const struct drm_display_mode default_mode =3D { @@ -267,9 +266,6 @@ static int rad_panel_prepare(struct drm_panel *panel) struct rad_panel *rad =3D to_rad_panel(panel); int ret; =20 - if (rad->prepared) - return 0; - ret =3D regulator_bulk_enable(rad->num_supplies, rad->supplies); if (ret) return ret; @@ -291,9 +287,6 @@ static int rad_panel_unprepare(struct drm_panel *panel) struct rad_panel *rad =3D to_rad_panel(panel); int ret; =20 - if (!rad->prepared) - return 0; - /* * Right after asserting the reset, we need to release it, so that the * touch driver can have an active connection with the touch controller @@ -322,9 +315,6 @@ static int rad_panel_enable(struct drm_panel *panel) int color_format =3D color_format_from_dsi_format(dsi->format); int ret; =20 - if (rad->enabled) - return 0; - dsi->mode_flags |=3D MIPI_DSI_MODE_LPM; =20 ret =3D rad_panel_push_cmd_list(dsi); @@ -389,8 +379,6 @@ static int rad_panel_enable(struct drm_panel *panel) =20 backlight_enable(rad->backlight); =20 - rad->enabled =3D true; - return 0; =20 fail: @@ -406,9 +394,6 @@ static int rad_panel_disable(struct drm_panel *panel) struct device *dev =3D &dsi->dev; int ret; =20 - if (!rad->enabled) - return 0; - dsi->mode_flags |=3D MIPI_DSI_MODE_LPM; =20 backlight_disable(rad->backlight); @@ -429,8 +414,6 @@ static int rad_panel_disable(struct drm_panel *panel) return ret; } =20 - rad->enabled =3D false; - return 0; } =20 @@ -633,8 +616,8 @@ static void rad_panel_shutdown(struct mipi_dsi_device *= dsi) { struct rad_panel *rad =3D mipi_dsi_get_drvdata(dsi); =20 - rad_panel_disable(&rad->panel); - rad_panel_unprepare(&rad->panel); + drm_panel_disable(&rad->panel); + drm_panel_unprepare(&rad->panel); } =20 static const struct of_device_id rad_of_match[] =3D { --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:18 2024 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 75ADB13775F for ; Fri, 3 May 2024 21:38:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772291; cv=none; b=eyxzaReKdmW0pa5qRf9ZChXZ2zY3mV9ogT/6mzHMerhMwXqqE+6jHrlFxGqHKKoFn67xQSmJ1FoHswmllyzjf/alV9h28/cXvg/O3La2KYsyLKyDZlxvUxe/xQlDWLz9nWqTgPTK4z7/OngSKPQssPryZvubQLdnnR+9FWp6io4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772291; c=relaxed/simple; bh=mdz7Fil6G5HtVsThsciyp8mFKe8053PCBwsR0ckmCe4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pHBHWWetPSiifb0Cw6d160Ed1zJHi+u408P6V07XOcnuHJlLG+jKOO+68jH3V+7lZSEtfJ6RdX06rJjoXXyXbtfqBPD9ASW6hy7TITPWVwDVSzkuTky7VQjPL7gKyAmvpB/l5JMAFtbbB8HqLAtT7KrFWG/Yp0KEE01Uqhx0N+I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=NPr1KpgS; arc=none smtp.client-ip=209.85.214.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="NPr1KpgS" Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1e9ffd3f96eso791345ad.3 for ; Fri, 03 May 2024 14:38:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772290; x=1715377090; darn=vger.kernel.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=xmnOhTLenfwPbkZ+9fOpNpevbnj0AgHZgHCpxDLbWgM=; b=NPr1KpgSXZk5gKHbyx0ZceKqrUITAdaA32k4r1g9A6aMu3BW9XKr8kBsKVQyw2CWL3 dUtdGRb4ohTG8IpHXhIHKybsy/FWBw6TMAua46EOUA5kNS8eHLFH5cPs/c6vQZY0aTWx akdO+qllMGtLIGV3Opv29qLFUVSLgO5XjLVbg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772290; x=1715377090; 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=xmnOhTLenfwPbkZ+9fOpNpevbnj0AgHZgHCpxDLbWgM=; b=FEEXWAbdOgWf8O+1OLcMiSnoZdWoeylcecj8dfLqJayDLq7PuKzfuGT0y0+xgK2DTG lbJnVV7a5dSQV8EyyijdEyM+o95kxI/BAW1kDt6elM4obJkD7KTBb7E6M2xOmnV2TsFB LA67tRYK2Oq++0womuWT0axiFXTbFn55bjy9wSJv7mKvEd1Zl5zwnAfZMCqfiNeiTRFs vDYVQGFEVROTVhpRqLslIpHaZbQB5hrnm1LMtHxcXUXVY/H8Vj85pWjxjKPX7k9mqZDz +9iHZIlJEdEDUKwA3gEhOgL4CfIjq9Glx5w23LLbrd1a6C87/dJjImwnfXqYo46g8mv5 +0Pg== X-Forwarded-Encrypted: i=1; AJvYcCXxqSTH/HSC6KpeO2s9Hpkp51T/8QRDriUKfxVWRl4cdfiapLcrmm9q4MPQWgt2yJv7c9oOHYW12xDzNKN5YG0Hfn6jewJ8gwmjPMxi X-Gm-Message-State: AOJu0Yy/ASgm7+vrX+2JhN72zK9Ul/BB4o52QATGnShXc/f3buQ9Cxyc /bqr1nS+5ku5ddtrAul5WH3kTXPUiSKRFGudFrR8aKM88QPSrRG2vQkd0EXVLA== X-Google-Smtp-Source: AGHT+IGBGVcpKQhnQ/va5QMpwiScWawVFF//2NM+v5dTbUM+lAsV+J43k0O4T3CyMAnt3mgiK6JpMQ== X-Received: by 2002:a17:903:234b:b0:1e2:b13f:bd64 with SMTP id c11-20020a170903234b00b001e2b13fbd64mr5192227plh.0.1714772289909; Fri, 03 May 2024 14:38:09 -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.38.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:38:09 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , Robert Chiras , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 45/48] drm/panel: raydium-rm67191: Don't call unprepare+disable at shutdown Date: Fri, 3 May 2024 14:33:26 -0700 Message-ID: <20240503143327.RFT.v2.45.Id14188f1a8af7d524751c27c343a5b583ff5361f@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 IMX boards. The IMX driver appears 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: Robert Chiras Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard --- Changes in v2: - Split removal of prepared/enabled from handling of remove/shutdown. drivers/gpu/drm/panel/panel-raydium-rm67191.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-raydium-rm67191.c b/drivers/gpu/dr= m/panel/panel-raydium-rm67191.c index fa9bf89d3bb5..b2029e035635 100644 --- a/drivers/gpu/drm/panel/panel-raydium-rm67191.c +++ b/drivers/gpu/drm/panel/panel-raydium-rm67191.c @@ -612,14 +612,6 @@ static void rad_panel_remove(struct mipi_dsi_device *d= si) drm_panel_remove(&rad->panel); } =20 -static void rad_panel_shutdown(struct mipi_dsi_device *dsi) -{ - struct rad_panel *rad =3D mipi_dsi_get_drvdata(dsi); - - drm_panel_disable(&rad->panel); - drm_panel_unprepare(&rad->panel); -} - static const struct of_device_id rad_of_match[] =3D { { .compatible =3D "raydium,rm67191", }, { /* sentinel */ } @@ -633,7 +625,6 @@ static struct mipi_dsi_driver rad_panel_driver =3D { }, .probe =3D rad_panel_probe, .remove =3D rad_panel_remove, - .shutdown =3D rad_panel_shutdown, }; module_mipi_dsi_driver(rad_panel_driver); =20 --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:18 2024 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 07819137766 for ; Fri, 3 May 2024 21:38:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772294; cv=none; b=rpYhCnkK9tbbnGMK8CQEI16MKMPTsA9v6qZYcJmxfnHOl/UtzwSkAr3IRGVzRVfjVVBzzMs1ITEHaQJE2exUJHHzmKwuEzh0gAbW2TFmtUEmi8RPLkSA5bHVWeA1zivr2bxz4lnEM6L+TLoh+7pdkvz53iBrEZVeEYptkh3klkQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772294; c=relaxed/simple; bh=wi3nhmfubaEs7FDrXqrqYUjUQwr5WxQmbUhvxgTasvE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eO4oIf7l4uCV2v964HNkRqT5sDfN7P9ZohabygVLXDswzIQ3EbwtHvBLyhAJdfDfXnljO7QdcUzvEOpVI/Cvm3OermssquDnhfuy23jJlRTBDvefkNJ3P6KZ2DDUUULwWkBpUxZU3q9t9qttCa3iNJdG3ElZrqHnJhU1J64R9o0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=dctPQnKg; arc=none smtp.client-ip=209.85.214.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="dctPQnKg" Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1ecc23e6c9dso733305ad.2 for ; Fri, 03 May 2024 14:38:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772292; x=1715377092; darn=vger.kernel.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=X9J+mwbNCcE7m50P9Dlsv1H2Zyb5eg1SoTrNCCSKKxs=; b=dctPQnKgta/9VLmEkKA7V7Bmlord9jpRKM7e1lcSKJqOTSJAvvU8MUPsee4Jf6FnEQ QAHfnPXR7oyyUveBYTozIAO8ztruoqKNHQutO5r7tFU2f0V5yCplDSdBq7TpOYZPEkbV SWV9nnEX6xBfTCLDl94DUekp8h1OYMmM0OijI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772292; x=1715377092; 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=X9J+mwbNCcE7m50P9Dlsv1H2Zyb5eg1SoTrNCCSKKxs=; b=F7vNHpxP0InFUidowu47dkfrMYd2LpoWOm7R020h2J8AzriEZDYgra9jH6fCsLm3x4 w+DuF8bjZFKORIRZ2mm5q+zRE6YWKORlSNrlaip3l8gCyiIocccQpIaJVzqyX1/YuUUx 0FXwZA22aUJVW4c4Qyqa/oElAK3+pFUau2xN4e+e4C2MsaS6kpVOQ36zWpiGY0DGDhS5 1Jqn4aHbQaqrGNe1HYz2qjrfL4+AGVDb1OdzSdszp4ueG1Tlgb2INlMHA1SylLCCx2ge ONsyQxQfTJDJpZcA7Q0bde/DMj5CnX5z+qzGzuLtaRWHZIIeLkEmiIYHnhYO32B4Uz26 prsA== X-Forwarded-Encrypted: i=1; AJvYcCWKbfqxy/5TEboS5bOti0NfhIyBn6JsX8QOI+wl2uCUMt2SFbzVHrYZvvfr22GIi1YQHre+fiJN1wyAxRTW5R61PyNa8uMSQv/0bW1k X-Gm-Message-State: AOJu0YxciW4yP84QD804r1ElUC0YL58HnKOV6Hq9eUfLLWcZ9gbHwIac e9vDwxv4Vr8f5Y8Qi6mJpgBOkTxK4YmPmWo9xk6vdaujDBQE7Ev0VI3ZrmWvTQ== X-Google-Smtp-Source: AGHT+IEhvNbol5zNlkCIgLPtF12l61bvixPmv0EHaY4itQnvJImVMXDJ99WT0lhGIYbPhxxJaaynFw== X-Received: by 2002:a17:902:da8c:b0:1e3:cfc5:589e with SMTP id j12-20020a170902da8c00b001e3cfc5589emr4661779plx.64.1714772292404; Fri, 03 May 2024 14:38:12 -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.38.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:38:11 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , Laurent Pinchart , Sebastian Reichel , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 46/48] drm/panel: sony-acx565akm: Don't double-check enabled state in disable Date: Fri, 3 May 2024 14:33:27 -0700 Message-ID: <20240503143327.RFT.v2.46.I6a51b36831a5c7b2b82bccf8c550cf0d076aa541@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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. The acx565akm seems to do some unique stuff with the "enabled" state. Specifically: 1. It seems to detect the enabled state based on how the bootloader left the panel. 2. It uses the enabled state to prevent certain sysfs files from accessing a disabled panel. We'll leave the "enabled" state tracking for this. However, we can at least get rid of the double-check when trying to disable. Cc: Laurent Pinchart Cc: Sebastian Reichel Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard Reviewed-by: Linus Walleij --- Changes in v2: - Split removal of prepared/enabled from handling of remove/shutdown. drivers/gpu/drm/panel/panel-sony-acx565akm.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-sony-acx565akm.c b/drivers/gpu/drm= /panel/panel-sony-acx565akm.c index 3d6a286056a0..a9a545a56404 100644 --- a/drivers/gpu/drm/panel/panel-sony-acx565akm.c +++ b/drivers/gpu/drm/panel/panel-sony-acx565akm.c @@ -454,9 +454,6 @@ static int acx565akm_power_on(struct acx565akm_panel *l= cd) =20 static void acx565akm_power_off(struct acx565akm_panel *lcd) { - if (!lcd->enabled) - return; - acx565akm_set_display_state(lcd, 0); acx565akm_set_sleep_mode(lcd, 1); lcd->enabled =3D false; --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:18 2024 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CD7AE137903 for ; Fri, 3 May 2024 21:38:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772296; cv=none; b=PwrukfyYLrtLvzZhT03rvyKBfe3kJZ8pOO8H1T9mR4kuCsI8c8Yv6JOdj0iWOozD3RLOsSQFVx30NAs1fDsKi+bcNHModoJnqvEEyNyRo43olGF6MkcUaqCvpzEomOks5QbX2ALXhlcgJjaaYLgXCe2L9PPBipxIKgG1JI3TWi0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772296; c=relaxed/simple; bh=bvpX+7DrauxoowAu53h9wDnzFvPQ6Wo3F4LQXvo7Tc4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rr+ELV6NhSpHSbEACKGK44dJog87JhpXcjzxfTRHRGFDHIj21lJHTNMwt7UB6tfBAAj3ugSpbhHjWEu0EJJ38abOUQHxInPS77PNNXTKo3ScCPwud2iP80RA1zYc3l7nmDRfP92H/MTNosszINxhZGYrTi9TnWe4BMYZCAozd0I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=gNeb0pjk; arc=none smtp.client-ip=209.85.214.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="gNeb0pjk" Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1e4266673bbso1052365ad.2 for ; Fri, 03 May 2024 14:38:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772294; x=1715377094; darn=vger.kernel.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=ekjI+s+uLAWB4kUzVZhMVrRRrlC73fq00flN601bwaM=; b=gNeb0pjkTHcQzHrBJ635ULp2Qlm4aYXdrCoabN60QZTi0IJqhBXLAybQFAMh0+RFX/ ASe9hxqF0o+6BiglGhglu9DNM0juSHsQ2rZdB/16PZxMifm1aGiKKjLB7rjNMFzsiAZ8 l/Rmk+ro8bTVhWT++hh9A7KlVNlSzSJOwTDSY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772294; x=1715377094; 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=ekjI+s+uLAWB4kUzVZhMVrRRrlC73fq00flN601bwaM=; b=O+e13Sm/RrmRze0DhOmEamL0BYMI8gS99C7oLIB6sJ/ByvnAFJHfuVHHYKOqtAXw7K 8XJFByWU6T3Rvsbs7we937bqkdp8ky0AvH0Zja/HD2k7etMHA1buMlqD6glcu2qC4+PK Zr+m0OHAxl00jYkqOmT7FTe3NlagxbcMY2X236dKSYnCLAPSkAJTzuRabJSEInw4Wx4e 52iSSUU6iqOsiWlwxzO9wzGJCEaAxFveKa46/wzfypLqNuM3qODDELBKeHvvJIoaBvfV FW/3pIJbJshI1ooEx5Tvvv1+axuGiTBiL1fseazLDCnm53Rl86JQSAlxm98wAmmGSI4c 1I9A== X-Forwarded-Encrypted: i=1; AJvYcCXD4Hh/z34wvwoYJxAfXSxGPkfEJ7SDxmLJ9qIilQKpgRxK+A5cPWDRcXqcXZSoXsjTe8MRGzCFYWVqjWlV4ftaRIfiM3wX8M0lEGrz X-Gm-Message-State: AOJu0YwCLmsZKP3hnZ/pHv8KtDowpn47B7jGtEshR7NffvmRwXel6jJi e+cyqyk1d56/we+uGO7KJQSntFMif0OUbOWo++86/DC1rGeuhp6Ok1W/7pNolg== X-Google-Smtp-Source: AGHT+IFguT0/xs4KCtngccJNg5AiVarM5W9ebMgGc4GgQxudEnwAFv+ycO9TzXkPPacW4rwdnnJR0g== X-Received: by 2002:a17:902:bb17:b0:1e9:470:87e6 with SMTP id im23-20020a170902bb1700b001e9047087e6mr3553894plb.23.1714772294293; Fri, 03 May 2024 14:38:14 -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.38.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:38:13 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , Laurent Pinchart , Sebastian Reichel , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 47/48] drm/panel: sony-acx565akm: Don't call disable at remove Date: Fri, 3 May 2024 14:33:28 -0700 Message-ID: <20240503143327.RFT.v2.47.I2513fd6824929a17c1ccd18a797b98a1a1063559@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 TI OMAP boards. The TI OMAP driver appears 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: Laurent Pinchart Cc: Sebastian Reichel Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard Reviewed-by: Linus Walleij --- Changes in v2: - Split removal of prepared/enabled from handling of remove/shutdown. drivers/gpu/drm/panel/panel-sony-acx565akm.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-sony-acx565akm.c b/drivers/gpu/drm= /panel/panel-sony-acx565akm.c index a9a545a56404..73ba93ff00fe 100644 --- a/drivers/gpu/drm/panel/panel-sony-acx565akm.c +++ b/drivers/gpu/drm/panel/panel-sony-acx565akm.c @@ -652,9 +652,6 @@ static void acx565akm_remove(struct spi_device *spi) =20 if (lcd->has_bc) acx565akm_backlight_cleanup(lcd); - - drm_panel_disable(&lcd->panel); - drm_panel_unprepare(&lcd->panel); } =20 static const struct of_device_id acx565akm_of_match[] =3D { --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Thu Sep 19 19:30:18 2024 Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A895913793F for ; Fri, 3 May 2024 21:38:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772300; cv=none; b=TBM0GwwGsFpss642XpXQVgkQLexrkwtyQNoI7UAcNryQ0OYhoT+8wae0ldOwUSjDsiHQNgo55xizUmdkWGRrFha6to+mxsOfQKiflC9ZykFagCOd7031is7ZPPysArHN52xwcFaYh/yqOkoeNaw0SehuLVTkRl+GNU9UraV0I9g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772300; c=relaxed/simple; bh=EaWtWEnAFoVYQQ7NdwPJMqMdWOvHRnxTyipd/TFLpqw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VlUaUhfS2QxvrvxMaw8ES0PsthHizPjQKIHP950OtONxv9mnmCpWRgnDZKmSNovJrTJlmT0yNP6mxUFcjQz3eAY60Hpz9oFFlAPgdxs/zwVD5CHcmA0SmvWyPHsyCZrbxFwUyNKlAB64+DeYURsKA/Bo2Q1IUGl6/E4QxZ/WOUo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=nlNk1Alg; arc=none smtp.client-ip=209.85.216.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="nlNk1Alg" Received: by mail-pj1-f54.google.com with SMTP id 98e67ed59e1d1-2b27c660174so132440a91.1 for ; Fri, 03 May 2024 14:38:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772297; x=1715377097; darn=vger.kernel.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=gkS+rg5OKiFoHCGrecPUpnEeRZJMeWyJ+snKafgy5vs=; b=nlNk1Alg9L0OtkB8zxq3JA6tAKSLOHp6f15vm5koUH9FP5DyEm6Dg6BXgAdntsrdWi avR5+u0SMT8Tl9+KVjdPN1txM+DeSEUVl1q4siPnjm0p5NGFVgm+Fpm/Zu3UQO6kvwDW 1g8heKyPmEo6JvdjTVzP0b5+CbBvPte2wS4lg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772297; x=1715377097; 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=gkS+rg5OKiFoHCGrecPUpnEeRZJMeWyJ+snKafgy5vs=; b=FOGW2LQNmWdJx7YAVpfV/GEbiGPxFVmhTe2PcM1iMFg6EszADJ5Slx1MMFXN1etwDl uSXIMnk3DV+UTJhFW9fD/hE5oT/OYg8rLkxDCu30ApL5+iYQTBTvo+eTWjPLRL4JoiWW UDJfnd68dti+aYoiFFSIApA5M14bfXUYu6piLOZfdY2vJ+CT++vbMsSiHgYUZZZr9AKq uNVQXTMDgJ2BPY8bVcmqNtlzz6lyznydCasv3Oj9AlBHUhpcGawKhKFyzqhuCrfCyLpQ AexZwtqUirKO/RLXPtXpVOlWJpiiGgXB1IRDS0RNTHF6S8yUbfDBBfSJpMcYn+Yx9y9p sHcw== X-Forwarded-Encrypted: i=1; AJvYcCW4a8Kla4/Z8txnulw6BfuQsqI19fPtT7vkV0ST/Iw9NoM5V8RhF32cMPj0N3+i1/XKXDAZZonBYSggzyqmoOLWUL8SapYtgoBoi8sG X-Gm-Message-State: AOJu0YwyrAGcgsEmQONJU8FTOY+JZVPcCeIio2TiDOo7gKSkzmmQiUCT t5J86U7anjB6I1pyXLKDLyvgGkr5iOV8cRJmXvr3cOi7ITGEV92MLcCikfk5HA== X-Google-Smtp-Source: AGHT+IHkW28tWyRIV7NmgOtGvUD0tFuJ+wrkeXjluxHwAroLQKxUR2uvyN5Qr5JmQy9q9YdYC6JW1Q== X-Received: by 2002:a17:90a:6081:b0:2a2:8ed7:da34 with SMTP id z1-20020a17090a608100b002a28ed7da34mr3992252pji.1.1714772297001; Fri, 03 May 2024 14:38:17 -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.38.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:38:16 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , Daniel Vetter , David Airlie , Jonathan Corbet , Maarten Lankhorst , Thomas Zimmermann , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 48/48] drm/panel: Update TODO list item for cleaning up prepared/enabled tracking Date: Fri, 3 May 2024 14:33:29 -0700 Message-ID: <20240503143327.RFT.v2.48.I104cdece7324b0c365e552a17f9883414ffaea01@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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Now that most panels have been updated not to track/double-check their prepared/enabled state update the TODO with next steps. Signed-off-by: Douglas Anderson Acked-by: Linus Walleij Acked-by: Maxime Ripard --- (no changes since v1) Documentation/gpu/todo.rst | 47 +++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst index e2a0585915b3..4063bc45bbd3 100644 --- a/Documentation/gpu/todo.rst +++ b/Documentation/gpu/todo.rst @@ -469,30 +469,35 @@ Contact: Thomas Zimmermann =20 Level: Starter =20 -Clean up checks for already prepared/enabled in panels ------------------------------------------------------- - -In a whole pile of panel drivers, we have code to make the -prepare/unprepare/enable/disable callbacks behave as no-ops if they've alr= eady -been called. To get some idea of the duplicated code, try:: - - git grep 'if.*>prepared' -- drivers/gpu/drm/panel - git grep 'if.*>enabled' -- drivers/gpu/drm/panel - -In the patch ("drm/panel: Check for already prepared/enabled in drm_panel") -we've moved this check to the core. Now we can most definitely remove the -check from the individual panels and save a pile of code. - -In adition to removing the check from the individual panels, it is believed -that even the core shouldn't need this check and that should be considered -an error if other code ever relies on this check. The check in the core -currently prints a warning whenever something is relying on this check with -dev_warn(). After a little while, we likely want to promote this to a -WARN(1) to help encourage folks not to rely on this behavior. +Remove disable/unprepare in remove/shutdown in panel-simple and panel-edp +------------------------------------------------------------------------- + +As of commit d2aacaf07395 ("drm/panel: Check for already prepared/enabled = in +drm_panel"), we have a check in the drm_panel core to make sure nobody +double-calls prepare/enable/disable/unprepare. Eventually that should prob= ably +be turned into a WARN_ON() or somehow made louder, but right now we actual= ly +expect it to trigger and so we don't want it to be too loud. + +Specifically, that warning will trigger for panel-edp and panel-simple at +shutdown time because those panels hardcode a call to drm_panel_disable() +and drm_panel_unprepare() at shutdown and remove time that they call regar= dless +of panel state. On systems with a properly coded DRM modeset driver that +calls drm_atomic_helper_shutdown() this is pretty much guaranteed to cause +the warning to fire. + +Unfortunately we can't safely remove the calls in panel-edp and panel-simp= le +until we're sure that all DRM modeset drivers that are used with those pan= els +properly call drm_atomic_helper_shutdown(). This TODO item is to validate +that all DRM modeset drivers used with panel-edp and panel-simple properly +call drm_atomic_helper_shutdown() and then remove the calls to +disable/unprepare from those panels. Alternatively, this TODO item could be +removed by convincing stakeholders that those calls are fine and downgradi= ng +the error message in drm_panel_disable() / drm_panel_unprepare() to a +debug-level message. =20 Contact: Douglas Anderson =20 -Level: Starter/Intermediate +Level: Intermediate =20 =20 Core refactorings --=20 2.45.0.rc1.225.g2a3ae87e7f-goog