[PATCH] drm/mipi-dsi: Reduce driver bloat of mipi_dsi_*_write_seq()

Doug Anderson dianders at chromium.org
Sat Apr 27 00:01:21 UTC 2024


Hi,

On Fri, Apr 26, 2024 at 8:28 AM Doug Anderson <dianders at chromium.org> wrote:
>
> > I don't find this unintuitive, but if it helps, you could conceivably
> > add a context parameter:
> >
> >         struct mipi_dsi_seq_context context = {
> >                 .dsi = dsi,
> >         };
> >
> >         mipi_dsi_dcs_write_seq(&context, HX83102_SETSPCCMD, 0xcd);
> >         ...
> >
> >         if (context.ret)
> >                 ...
> >
> > And even have further control in the context whether to log or keep
> > going or whatever.
>
> I agree there are some benefits of adding the extra "context"
> abstraction and we can go that way if you want, but I lean towards the
> simplicity of just passing in the accumulated return value like I did
> in my example.
>
>
> I'll try to write up patches and see if I can post them later today.

FWIW, I went with your "context" idea. In the end, I liked how it
looked and the icing on the cake was that it generated even smaller
code! :-)

My v2 series (now 8 patches long) is at:

https://lore.kernel.org/r/20240426235857.3870424-1-dianders@chromium.org


-Doug


More information about the dri-devel mailing list