From: "Nicolás Antinori" <nico.antinori.7@gmail.com>
To: "Doug Anderson" <dianders@chromium.org>
Cc: "Krzysztof Kozlowski" <krzk@kernel.org>,
"Brigham Campbell" <me@brighamcampbell.com>,
"David Airlie" <airlied@gmail.com>,
"Jessica Zhang" <jesszhan0024@gmail.com>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Neil Armstrong" <neil.armstrong@linaro.org>,
"Shuah Khan" <skhan@linuxfoundation.org>,
"Simona Vetter" <simona@ffwll.ch>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
<dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
<linux-kernel-mentees@lists.linux.dev>
Subject: Re: [PATCH] drm/panel: novatek-nt37801: Use mipi_dsi_*_multi() functions
Date: Mon, 06 Jul 2026 09:34:34 -0300 [thread overview]
Message-ID: <DJRHPZG7YKTX.1HUB8IXSAR0R0@gmail.com> (raw)
In-Reply-To: <CAD=FV=VKKb1Xy2Y7D1Lv8DXhaG1_zHZqTk2Q74oT-YKGd5CCiQ@mail.gmail.com>
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
> <nico.antinori.7@gmail.com> 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 <nico.antinori.7@gmail.com>
>> ---
>> 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 <dianders@chromium.org>
>
> 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!
prev parent reply other threads:[~2026-07-06 12:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-01 12:56 [PATCH] drm/panel: novatek-nt37801: Use mipi_dsi_*_multi() functions Nicolás Antinori
2026-07-04 15:59 ` Doug Anderson
2026-07-06 12:34 ` Nicolás Antinori [this message]
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=DJRHPZG7YKTX.1HUB8IXSAR0R0@gmail.com \
--to=nico.antinori.7@gmail.com \
--cc=airlied@gmail.com \
--cc=dianders@chromium.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=jesszhan0024@gmail.com \
--cc=krzk@kernel.org \
--cc=linux-kernel-mentees@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=me@brighamcampbell.com \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=simona@ffwll.ch \
--cc=skhan@linuxfoundation.org \
--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