* [PATCH 0/4] drm/panel: Convert four panel drivers to mipi_dsi_*_multi()
@ 2026-10-13 4:34 Akash Sukhavasi
2026-10-13 4:34 ` [PATCH 1/4] drm/panel: leadtek-ltk500hd1829: Use mipi_dsi_*_multi() Akash Sukhavasi
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Akash Sukhavasi @ 2026-10-13 4:34 UTC (permalink / raw)
To: Doug Anderson, Neil Armstrong, Jessica Zhang, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter
Cc: dri-devel, linux-kernel, Akash Sukhavasi, Heiko Stuebner,
Chris Morgan
This series converts deprecated mipi_dsi_dcs_*() calls to their
_multi() equivalents in four panel drivers: leadtek-ltk500hd1829,
kingdisplay-kd097d04, innolux-p079zca, and newvision-nv3051d. The
first two drivers also convert mipi_dsi_generic_write().
In patches 2-4, unprepare() previously returned early when
enter_sleep_mode() failed, skipping GPIO and regulator teardown.
Because drm_panel_unprepare() leaves panel->prepared set when the
callback returns an error, the panel could not be prepared again.
These patches remove the early return, so GPIO and regulator
teardown always runs, and have unprepare() always return 0, so
drm_panel_unprepare() clears panel->prepared. Patches 2 and 3
likewise stop returning regulator disable errors from unprepare().
In patches 1, 3, and 4, the original code treated a set_display_off()
failure as non-fatal and still attempted enter_sleep_mode(). These
patches clear accum_err after set_display_off_multi() to keep that
behaviour.
All four patches are compile tested only. checkpatch and a W=1 build
are clean. Tested-by tags would be very welcome.
While converting nv3051d, I noticed that panel_nv3051d_init_sequence()
always returns 0, so init sequence errors never reach prepare(). This
series leaves that unchanged, and I plan to send a separate fix.
Signed-off-by: Akash Sukhavasi <akash.sukhavasi@gmail.com>
---
Akash Sukhavasi (4):
drm/panel: leadtek-ltk500hd1829: Use mipi_dsi_*_multi()
drm/panel: kingdisplay-kd097d04: Use mipi_dsi_*_multi(); fix minor bugs
drm/panel: innolux-p079zca: Use mipi_dsi_*_multi(); fix minor bugs
drm/panel: newvision-nv3051d: Use mipi_dsi_*_multi(); fix minor bugs
drivers/gpu/drm/panel/panel-innolux-p079zca.c | 43 +++++++-----------
drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c | 53 ++++++++--------------
drivers/gpu/drm/panel/panel-leadtek-ltk500hd1829.c | 40 ++++++----------
drivers/gpu/drm/panel/panel-newvision-nv3051d.c | 36 ++++++---------
4 files changed, 61 insertions(+), 111 deletions(-)
---
base-commit: 725953d4da85cfb97a4c309fad6346b72f8529e7
change-id: 20261011-mipi-multi-series-6c98bec0c75e
Best regards,
--
Akash Sukhavasi <akash.sukhavasi@gmail.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/4] drm/panel: leadtek-ltk500hd1829: Use mipi_dsi_*_multi()
2026-10-13 4:34 [PATCH 0/4] drm/panel: Convert four panel drivers to mipi_dsi_*_multi() Akash Sukhavasi
@ 2026-10-13 4:34 ` Akash Sukhavasi
2026-10-13 4:34 ` [PATCH 2/4] drm/panel: kingdisplay-kd097d04: Use mipi_dsi_*_multi(); fix minor bugs Akash Sukhavasi
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Akash Sukhavasi @ 2026-10-13 4:34 UTC (permalink / raw)
To: Doug Anderson, Neil Armstrong, Jessica Zhang, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter
Cc: dri-devel, linux-kernel, Akash Sukhavasi, Heiko Stuebner
The mipi_dsi_dcs_*() and mipi_dsi_generic_write() functions used by
this driver are deprecated in favour of their _multi() counterparts,
as noted in Documentation/gpu/todo.rst. The _multi() variants record
the first error in a context structure and skip subsequent calls once
an error is set, removing the need to check the return value after
each command. They also log failures internally, making the per-call
dev_err() calls redundant.
Convert prepare() and unprepare() to use the _multi() equivalents.
In prepare(), use mipi_dsi_msleep() instead of plain msleep() so the
delay is skipped on prior error, since the function will clean up
via the existing disable_iovcc label anyway.
In unprepare(), keep plain msleep() since the hardware delay must
execute regardless of any prior DSI error. The original code logged
a set_display_off() failure and still attempted enter_sleep_mode(),
so clear accum_err after set_display_off_multi() to keep that
behaviour. An enter_sleep_mode() failure was also only logged, and
that stays the same.
Cc: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Akash Sukhavasi <akash.sukhavasi@gmail.com>
---
Compile tested only, no hardware available. checkpatch and a W=1
build are clean.
---
drivers/gpu/drm/panel/panel-leadtek-ltk500hd1829.c | 40 ++++++++--------------
1 file changed, 14 insertions(+), 26 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-leadtek-ltk500hd1829.c b/drivers/gpu/drm/panel/panel-leadtek-ltk500hd1829.c
index ff35b62a327e..ee65506477df 100644
--- a/drivers/gpu/drm/panel/panel-leadtek-ltk500hd1829.c
+++ b/drivers/gpu/drm/panel/panel-leadtek-ltk500hd1829.c
@@ -489,16 +489,13 @@ static int ltk500hd1829_unprepare(struct drm_panel *panel)
{
struct ltk500hd1829 *ctx = panel_to_ltk500hd1829(panel);
struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
- int ret;
-
- ret = mipi_dsi_dcs_set_display_off(dsi);
- if (ret < 0)
- dev_err(panel->dev, "failed to set display off: %d\n", ret);
+ struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi };
- ret = mipi_dsi_dcs_enter_sleep_mode(dsi);
- if (ret < 0) {
- dev_err(panel->dev, "failed to enter sleep mode: %d\n", ret);
- }
+ mipi_dsi_dcs_set_display_off_multi(&dsi_ctx);
+ /* Reset error to continue power-down sequence even if display off failed */
+ dsi_ctx.accum_err = 0;
+ /* Enter sleep mode; error does not prevent power-off */
+ mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx);
/* 120ms to enter sleep mode */
msleep(120);
@@ -513,6 +510,7 @@ static int ltk500hd1829_prepare(struct drm_panel *panel)
{
struct ltk500hd1829 *ctx = panel_to_ltk500hd1829(panel);
struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
+ struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi };
unsigned int i;
int ret;
@@ -535,27 +533,17 @@ static int ltk500hd1829_prepare(struct drm_panel *panel)
/* tRT: >= 5ms */
usleep_range(5000, 6000);
- for (i = 0; i < ctx->panel_desc->num_init; i++) {
- ret = mipi_dsi_generic_write(dsi, &ctx->panel_desc->init[i],
+ for (i = 0; i < ctx->panel_desc->num_init; i++)
+ mipi_dsi_generic_write_multi(&dsi_ctx, &ctx->panel_desc->init[i],
sizeof(struct ltk500hd1829_cmd));
- if (ret < 0) {
- dev_err(panel->dev, "failed to write init cmds: %d\n", ret);
- goto disable_iovcc;
- }
- }
-
- ret = mipi_dsi_dcs_exit_sleep_mode(dsi);
- if (ret < 0) {
- dev_err(panel->dev, "failed to exit sleep mode: %d\n", ret);
- goto disable_iovcc;
- }
+ mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx);
/* 120ms to exit sleep mode */
- msleep(120);
+ mipi_dsi_msleep(&dsi_ctx, 120);
+ mipi_dsi_dcs_set_display_on_multi(&dsi_ctx);
- ret = mipi_dsi_dcs_set_display_on(dsi);
- if (ret < 0) {
- dev_err(panel->dev, "failed to set display on: %d\n", ret);
+ if (dsi_ctx.accum_err) {
+ ret = dsi_ctx.accum_err;
goto disable_iovcc;
}
--
2.56.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/4] drm/panel: kingdisplay-kd097d04: Use mipi_dsi_*_multi(); fix minor bugs
2026-10-13 4:34 [PATCH 0/4] drm/panel: Convert four panel drivers to mipi_dsi_*_multi() Akash Sukhavasi
2026-10-13 4:34 ` [PATCH 1/4] drm/panel: leadtek-ltk500hd1829: Use mipi_dsi_*_multi() Akash Sukhavasi
@ 2026-10-13 4:34 ` Akash Sukhavasi
2026-10-13 4:34 ` [PATCH 3/4] drm/panel: innolux-p079zca: " Akash Sukhavasi
2026-10-13 4:34 ` [PATCH 4/4] drm/panel: newvision-nv3051d: " Akash Sukhavasi
3 siblings, 0 replies; 7+ messages in thread
From: Akash Sukhavasi @ 2026-10-13 4:34 UTC (permalink / raw)
To: Doug Anderson, Neil Armstrong, Jessica Zhang, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter
Cc: dri-devel, linux-kernel, Akash Sukhavasi
The mipi_dsi_dcs_*() and mipi_dsi_generic_write() functions used by
this driver are deprecated in favour of their _multi() counterparts,
as noted in Documentation/gpu/todo.rst. The _multi() variants record
the first error in a context structure and skip subsequent calls once
an error is set, removing the need to check the return value after
each command. They also log failures internally, making the per-call
dev_err() calls redundant.
Convert prepare(), disable(), and unprepare() to use the _multi()
equivalents.
In prepare(), use mipi_dsi_msleep() and mipi_dsi_usleep_range() instead
of plain msleep()/usleep_range() for delays between DSI commands, so
they are skipped on prior error since the function will clean up via the
existing poweroff label anyway.
In unprepare(), keep plain msleep() since the hardware delay must execute
regardless of any prior DSI error. This also fixes a bug where a failure
in enter_sleep_mode would return early, skipping the T15 delay, GPIO
deassertion, and regulator disable, leaving the panel stuck in a
prepared state. Because drm_panel_unprepare() does not clear
panel->prepared when the callback returns an error, drm_panel_prepare()
would return early on the next call, leaving the panel unable to be
re-initialised.
For the same reason, stop returning the regulator_disable() error from
unprepare(). Returning it would leave the panel in the same stuck state.
Signed-off-by: Akash Sukhavasi <akash.sukhavasi@gmail.com>
---
Compile tested only, no hardware available. checkpatch and a W=1
build are clean.
---
drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c | 53 ++++++++--------------
1 file changed, 18 insertions(+), 35 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c b/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c
index 893af9b16756..bc25ce1ce4a7 100644
--- a/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c
+++ b/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c
@@ -180,11 +180,10 @@ struct kingdisplay_panel *to_kingdisplay_panel(struct drm_panel *panel)
static int kingdisplay_panel_disable(struct drm_panel *panel)
{
struct kingdisplay_panel *kingdisplay = to_kingdisplay_panel(panel);
- int err;
+ struct mipi_dsi_multi_context dsi_ctx = { .dsi = kingdisplay->link };
- err = mipi_dsi_dcs_set_display_off(kingdisplay->link);
- if (err < 0)
- dev_err(panel->dev, "failed to set display off: %d\n", err);
+ /* Set display off; error does not prevent disable */
+ mipi_dsi_dcs_set_display_off_multi(&dsi_ctx);
return 0;
}
@@ -192,22 +191,16 @@ static int kingdisplay_panel_disable(struct drm_panel *panel)
static int kingdisplay_panel_unprepare(struct drm_panel *panel)
{
struct kingdisplay_panel *kingdisplay = to_kingdisplay_panel(panel);
- int err;
+ struct mipi_dsi_multi_context dsi_ctx = { .dsi = kingdisplay->link };
- err = mipi_dsi_dcs_enter_sleep_mode(kingdisplay->link);
- if (err < 0) {
- dev_err(panel->dev, "failed to enter sleep mode: %d\n", err);
- return err;
- }
+ /* Enter sleep mode; error does not prevent power-off */
+ mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx);
/* T15: 120ms */
msleep(120);
gpiod_set_value_cansleep(kingdisplay->enable_gpio, 0);
-
- err = regulator_disable(kingdisplay->supply);
- if (err < 0)
- return err;
+ regulator_disable(kingdisplay->supply);
return 0;
}
@@ -215,6 +208,7 @@ static int kingdisplay_panel_unprepare(struct drm_panel *panel)
static int kingdisplay_panel_prepare(struct drm_panel *panel)
{
struct kingdisplay_panel *kingdisplay = to_kingdisplay_panel(panel);
+ struct mipi_dsi_multi_context dsi_ctx = { .dsi = kingdisplay->link };
int err, regulator_err;
unsigned int i;
@@ -232,33 +226,22 @@ static int kingdisplay_panel_prepare(struct drm_panel *panel)
/* T4: 15ms */
usleep_range(15000, 16000);
- for (i = 0; i < ARRAY_SIZE(init_code); i++) {
- err = mipi_dsi_generic_write(kingdisplay->link, &init_code[i],
- sizeof(struct kingdisplay_panel_cmd));
- if (err < 0) {
- dev_err(panel->dev, "failed write init cmds: %d\n", err);
- goto poweroff;
- }
- }
-
- err = mipi_dsi_dcs_exit_sleep_mode(kingdisplay->link);
- if (err < 0) {
- dev_err(panel->dev, "failed to exit sleep mode: %d\n", err);
- goto poweroff;
- }
+ for (i = 0; i < ARRAY_SIZE(init_code); i++)
+ mipi_dsi_generic_write_multi(&dsi_ctx, &init_code[i],
+ sizeof(struct kingdisplay_panel_cmd));
+ mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx);
/* T6: 120ms */
- msleep(120);
+ mipi_dsi_msleep(&dsi_ctx, 120);
+ mipi_dsi_dcs_set_display_on_multi(&dsi_ctx);
+ /* T7: 10ms */
+ mipi_dsi_usleep_range(&dsi_ctx, 10000, 11000);
- err = mipi_dsi_dcs_set_display_on(kingdisplay->link);
- if (err < 0) {
- dev_err(panel->dev, "failed to set display on: %d\n", err);
+ if (dsi_ctx.accum_err) {
+ err = dsi_ctx.accum_err;
goto poweroff;
}
- /* T7: 10ms */
- usleep_range(10000, 11000);
-
return 0;
poweroff:
--
2.56.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/4] drm/panel: innolux-p079zca: Use mipi_dsi_*_multi(); fix minor bugs
2026-10-13 4:34 [PATCH 0/4] drm/panel: Convert four panel drivers to mipi_dsi_*_multi() Akash Sukhavasi
2026-10-13 4:34 ` [PATCH 1/4] drm/panel: leadtek-ltk500hd1829: Use mipi_dsi_*_multi() Akash Sukhavasi
2026-10-13 4:34 ` [PATCH 2/4] drm/panel: kingdisplay-kd097d04: Use mipi_dsi_*_multi(); fix minor bugs Akash Sukhavasi
@ 2026-10-13 4:34 ` Akash Sukhavasi
2026-10-13 4:34 ` [PATCH 4/4] drm/panel: newvision-nv3051d: " Akash Sukhavasi
3 siblings, 0 replies; 7+ messages in thread
From: Akash Sukhavasi @ 2026-10-13 4:34 UTC (permalink / raw)
To: Doug Anderson, Neil Armstrong, Jessica Zhang, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter
Cc: dri-devel, linux-kernel, Akash Sukhavasi
The mipi_dsi_dcs_*() functions used by this driver are deprecated in
favour of their _multi() counterparts, as noted in
Documentation/gpu/todo.rst. The _multi() variants record the first
error in a context structure and skip subsequent calls once an error
is set, removing the need to check the return value after each command.
They also log failures internally, making the per-call dev_err() calls
redundant.
Convert prepare() and unprepare() to use the _multi() equivalents.
In prepare(), use mipi_dsi_msleep() and mipi_dsi_usleep_range() instead
of plain msleep()/usleep_range() for delays between DSI commands, so
they are skipped on prior error since the function will clean up via the
existing poweroff label anyway.
In unprepare(), keep plain msleep() since the hardware delays must
execute regardless of any prior DSI error. The original code logged a
set_display_off() failure and still attempted enter_sleep_mode(), so
clear accum_err after set_display_off_multi() to keep that behaviour.
This also fixes a bug where a failure in enter_sleep_mode would return
early, skipping the sleep-mode delay, GPIO deassertion, power-down
delay, and regulator teardown, leaving the panel stuck in a prepared
state. Because drm_panel_unprepare() does not clear panel->prepared
when the callback returns an error, drm_panel_prepare() would return
early on the next call, leaving the panel unable to be re-initialised.
For the same reason, stop returning the regulator_bulk_disable() error
from unprepare(). Returning it would leave the panel in the same stuck
state.
Signed-off-by: Akash Sukhavasi <akash.sukhavasi@gmail.com>
---
Compile tested only, no hardware available. checkpatch and a W=1
build are clean.
---
drivers/gpu/drm/panel/panel-innolux-p079zca.c | 43 ++++++++++-----------------
1 file changed, 16 insertions(+), 27 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-innolux-p079zca.c b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
index 80afeeab9475..8da2f9b2ddde 100644
--- a/drivers/gpu/drm/panel/panel-innolux-p079zca.c
+++ b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
@@ -54,17 +54,13 @@ static inline struct innolux_panel *to_innolux_panel(struct drm_panel *panel)
static int innolux_panel_unprepare(struct drm_panel *panel)
{
struct innolux_panel *innolux = to_innolux_panel(panel);
- int err;
-
- err = mipi_dsi_dcs_set_display_off(innolux->link);
- if (err < 0)
- dev_err(panel->dev, "failed to set display off: %d\n", err);
+ struct mipi_dsi_multi_context dsi_ctx = { .dsi = innolux->link };
- err = mipi_dsi_dcs_enter_sleep_mode(innolux->link);
- if (err < 0) {
- dev_err(panel->dev, "failed to enter sleep mode: %d\n", err);
- return err;
- }
+ mipi_dsi_dcs_set_display_off_multi(&dsi_ctx);
+ /* Reset error to continue power-down sequence even if display off failed */
+ dsi_ctx.accum_err = 0;
+ /* Enter sleep mode; error does not prevent power-off */
+ mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx);
if (innolux->desc->sleep_mode_delay)
msleep(innolux->desc->sleep_mode_delay);
@@ -74,10 +70,8 @@ static int innolux_panel_unprepare(struct drm_panel *panel)
if (innolux->desc->power_down_delay)
msleep(innolux->desc->power_down_delay);
- err = regulator_bulk_disable(innolux->desc->num_supplies,
- innolux->supplies);
- if (err < 0)
- return err;
+ regulator_bulk_disable(innolux->desc->num_supplies,
+ innolux->supplies);
return 0;
}
@@ -85,6 +79,7 @@ static int innolux_panel_unprepare(struct drm_panel *panel)
static int innolux_panel_prepare(struct drm_panel *panel)
{
struct innolux_panel *innolux = to_innolux_panel(panel);
+ struct mipi_dsi_multi_context dsi_ctx = { .dsi = innolux->link };
int err;
gpiod_set_value_cansleep(innolux->enable_gpio, 0);
@@ -108,24 +103,18 @@ static int innolux_panel_prepare(struct drm_panel *panel)
goto poweroff;
}
- err = mipi_dsi_dcs_exit_sleep_mode(innolux->link);
- if (err < 0) {
- dev_err(panel->dev, "failed to exit sleep mode: %d\n", err);
- goto poweroff;
- }
-
+ mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx);
/* T6: 120ms - 1000ms*/
- msleep(120);
+ mipi_dsi_msleep(&dsi_ctx, 120);
+ mipi_dsi_dcs_set_display_on_multi(&dsi_ctx);
+ /* T7: 5ms */
+ mipi_dsi_usleep_range(&dsi_ctx, 5000, 6000);
- err = mipi_dsi_dcs_set_display_on(innolux->link);
- if (err < 0) {
- dev_err(panel->dev, "failed to set display on: %d\n", err);
+ if (dsi_ctx.accum_err) {
+ err = dsi_ctx.accum_err;
goto poweroff;
}
- /* T7: 5ms */
- usleep_range(5000, 6000);
-
return 0;
poweroff:
--
2.56.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 4/4] drm/panel: newvision-nv3051d: Use mipi_dsi_*_multi(); fix minor bugs
2026-10-13 4:34 [PATCH 0/4] drm/panel: Convert four panel drivers to mipi_dsi_*_multi() Akash Sukhavasi
` (2 preceding siblings ...)
2026-10-13 4:34 ` [PATCH 3/4] drm/panel: innolux-p079zca: " Akash Sukhavasi
@ 2026-10-13 4:34 ` Akash Sukhavasi
2026-10-13 4:43 ` sashiko-bot
3 siblings, 1 reply; 7+ messages in thread
From: Akash Sukhavasi @ 2026-10-13 4:34 UTC (permalink / raw)
To: Doug Anderson, Neil Armstrong, Jessica Zhang, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter
Cc: dri-devel, linux-kernel, Akash Sukhavasi, Chris Morgan
The mipi_dsi_dcs_*() functions used by this driver are deprecated in
favour of their _multi() counterparts, as noted in
Documentation/gpu/todo.rst. The _multi() variants record the first
error in a context structure and skip subsequent calls once an error
is set, removing the need to check the return value after each command.
They also log failures internally, making the per-call dev_err() calls
redundant.
Convert prepare() and unprepare() to use the _multi() equivalents.
In prepare(), use mipi_dsi_msleep() and mipi_dsi_usleep_range() instead
of plain msleep()/usleep_range() for delays between DSI commands, so
they are skipped on prior error since the function will clean up via the
existing disable_vdd label anyway.
In unprepare(), keep plain msleep() and usleep_range() since the
hardware delays must execute regardless of any prior DSI error. The
original code logged a set_display_off() failure and still attempted
enter_sleep_mode(), so clear accum_err after set_display_off_multi()
to keep that behaviour.
This also fixes a bug where a failure in enter_sleep_mode would return
early, skipping the post-sleep delay, reset GPIO assertion, and
regulator disable, leaving the panel stuck in a prepared state. Because
drm_panel_unprepare() does not clear panel->prepared when the callback
returns an error, drm_panel_prepare() would return early on the next
call, leaving the panel unable to be re-initialised.
Cc: Chris Morgan <macromorgan@hotmail.com>
Signed-off-by: Akash Sukhavasi <akash.sukhavasi@gmail.com>
---
Compile tested only, no hardware available. checkpatch and a W=1
build are clean.
---
drivers/gpu/drm/panel/panel-newvision-nv3051d.c | 36 +++++++++----------------
1 file changed, 13 insertions(+), 23 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-newvision-nv3051d.c b/drivers/gpu/drm/panel/panel-newvision-nv3051d.c
index 22560384e48e..7dc25102a773 100644
--- a/drivers/gpu/drm/panel/panel-newvision-nv3051d.c
+++ b/drivers/gpu/drm/panel/panel-newvision-nv3051d.c
@@ -247,19 +247,14 @@ static int panel_nv3051d_unprepare(struct drm_panel *panel)
{
struct panel_nv3051d *ctx = panel_to_panelnv3051d(panel);
struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
- int ret;
-
- ret = mipi_dsi_dcs_set_display_off(dsi);
- if (ret < 0)
- dev_err(ctx->dev, "failed to set display off: %d\n", ret);
+ struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi };
+ mipi_dsi_dcs_set_display_off_multi(&dsi_ctx);
+ /* Reset error to continue power-down sequence even if display off failed */
+ dsi_ctx.accum_err = 0;
msleep(20);
-
- ret = mipi_dsi_dcs_enter_sleep_mode(dsi);
- if (ret < 0) {
- dev_err(ctx->dev, "failed to enter sleep mode: %d\n", ret);
- return ret;
- }
+ /* Enter sleep mode; error does not prevent power-off */
+ mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx);
usleep_range(10000, 15000);
@@ -274,6 +269,7 @@ static int panel_nv3051d_prepare(struct drm_panel *panel)
{
struct panel_nv3051d *ctx = panel_to_panelnv3051d(panel);
struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
+ struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi };
int ret;
dev_dbg(ctx->dev, "Resetting the panel\n");
@@ -295,22 +291,16 @@ static int panel_nv3051d_prepare(struct drm_panel *panel)
goto disable_vdd;
}
- ret = mipi_dsi_dcs_exit_sleep_mode(dsi);
- if (ret < 0) {
- dev_err(ctx->dev, "Failed to exit sleep mode: %d\n", ret);
- goto disable_vdd;
- }
-
- msleep(200);
+ mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx);
+ mipi_dsi_msleep(&dsi_ctx, 200);
+ mipi_dsi_dcs_set_display_on_multi(&dsi_ctx);
+ mipi_dsi_usleep_range(&dsi_ctx, 10000, 15000);
- ret = mipi_dsi_dcs_set_display_on(dsi);
- if (ret < 0) {
- dev_err(ctx->dev, "Failed to set display on: %d\n", ret);
+ if (dsi_ctx.accum_err) {
+ ret = dsi_ctx.accum_err;
goto disable_vdd;
}
- usleep_range(10000, 15000);
-
return 0;
disable_vdd:
--
2.56.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 4/4] drm/panel: newvision-nv3051d: Use mipi_dsi_*_multi(); fix minor bugs
2026-10-13 4:34 ` [PATCH 4/4] drm/panel: newvision-nv3051d: " Akash Sukhavasi
@ 2026-10-13 4:43 ` sashiko-bot
2026-10-13 5:04 ` Akash Sukhavasi
0 siblings, 1 reply; 7+ messages in thread
From: sashiko-bot @ 2026-10-13 4:43 UTC (permalink / raw)
To: Akash Sukhavasi; +Cc: dri-devel
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] drm/panel: ignored error in panel_nv3051d_init_sequence()
--
commit aa26fcd3815b87a0163ded60d82dde5bf60bbecd
Author: Akash Sukhavasi <akash.sukhavasi@gmail.com>
drm/panel: newvision-nv3051d: Use mipi_dsi_*_multi(); fix minor bugs
This commit converts the newvision-nv3051d panel driver to use the _multi()
variants of the mipi_dsi_dcs_* functions. It uses mipi_dsi_msleep() and
mipi_dsi_usleep_range() for delays so they are skipped on prior errors. It
also fixes a bug where an enter_sleep_mode failure would skip the post-sleep
delay and leave the panel in a stuck state.
> diff --git a/drivers/gpu/drm/panel/panel-newvision-nv3051d.c b/drivers/gpu/drm/panel/panel-newvision-nv3051d.c
> index 22560384e48e3..7dc25102a7735 100644
> --- a/drivers/gpu/drm/panel/panel-newvision-nv3051d.c
> +++ b/drivers/gpu/drm/panel/panel-newvision-nv3051d.c
[ ... ]
> @@ -295,22 +291,16 @@ static int panel_nv3051d_prepare(struct drm_panel *panel)
> goto disable_vdd;
> }
>
> - ret = mipi_dsi_dcs_exit_sleep_mode(dsi);
> - if (ret < 0) {
> - dev_err(ctx->dev, "Failed to exit sleep mode: %d\n", ret);
> - goto disable_vdd;
> - }
> -
> - msleep(200);
> + mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx);
[Severity: Medium]
Does panel_nv3051d_init_sequence() mask initialization failures?
In panel_nv3051d_init_sequence(), the function uses a local dsi_ctx to
accumulate errors, but always returns 0:
static int panel_nv3051d_init_sequence(struct panel_nv3051d *ctx)
{
...
struct mipi_dsi_multi_context dsi_ctx = {.dsi = dsi};
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xFF, 0x30);
...
return 0;
}
If any DCS write fails, the error is stored in the local dsi_ctx.accum_err,
but the function unconditionally returns 0 instead of the accumulated error.
This causes the caller panel_nv3051d_prepare() to falsely assume the
initialization succeeded.
Will this proceed to exit sleep mode and turn on the display rather than
aborting and safely disabling the regulator when DSI communication fails?
> + mipi_dsi_msleep(&dsi_ctx, 200);
> + mipi_dsi_dcs_set_display_on_multi(&dsi_ctx);
> + mipi_dsi_usleep_range(&dsi_ctx, 10000, 15000);
>
> - ret = mipi_dsi_dcs_set_display_on(dsi);
> - if (ret < 0) {
> - dev_err(ctx->dev, "Failed to set display on: %d\n", ret);
> + if (dsi_ctx.accum_err) {
> + ret = dsi_ctx.accum_err;
> goto disable_vdd;
> }
>
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261012-mipi-multi-series-v1-0-6a29add1ec92@gmail.com?part=4
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 4/4] drm/panel: newvision-nv3051d: Use mipi_dsi_*_multi(); fix minor bugs
2026-10-13 4:43 ` sashiko-bot
@ 2026-10-13 5:04 ` Akash Sukhavasi
0 siblings, 0 replies; 7+ messages in thread
From: Akash Sukhavasi @ 2026-10-13 5:04 UTC (permalink / raw)
To: sashiko-reviews; +Cc: Doug Anderson, Neil Armstrong, Chris Morgan, dri-devel
On Tue, Oct 13, 2026 at 04:43:35AM +0000, sashiko-bot@kernel.org wrote:
> [Severity: Medium]
> Does panel_nv3051d_init_sequence() mask initialization failures?
This is pre-existing: panel_nv3051d_init_sequence() returned 0
unconditionally before this patch as well, and the cover letter calls
it out.
My plan is to send the fix, returning dsi_ctx.accum_err, as a separate
patch once this series has been reviewed.
If you would rather have it in this series, I can include it in v2.
Sashiko AI review: https://sashiko.dev/#/patchset/20261012-mipi-multi-series-v1-0-6a29add1ec92@gmail.com?part=4
--
Thanks,
Akash
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-10-13 7:54 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-13 4:34 [PATCH 0/4] drm/panel: Convert four panel drivers to mipi_dsi_*_multi() Akash Sukhavasi
2026-10-13 4:34 ` [PATCH 1/4] drm/panel: leadtek-ltk500hd1829: Use mipi_dsi_*_multi() Akash Sukhavasi
2026-10-13 4:34 ` [PATCH 2/4] drm/panel: kingdisplay-kd097d04: Use mipi_dsi_*_multi(); fix minor bugs Akash Sukhavasi
2026-10-13 4:34 ` [PATCH 3/4] drm/panel: innolux-p079zca: " Akash Sukhavasi
2026-10-13 4:34 ` [PATCH 4/4] drm/panel: newvision-nv3051d: " Akash Sukhavasi
2026-10-13 4:43 ` sashiko-bot
2026-10-13 5:04 ` Akash Sukhavasi
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.