On Sat Jul 4, 2026 at 12:59 PM -03, Doug Anderson wrote: > Hi, > > On Wed, Jul 1, 2026 at 5:56 AM Nicolás Antinori > <[email protected]> wrote: >> >> Replace mipi_dsi_* functions with their non-deprecated mipi_dsi_*_multi >> counterparts. This change reduces error-checking boilerplate and improves >> readability. >> >> Signed-off-by: Nicolás Antinori <[email protected]> >> --- >> Note: I Compile-tested this patch since I don't own the panel to test it. >> >> drivers/gpu/drm/panel/panel-novatek-nt37801.c | 16 ++++++---------- >> 1 file changed, 6 insertions(+), 10 deletions(-) >> >> diff --git a/drivers/gpu/drm/panel/panel-novatek-nt37801.c >> b/drivers/gpu/drm/panel/panel-novatek-nt37801.c >> index d6a37d7e0cc6..daa356bbc182 100644 >> --- a/drivers/gpu/drm/panel/panel-novatek-nt37801.c >> +++ b/drivers/gpu/drm/panel/panel-novatek-nt37801.c >> @@ -128,7 +128,8 @@ static int novatek_nt37801_off(struct novatek_nt37801 >> *ctx) >> static int novatek_nt37801_prepare(struct drm_panel *panel) >> { >> struct novatek_nt37801 *ctx = to_novatek_nt37801(panel); >> - struct device *dev = &ctx->dsi->dev; >> + struct mipi_dsi_device *dsi = ctx->dsi; >> + struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi }; >> struct drm_dsc_picture_parameter_set pps; >> int ret; >> >> @@ -145,15 +146,10 @@ static int novatek_nt37801_prepare(struct drm_panel >> *panel) >> >> drm_dsc_pps_payload_pack(&pps, &ctx->dsc); >> >> - ret = mipi_dsi_picture_parameter_set(ctx->dsi, &pps); >> - if (ret < 0) { >> - dev_err(panel->dev, "failed to transmit PPS: %d\n", ret); >> - goto err; >> - } >> - >> - ret = mipi_dsi_compression_mode(ctx->dsi, true); >> - if (ret < 0) { >> - dev_err(dev, "failed to enable compression mode: %d\n", ret); >> + mipi_dsi_picture_parameter_set_multi(&dsi_ctx, &pps); >> + mipi_dsi_compression_mode_multi(&dsi_ctx, true); >> + if (dsi_ctx.accum_err) { >> + ret = dsi_ctx.accum_err; >> goto err; >> } > > Sure, this looks pretty good. > > Reviewed-by: Douglas Anderson <[email protected]> > > For bonus points, I think you could change novatek_nt37801_on() to > return "void" and take a "struct mipi_dsi_multi_context". Since > drm_dsc_pps_payload_pack() is harmless, the function can now just be: > > novatek_nt37801_on(&dsi_ctx); > drm_dsc_pps_payload_pack(&pps, &ctx->dsc); > mipi_dsi_picture_parameter_set_multi(&dsi_ctx, &pps); > mipi_dsi_compression_mode_multi(&dsi_ctx, true); > if (dsi_ctx.accum_err) { > ... > }
Will send a v2 with those changes. Thank you for the suggestion!
