[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <j2uxa226jpttxlzycqpxya2zh34k5uvr2zyy7dhj3xjpouiybk@td6k2ebx5ji6>
Date: Sat, 8 Feb 2025 23:54:15 +0200
From: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
To: Doug Anderson <dianders@...omium.org>
Cc: Tejas Vipin <tejasvipin76@...il.com>, neil.armstrong@...aro.org,
maarten.lankhorst@...ux.intel.com, mripard@...nel.org, tzimmermann@...e.de, airlied@...il.com,
simona@...ll.ch, quic_jesszhan@...cinc.com, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/panel: visionox-r66451: transition to mipi_dsi
wrapped functions
On Sat, Feb 08, 2025 at 12:18:47PM -0800, Doug Anderson wrote:
> Hi,
>
> On Fri, Feb 7, 2025 at 9:16 PM Tejas Vipin <tejasvipin76@...il.com> wrote:
> >
> > Change the visionox-r66451 panel to use multi style functions for
> > improved error handling.
> >
> > Signed-off-by: Tejas Vipin <tejasvipin76@...il.com>
> > ---
> > drivers/gpu/drm/panel/panel-visionox-r66451.c | 179 ++++++++----------
> > 1 file changed, 76 insertions(+), 103 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/panel/panel-visionox-r66451.c b/drivers/gpu/drm/panel/panel-visionox-r66451.c
> > index 493f2a6076f8..81d615e1937a 100644
> > --- a/drivers/gpu/drm/panel/panel-visionox-r66451.c
> > +++ b/drivers/gpu/drm/panel/panel-visionox-r66451.c
> > @@ -42,85 +42,84 @@ static void visionox_r66451_reset(struct visionox_r66451 *ctx)
> > static int visionox_r66451_on(struct visionox_r66451 *ctx)
> > {
> > struct mipi_dsi_device *dsi = ctx->dsi;
> > + struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi };
> >
> > dsi->mode_flags |= MIPI_DSI_MODE_LPM;
> >
> > - mipi_dsi_dcs_write_seq(dsi, 0xb0, 0x00);
> > - mipi_dsi_dcs_write_seq(dsi, 0xc2,
> > - 0x09, 0x24, 0x0c, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
> > - 0x09, 0x3c);
[...]
> > + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf2, 0x19);
> > + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xdf, 0x50, 0x42);
> > + mipi_dsi_dcs_set_tear_on_multi(&dsi_ctx, MIPI_DSI_DCS_TEAR_MODE_VBLANK);
> > + mipi_dsi_dcs_set_column_address_multi(&dsi_ctx, 0, 1080 - 1);
> > + mipi_dsi_dcs_set_page_address_multi(&dsi_ctx, 0, 2340 - 1);
> >
> > dsi->mode_flags &= ~MIPI_DSI_MODE_LPM;
>
> I think that to match the old behavior the most correctly, you'd only
> want to clear MIPI_DSI_MODE_LPM if there were no errors, right? All of
> the old mipi_dsi_dcs_write_seq() calls would have returned early in
> the case of an error because of that non-obvious control flow.
>
> I'm not a total expert on MIPI_DSI_MODE_LPM, but I suspect your new
> behavior is actually more correct, but it might not hurt to at least
> point out this change in behavior in the commit message.
Yes, I think new behaviour is more correct. We should drop LPM flag
after sending init sequence.
--
With best wishes
Dmitry
Powered by blists - more mailing lists