drm/panel: Replace deprecated DCS display-on calls
Subsystems (8)
PATCH 1/1 drm/panel: Replace deprecated DCS display-on calls
--- drivers/gpu/drm/panel/panel-boe-himax8279d.c | 14 ++++++++++++-- drivers/gpu/drm/panel/panel-dsi-cm.c | 7 ++++++- drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c | 7 +++++-- .../gpu/drm/panel/panel-feiyang-fy07024di26a30d.c | 6 +++++- drivers/gpu/drm/panel/panel-innolux-p079zca.c | 7 ++++++- drivers/gpu/drm/panel/panel-khadas-ts050.c | 7 ++++++- drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c | 7 ++++++- drivers/gpu/drm/panel/panel-leadtek-ltk500hd1829.c | 7 ++++++- drivers/gpu/drm/panel/panel-newvision-nv3051d.c | 7 ++++++- drivers/gpu/drm/panel/panel-novatek-nt35510.c | 7 ++++++- drivers/gpu/drm/panel/panel-raydium-rm67191.c | 7 ++++++- drivers/gpu/drm/panel/panel-raydium-rm68200.c | 7 ++++++- drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c | 7 ++++++- drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c | 7 ++++++- 14 files changed, 88 insertions(+), 16 deletions(-)
drivers/gpu/drm/panel/panel-boe-himax8279d.c +12 -2
@@ -155,7 +155,12 @@ static int boe_panel_prepare(struct drm_panel *panel)/* T6: 120ms - 121ms */ usleep_range (120000 ,121000 ); - err =mipi_dsi_dcs_set_display_on (pinfo->link); +struct mipi_dsi_multi_context dsi_ctx = { + .dsi = pinfo->link, + }; + +mipi_dsi_dcs_set_display_on_multi (&dsi_ctx); + err = dsi_ctx.accum_err;if (err <0 ) {dev_err (panel->dev,"failed to set display on: %d\n" , err); goto poweroff;
@@ -178,7 +183,12 @@ static int boe_panel_enable(struct drm_panel *panel)usleep_range (120000 ,121000 ); - ret =mipi_dsi_dcs_set_display_on (pinfo->link); +struct mipi_dsi_multi_context dsi_ctx = { + .dsi = pinfo->link, + }; + +mipi_dsi_dcs_set_display_on_multi (&dsi_ctx); + ret = dsi_ctx.accum_err;if (ret <0 ) {dev_err (panel->dev,"failed to set display on: %d\n" , ret);return ret;
drivers/gpu/drm/panel/panel-dsi-cm.c +6 -1
@@ -289,6 +289,10 @@ static int dsicm_power_on(struct panel_drv_data *ddata) ddata->dsi->mode_flags |=MIPI_DSI_MODE_LPM ; +struct mipi_dsi_multi_context ctx = { + .dsi = ddata->dsi, + }; + r =dsicm_sleep_out (ddata);if (r) goto err;
@@ -314,7 +318,8 @@ static int dsicm_power_on(struct panel_drv_data *ddata)if (r) goto err; - r =mipi_dsi_dcs_set_display_on (ddata->dsi); +mipi_dsi_dcs_set_display_on_multi (&ctx); + r = ctx.accum_err;if (r) goto err;
drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c +5 -2
@@ -344,12 +344,15 @@ static int k101_im2ba02_enable(struct drm_panel *panel) {struct k101_im2ba02 *ctx =panel_to_k101_im2ba02 (panel);const struct k101_im2ba02_init_cmd *cmd = &timed_cmds[1 ]; +struct mipi_dsi_multi_context dsi_ctx = { + .dsi = ctx->dsi, + };int ret;msleep (150 ); - ret =mipi_dsi_dcs_set_display_on (ctx->dsi); -if (ret <0 ) +mipi_dsi_dcs_set_display_on_multi (&dsi_ctx); +if (dsi_ctx.accum_err)return ret;msleep (50 );
drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c +5 -1
@@ -93,11 +93,15 @@ static int feiyang_prepare(struct drm_panel *panel)static int feiyang_enable (struct drm_panel *panel) {struct feiyang *ctx =panel_to_feiyang (panel); +struct mipi_dsi_multi_context dsi_ctx = { + .dsi = ctx->dsi, + };/* T12 (video & logic signal rise + backlight rise) T12 >= 200ms */ msleep (200 ); -return mipi_dsi_dcs_set_display_on (ctx->dsi); +mipi_dsi_dcs_set_display_on_multi (&dsi_ctx); +return dsi_ctx.accum_err; }static int feiyang_disable (struct drm_panel *panel)
drivers/gpu/drm/panel/panel-innolux-p079zca.c +6 -1
@@ -117,7 +117,12 @@ static int innolux_panel_prepare(struct drm_panel *panel)/* T6: 120ms - 1000ms*/ msleep (120 ); - err =mipi_dsi_dcs_set_display_on (innolux->link); +struct mipi_dsi_multi_context dsi_ctx = { + .dsi = innolux->link, + }; + +mipi_dsi_dcs_set_display_on_multi (&dsi_ctx); + err = dsi_ctx.accum_err;if (err <0 ) {dev_err (panel->dev,"failed to set display on: %d\n" , err); goto poweroff;
drivers/gpu/drm/panel/panel-khadas-ts050.c +6 -1
@@ -694,7 +694,12 @@ static int khadas_ts050_panel_prepare(struct drm_panel *panel) goto poweroff; } - err =mipi_dsi_dcs_set_display_on (khadas_ts050->link); +struct mipi_dsi_multi_context dsi_ctx = { + .dsi = khadas_ts050->link, + }; + +mipi_dsi_dcs_set_display_on_multi (&dsi_ctx); + err = dsi_ctx.accum_err;if (err <0 ) {dev_err (panel->dev,"failed to set display on: %d\n" , err); goto poweroff;
drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c +6 -1
@@ -250,7 +250,12 @@ static int kingdisplay_panel_prepare(struct drm_panel *panel)/* T6: 120ms */ msleep (120 ); - err =mipi_dsi_dcs_set_display_on (kingdisplay->link); +struct mipi_dsi_multi_context dsi_ctx = { + .dsi = kingdisplay->link, + }; + +mipi_dsi_dcs_set_display_on_multi (&dsi_ctx); + err = dsi_ctx.accum_err;if (err <0 ) {dev_err (panel->dev,"failed to set display on: %d\n" , err); goto poweroff;
drivers/gpu/drm/panel/panel-leadtek-ltk500hd1829.c +6 -1
@@ -553,7 +553,12 @@ static int ltk500hd1829_prepare(struct drm_panel *panel)/* 120ms to exit sleep mode */ msleep (120 ); - ret =mipi_dsi_dcs_set_display_on (dsi); +struct mipi_dsi_multi_context dsi_ctx = { + .dsi = dsi + }; + +mipi_dsi_dcs_set_display_on_multi (&dsi_ctx); + ret = dsi_ctx.accum_err;if (ret <0 ) {dev_err (panel->dev,"failed to set display on: %d\n" , ret); goto disable_iovcc;
drivers/gpu/drm/panel/panel-newvision-nv3051d.c +6 -1
@@ -303,7 +303,12 @@ static int panel_nv3051d_prepare(struct drm_panel *panel)msleep (200 ); - ret =mipi_dsi_dcs_set_display_on (dsi); +struct mipi_dsi_multi_context dsi_ctx = { + .dsi = dsi + }; + +mipi_dsi_dcs_set_display_on_multi (&dsi_ctx); + ret = dsi_ctx.accum_err;if (ret <0 ) {dev_err (ctx->dev,"Failed to set display on: %d\n" , ret); goto disable_vdd;
drivers/gpu/drm/panel/panel-novatek-nt35510.c +6 -1
@@ -1039,7 +1039,12 @@ static int nt35510_prepare(struct drm_panel *panel)return ret; } - ret =mipi_dsi_dcs_set_display_on (dsi); +struct mipi_dsi_multi_context dsi_ctx = { + .dsi = dsi + }; + +mipi_dsi_dcs_set_display_on_multi (&dsi_ctx); + ret = dsi_ctx.accum_err;if (ret) {dev_err (nt->dev,"failed to turn display on (%d)\n" , ret);return ret;
drivers/gpu/drm/panel/panel-raydium-rm67191.c +6 -1
@@ -371,7 +371,12 @@ static int rad_panel_enable(struct drm_panel *panel)usleep_range (5000 ,7000 ); - ret =mipi_dsi_dcs_set_display_on (dsi); +struct mipi_dsi_multi_context dsi_ctx = { + .dsi = dsi + }; + +mipi_dsi_dcs_set_display_on_multi (&dsi_ctx); + ret = dsi_ctx.accum_err;if (ret <0 ) {dev_err (dev,"Failed to set display ON (%d)\n" , ret); goto fail;
drivers/gpu/drm/panel/panel-raydium-rm68200.c +6 -1
@@ -281,7 +281,12 @@ static int rm68200_prepare(struct drm_panel *panel)msleep (125 ); - ret =mipi_dsi_dcs_set_display_on (dsi); +struct mipi_dsi_multi_context dsi_ctx = { + .dsi = dsi + }; + +mipi_dsi_dcs_set_display_on_multi (&dsi_ctx); + ret = dsi_ctx.accum_err;if (ret)return ret;
drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c +6 -1
@@ -389,7 +389,12 @@ static int s6e63j0x03_enable(struct drm_panel *panel)if (ret <0 )return ret; - ret =mipi_dsi_dcs_set_display_on (dsi); +struct mipi_dsi_multi_context dsi_ctx = { + .dsi = dsi + }; + +mipi_dsi_dcs_set_display_on_multi (&dsi_ctx); + ret = dsi_ctx.accum_err;if (ret <0 )return ret;
drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c +6 -1
@@ -206,7 +206,12 @@ static int sharp_panel_prepare(struct drm_panel *panel) goto poweroff; } - err =mipi_dsi_dcs_set_display_on (sharp->link1); +struct mipi_dsi_multi_context dsi_ctx = { + .dsi = sharp->link1, + }; + +mipi_dsi_dcs_set_display_on_multi (&dsi_ctx); + err = dsi_ctx.accum_err;if (err <0 ) {dev_err (panel->dev,"failed to set display on: %d\n" , err); goto poweroff;
Signature · 1 line
2.54.0
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [High] drm/panel: uninitialized return value in k101_im2ba02_enable() on DSI error - [Low] drm/panel…
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] drm/panel: uninitialized return value in k101_im2ba02_enable() on DSI error
- [Low] drm/panel: single-call mipi_dsi_multi_context misuse and duplicate dev_err() --
commit 98ea9fe2e57e340101561581a07219ed561f36d0
Author: amit <[email protected]>
drm/panel: Replace deprecated DCS display-on calls
This commit replaces calls to mipi_dsi_dcs_set_display_on() across 14 DRM panel drivers with mipi_dsi_dcs_set_display_on_multi() using a local mipi_dsi_multi_context structure.
Quoted 8 lines
drivers/gpu/drm/panel/panel-boe-himax8279d.c +0
-0@@ -155,7 +155,12 @@ static int boe_panel_prepare(struct drm_panel *panel)/* T6: 120ms - 121ms */ usleep_range (120000 ,121000 );
drivers/gpu/drm/panel/panel-boe-himax8279d.c static int boe_panel_prepare(struct drm_panel *panel) · line 166
Quoted 10 lines
drivers/gpu/drm/panel/panel-boe-himax8279d.c +6
-1- err =mipi_dsi_dcs_set_display_on (pinfo->link); +struct mipi_dsi_multi_context dsi_ctx = { + .dsi = pinfo->link, + }; + +mipi_dsi_dcs_set_display_on_multi (&dsi_ctx); + err = dsi_ctx.accum_err;if (err <0 ) {dev_err (panel->dev,"failed to set display on: %d\n" , err); goto poweroff;
[Severity: Low]
This isn't a bug, but is it intended to instantiate struct mipi_dsi_multi_context mid-function for just a single mipi_dsi_dcs_set_display_on_multi() call while leaving the surrounding DSI calls (such as mipi_dsi_dcs_exit_sleep_mode(), mipi_dsi_dcs_set_tear_on(), mipi_dsi_dcs_set_pixel_format(), and mipi_dsi_dcs_write_buffer()) unconverted?
In addition, mipi_dsi_dcs_set_display_on_multi() in drivers/gpu/drm/drm_mipi_dsi.c already logs an error on failure:
ret = mipi_dsi_dcs_set_display_on(dsi);
if (ret < 0) {
ctx->accum_err = ret;
dev_err(dev, "sending DCS SET_DISPLAY_ON failed: %d\n",
ctx->accum_err);
}Keeping the caller's dev_err() here in boe_panel_prepare() (as well as in boe_panel_enable(), innolux_panel_prepare(), khadas_ts050_panel_prepare(), kingdisplay_panel_prepare(), ltk500hd1829_prepare(), panel_nv3051d_prepare(), nt35510_prepare(), rad_panel_enable(), and sharp_panel_prepare()) will print duplicate error messages when setting the display on fails. Declaring dsi_ctx in the middle of the function after executable statements also introduces mixed declarations across 12 of the modified drivers (including dsicm_power_on(), rm68200_prepare(), and s6e63j0x03_enable()).
Should the full DSI command sequences in these functions be converted to use a single mipi_dsi_multi_context declared at the top of each function with the redundant dev_err() calls removed?
[ ... ]
Quoted 10 lines
drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c +2
-0@@ -344,12 +344,15 @@ static int k101_im2ba02_enable(struct drm_panel *panel) {struct k101_im2ba02 *ctx =panel_to_k101_im2ba02 (panel);const struct k101_im2ba02_init_cmd *cmd = &timed_cmds[1 ]; +struct mipi_dsi_multi_context dsi_ctx = { + .dsi = ctx->dsi,
drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c static int k101_im2ba02_enable(struct drm_panel *panel) · line 356
Quoted 10 lines
drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c +3
-2+ };int ret;msleep (150 ); - ret =mipi_dsi_dcs_set_display_on (ctx->dsi); -if (ret <0 ) +mipi_dsi_dcs_set_display_on_multi (&dsi_ctx); +if (dsi_ctx.accum_err)return ret;
[Severity: High]
In k101_im2ba02_enable(), doesn't this return the uninitialized local variable ret when mipi_dsi_dcs_set_display_on_multi() fails and sets dsi_ctx.accum_err?
Since ret is never initialized or assigned, returning ret on error triggers an uninitialized variable warning and can return a non-negative garbage value to drm_panel_enable(), causing it to treat a failed panel enable as successful while skipping the final mipi_dsi_dcs_write_buffer() command.
Should ret be removed and dsi_ctx.accum_err returned directly instead?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Linus Walleij
maintainerQuoted 2 lines · amit
Signed-off-by amit <[email protected]>
No commit message? Why?
Motivate the change, especially since it adds a lot of code to a lot of drivers.
I guess the motivation is multi-context but spell it out in the commit message.
Yours,
Linus Walleij
kernel test robot
build botkernel test robot noticed the following build warnings:
Hi amit,
kernel test robot noticed the following build warnings:
[auto build test WARNING on v7.4-rc1]
[also build test WARNING on linus/master next-20261105] [cannot apply to drm-misc/drm-misc-next]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/amit/drm-panel-Replace-deprecated-DCS-display-on-calls/20261104-093813 base: v7.4-rc1 patch link: https://lore.kernel.org/r/20261104073813.42429-1-amittibi123%40gmail.com patch subject: [PATCH] drm/panel: Replace deprecated DCS display-on calls config: loongarch-allmodconfig (https://download.01.org/0day-ci/archive/20261108/[email protected]/config) compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90) rustc: rustc 1.96.0 (ac68faa20 2026-05-25) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261108/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
>> drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c:356:10: warning: variable 'ret' is uninitialized when used here [-Wuninitialized]
356 | return ret;
| ^~~
drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c:350:9: note: initialize the variable 'ret' to silence this warning
350 | int ret;
| ^
| = 01 warning generated.
vim +/ret +356 drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c
fac47b1ebeda3b5 Icenowy Zheng 2020-01-16 342
fac47b1ebeda3b5 Icenowy Zheng 2020-01-16 343 static int k101_im2ba02_enable(struct drm_panel *panel)
fac47b1ebeda3b5 Icenowy Zheng 2020-01-16 344 {
fac47b1ebeda3b5 Icenowy Zheng 2020-01-16 345 struct k101_im2ba02 *ctx = panel_to_k101_im2ba02(panel);
fac47b1ebeda3b5 Icenowy Zheng 2020-01-16 346 const struct k101_im2ba02_init_cmd *cmd = &timed_cmds[1];
7bb5e5e01ffc36b amit 2026-11-04 347 struct mipi_dsi_multi_context dsi_ctx = {
7bb5e5e01ffc36b amit 2026-11-04 348 .dsi = ctx->dsi,
7bb5e5e01ffc36b amit 2026-11-04 349 };
fac47b1ebeda3b5 Icenowy Zheng 2020-01-16 350 int ret;
fac47b1ebeda3b5 Icenowy Zheng 2020-01-16 351
fac47b1ebeda3b5 Icenowy Zheng 2020-01-16 352 msleep(150);
fac47b1ebeda3b5 Icenowy Zheng 2020-01-16 353
7bb5e5e01ffc36b amit 2026-11-04 354 mipi_dsi_dcs_set_display_on_multi(&dsi_ctx);
7bb5e5e01ffc36b amit 2026-11-04 355 if (dsi_ctx.accum_err)
fac47b1ebeda3b5 Icenowy Zheng 2020-01-16 @356 return ret;
fac47b1ebeda3b5 Icenowy Zheng 2020-01-16 357
fac47b1ebeda3b5 Icenowy Zheng 2020-01-16 358 msleep(50);
fac47b1ebeda3b5 Icenowy Zheng 2020-01-16 359
fac47b1ebeda3b5 Icenowy Zheng 2020-01-16 360 return mipi_dsi_dcs_write_buffer(ctx->dsi, cmd->data, K101_IM2BA02_INIT_CMD_LEN);
fac47b1ebeda3b5 Icenowy Zheng 2020-01-16 361 }
fac47b1ebeda3b5 Icenowy Zheng 2020-01-16 362 --
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Thanks, I'll check them out.
Quoted 82 lines · On Sat, 7 Nov 2026 at 23:44 kernel test robot <[email protected]> wrote:
Hi amit,
kernel test robot noticed the following build warnings:
[auto build test WARNING on v7.4-rc1]
[also build test WARNING on linus/master next-20261105] [cannot apply to drm-misc/drm-misc-next]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]url:
https://github.com/intel-lab-lkp/linux/commits/amit/drm-panel-Replace-deprecated-DCS-display-on-calls/20261104-093813
base: v7.4-rc1
patch link:
https://lore.kernel.org/r/20261104073813.42429-1-amittibi123%40gmail.com
patch subject: [PATCH] drm/panel: Replace deprecated DCS display-on calls
config: loongarch-allmodconfig (
https://download.01.org/0day-ci/archive/20261108/[email protected]/config
)
compiler: clang version 19.1.7 (https://github.com/llvm/llvm-projectcd708029e0b2869e80abe31ddb175f7c35361f90)
rustc: rustc 1.96.0 (ac68faa202026-05-25)
reproduce (this is a W=1 build): (
https://download.01.org/0day-ci/archive/20261108/[email protected]/reproduce
)If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes:
https://lore.kernel.org/oe-kbuild-all/[email protected]/All warnings (new ones prefixed by >>):
Quoted 1 line
Quoted 1 line
drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c:356:10: warning:variable 'ret' is uninitialized when used here [-Wuninitialized]
356 | return ret; | ^~~ drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c:350:9: note: initialize the variable 'ret' to silence this warning 350 | int ret; | ^ | = 01 warning generated.
vim +/ret +356
drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c
fac47b1ebeda3b5Icenowy Zheng 2020-01-16 342fac47b1ebeda3b5Icenowy Zheng 2020-01-16 343 static intk101_im2ba02_enable(struct drm_panel *panel)fac47b1ebeda3b5Icenowy Zheng 2020-01-16 344 {fac47b1ebeda3b5Icenowy Zheng 2020-01-16 345 structk101_im2ba02*ctx =panel_to_k101_im2ba02(panel);fac47b1ebeda3b5Icenowy Zheng 2020-01-16 346 const structk101_im2ba02_init_cmd*cmd = &timed_cmds[1];7bb5e5e01ffc36bamit 2026-11-04 347 structmipi_dsi_multi_contextdsi_ctx= {7bb5e5e01ffc36b amit 2026-11-04 348 .dsi = ctx->dsi, 7bb5e5e01ffc36b amit 2026-11-04 349 }; fac47b1ebeda3b5 Icenowy Zheng 2020-01-16 350 int ret; fac47b1ebeda3b5 Icenowy Zheng 2020-01-16 351 fac47b1ebeda3b5 Icenowy Zheng 2020-01-16 352 msleep(150); fac47b1ebeda3b5 Icenowy Zheng 2020-01-16 353 7bb5e5e01ffc36b amit 2026-11-04 354 mipi_dsi_dcs_set_display_on_multi(&dsi_ctx); 7bb5e5e01ffc36b amit 2026-11-04 355 if (dsi_ctx.accum_err) fac47b1ebeda3b5 Icenowy Zheng 2020-01-16 @356 return ret; fac47b1ebeda3b5 Icenowy Zheng 2020-01-16 357 fac47b1ebeda3b5 Icenowy Zheng 2020-01-16 358 msleep(50); fac47b1ebeda3b5 Icenowy Zheng 2020-01-16 359 fac47b1ebeda3b5 Icenowy Zheng 2020-01-16 360 return
mipi_dsi_dcs_write_buffer(ctx->dsi, cmd->data, K101_IM2BA02_INIT_CMD_LEN);fac47b1ebeda3b5Icenowy Zheng 2020-01-16 361 }fac47b1ebeda3b5Icenowy Zheng 2020-01-16 362--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki