dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Aradhya Bhatia <a-bhatia1@ti.com>,
	 Stefan Hansson <newbyte@postmarketos.org>,
	 Neil Armstrong <neil.armstrong@linaro.org>,
	 Jessica Zhang <jessica.zhang@oss.qualcomm.com>,
	 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	 Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	 David Airlie <airlied@gmail.com>,
	Simona Vetter <simona@ffwll.ch>,
	 Dmitry Baryshkov <lumag@kernel.org>,
	 Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>,
	 dri-devel@lists.freedesktop.org
Cc: Linus Walleij <linus.walleij@linaro.org>
Subject: [PATCH v2 3/4] drm: panel: nt35560: Move DSI commands to enable/disable
Date: Sun, 26 Oct 2025 18:40:02 +0100	[thread overview]
Message-ID: <20251026-fix-mcde-drm-regression-v2-3-8d799e488cf9@linaro.org> (raw)
In-Reply-To: <20251026-fix-mcde-drm-regression-v2-0-8d799e488cf9@linaro.org>

Due to semantic changes in the bridge core, panels cannot send
any DSI commands in the prepare/unprepare callbacks: there is
no guarantee that the DSI transmitter is available at this
point.

Cc: Aradhya Bhatia <a-bhatia1@ti.com>
Fixes: c9b1150a68d9 ("drm/atomic-helper: Re-order bridge chain pre-enable and post-disable")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/gpu/drm/panel/panel-novatek-nt35560.c | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-novatek-nt35560.c b/drivers/gpu/drm/panel/panel-novatek-nt35560.c
index 561e6643dcbb..b0b11d3e26fe 100644
--- a/drivers/gpu/drm/panel/panel-novatek-nt35560.c
+++ b/drivers/gpu/drm/panel/panel-novatek-nt35560.c
@@ -278,16 +278,18 @@ static void nt35560_power_off(struct nt35560 *nt)
 }
 
 static int nt35560_prepare(struct drm_panel *panel)
+{
+	struct nt35560 *nt = panel_to_nt35560(panel);
+
+	return nt35560_power_on(nt);
+}
+
+static int nt35560_enable(struct drm_panel *panel)
 {
 	struct nt35560 *nt = panel_to_nt35560(panel);
 	struct mipi_dsi_multi_context dsi_ctx = {
 		.dsi = to_mipi_dsi_device(nt->dev)
 	};
-	int ret;
-
-	ret = nt35560_power_on(nt);
-	if (ret)
-		return ret;
 
 	nt35560_read_id(&dsi_ctx);
 
@@ -317,7 +319,7 @@ static int nt35560_prepare(struct drm_panel *panel)
 	return dsi_ctx.accum_err;
 }
 
-static int nt35560_unprepare(struct drm_panel *panel)
+static int nt35560_disable(struct drm_panel *panel)
 {
 	struct nt35560 *nt = panel_to_nt35560(panel);
 	struct mipi_dsi_multi_context dsi_ctx = {
@@ -332,12 +334,18 @@ static int nt35560_unprepare(struct drm_panel *panel)
 
 	msleep(85);
 
+	return 0;
+}
+
+static int nt35560_unprepare(struct drm_panel *panel)
+{
+	struct nt35560 *nt = panel_to_nt35560(panel);
+
 	nt35560_power_off(nt);
 
 	return 0;
 }
 
-
 static int nt35560_get_modes(struct drm_panel *panel,
 			     struct drm_connector *connector)
 {
@@ -369,6 +377,8 @@ static int nt35560_get_modes(struct drm_panel *panel,
 static const struct drm_panel_funcs nt35560_drm_funcs = {
 	.unprepare = nt35560_unprepare,
 	.prepare = nt35560_prepare,
+	.enable = nt35560_enable,
+	.disable = nt35560_disable,
 	.get_modes = nt35560_get_modes,
 };
 

-- 
2.51.0


  parent reply	other threads:[~2025-10-26 17:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-26 17:39 [PATCH v2 0/4] drm: panel: Fix atomic helper-induced regressions Linus Walleij
2025-10-26 17:40 ` [PATCH v2 1/4] drm: panel: nt355510: Move DSI commands to enable/disable Linus Walleij
2025-10-26 17:40 ` [PATCH v2 2/4] drm: panel: s6d16d0: " Linus Walleij
2025-10-26 17:40 ` Linus Walleij [this message]
2025-10-26 17:40 ` [PATCH v2 4/4] drm: panel: s6e63m0: " Linus Walleij
2025-10-28 10:32 ` [PATCH v2 0/4] drm: panel: Fix atomic helper-induced regressions Tomi Valkeinen
2025-10-28 14:27   ` Linus Walleij
2025-10-28 15:13     ` Tomi Valkeinen
2025-11-04 14:36       ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251026-fix-mcde-drm-regression-v2-3-8d799e488cf9@linaro.org \
    --to=linus.walleij@linaro.org \
    --cc=a-bhatia1@ti.com \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jessica.zhang@oss.qualcomm.com \
    --cc=lumag@kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=newbyte@postmarketos.org \
    --cc=simona@ffwll.ch \
    --cc=tomi.valkeinen@ideasonboard.com \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).