From: Neil Armstrong <neil.armstrong@linaro.org>
To: Anusha Srivatsa <asrivats@redhat.com>,
Jessica Zhang <quic_jesszhan@quicinc.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>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
Tejas Vipin <tejasvipin76@gmail.com>,
Doug Anderson <dianders@chromium.org>
Subject: Re: [PATCH v3] drm/panel/sharp-ls043t1le01: Use _multi variants
Date: Thu, 27 Mar 2025 09:06:20 +0100 [thread overview]
Message-ID: <3b91b3ce-92ca-4499-b3ba-e4f93d005136@linaro.org> (raw)
In-Reply-To: <20250326-b4-panel-ls043t1le01-v3-1-96c554c0ea2b@redhat.com>
On 27/03/2025 04:29, Anusha Srivatsa wrote:
> Move away from using deprecated API and use _multi variants
> if available. Use mipi_dsi_msleep() and mipi_dsi_usleep_range()
> instead of msleep() and usleep_range() respectively.
>
> Used Coccinelle to find the _multi variant APIs,replacing
> mpi_dsi_msleep() where necessary and for returning
> dsi_ctx.accum_err in these functions. mipi_dsi_dcs_write()
> does not have a corresponding _multi() variant. Replacing it with
> mipi_dsi_dcs_write_seq_multi() instead. This change is manual.
>
> The Coccinelle script is the same as the one in commit c8ba07caaecc
> ("drm/panel/synaptics-r63353: Use _multi variants")
>
> v2: Use mipi_dsi_write_buffer_multi() in place of
> mipi_dsi_dcs_write(). (Dmitry)
>
> v3: add commit details where the same coccinelle script is
> used and remove the actual script from commit log.
> Use mipi_dsi_dcs_write_seq_multi() for mipi_dsi_dcs_write() (Doug)
>
> Cc: Maxime Ripard <mripard@kernel.org>
> Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> Cc: Tejas Vipin <tejasvipin76@gmail.com>
> Cc: Doug Anderson <dianders@chromium.org>
> Signed-off-by: Anusha Srivatsa <asrivats@redhat.com>
> ---
> Changes in v3:
> - Simplify commit log by adding a reference to a patch that uses the
> same script.
> - Simplify code by using a helper that doesnt need additional code
> changes other then using the helper itself.
>
> - Link to v2: https://lore.kernel.org/r/20250324-b4-panel-ls043t1le01-v2-1-e43aedc115be@redhat.com
>
> Changes in v2:
> - While mipi_dsi_dcs_write() does not have a corresponding _multi()
> variant replace it with mipi_dsi_dcs_write_buffer_multi() to have all
> APIs following _multi() usage for easier error handling
>
> - Link to v1: https://lore.kernel.org/r/20250316-b4-panel-ls043t1le01-v1-1-ee38371b0ba0@redhat.com
> ---
> drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c | 41 +++++++++----------------
> 1 file changed, 15 insertions(+), 26 deletions(-)
>
> diff --git a/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c b/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c
> index 729cbb0d8403ff7c0c4b9d21774909cc298904a2..36abfa2e65e962af2a08aec3e63ba1077a2c43d4 100644
> --- a/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c
> +++ b/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c
> @@ -36,60 +36,49 @@ static inline struct sharp_nt_panel *to_sharp_nt_panel(struct drm_panel *panel)
> static int sharp_nt_panel_init(struct sharp_nt_panel *sharp_nt)
> {
> struct mipi_dsi_device *dsi = sharp_nt->dsi;
> - int ret;
> + struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi };
>
> dsi->mode_flags |= MIPI_DSI_MODE_LPM;
>
> - ret = mipi_dsi_dcs_exit_sleep_mode(dsi);
> - if (ret < 0)
> - return ret;
> + mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx);
>
> - msleep(120);
> + mipi_dsi_msleep(&dsi_ctx, 120);
>
> /* Novatek two-lane operation */
> - ret = mipi_dsi_dcs_write(dsi, 0xae, (u8[]){ 0x03 }, 1);
> - if (ret < 0)
> - return ret;
> + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xae, 0x03);
>
> /* Set both MCU and RGB I/F to 24bpp */
> - ret = mipi_dsi_dcs_set_pixel_format(dsi, MIPI_DCS_PIXEL_FMT_24BIT |
> - (MIPI_DCS_PIXEL_FMT_24BIT << 4));
> - if (ret < 0)
> - return ret;
> + mipi_dsi_dcs_set_pixel_format_multi(&dsi_ctx,
> + MIPI_DCS_PIXEL_FMT_24BIT |
> + (MIPI_DCS_PIXEL_FMT_24BIT << 4));
>
> - return 0;
> + return dsi_ctx.accum_err;
> }
>
> static int sharp_nt_panel_on(struct sharp_nt_panel *sharp_nt)
> {
> struct mipi_dsi_device *dsi = sharp_nt->dsi;
> - int ret;
> + struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi };
>
> dsi->mode_flags |= MIPI_DSI_MODE_LPM;
>
> - ret = mipi_dsi_dcs_set_display_on(dsi);
> - if (ret < 0)
> - return ret;
> + mipi_dsi_dcs_set_display_on_multi(&dsi_ctx);
>
> - return 0;
> + return dsi_ctx.accum_err;
> }
>
> static int sharp_nt_panel_off(struct sharp_nt_panel *sharp_nt)
> {
> struct mipi_dsi_device *dsi = sharp_nt->dsi;
> - int ret;
> + struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi };
>
> dsi->mode_flags &= ~MIPI_DSI_MODE_LPM;
>
> - ret = mipi_dsi_dcs_set_display_off(dsi);
> - if (ret < 0)
> - return ret;
> + mipi_dsi_dcs_set_display_off_multi(&dsi_ctx);
>
> - ret = mipi_dsi_dcs_enter_sleep_mode(dsi);
> - if (ret < 0)
> - return ret;
> + mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx);
>
> - return 0;
> + return dsi_ctx.accum_err;
> }
>
> static int sharp_nt_panel_unprepare(struct drm_panel *panel)
>
> ---
> base-commit: dbe74119ff71c00f2d863a32f72aab2d15e61c39
> change-id: 20250316-b4-panel-ls043t1le01-7407b896b7a8
>
> Best regards,
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
next prev parent reply other threads:[~2025-03-27 8:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-27 3:29 Anusha Srivatsa
2025-03-27 8:06 ` Neil Armstrong [this message]
2025-03-27 20:54 ` Doug Anderson
2025-03-30 17:14 ` Dmitry Baryshkov
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=3b91b3ce-92ca-4499-b3ba-e4f93d005136@linaro.org \
--to=neil.armstrong@linaro.org \
--cc=airlied@gmail.com \
--cc=asrivats@redhat.com \
--cc=dianders@chromium.org \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=quic_jesszhan@quicinc.com \
--cc=simona@ffwll.ch \
--cc=tejasvipin76@gmail.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
all inboxes | Powered by JetHome®