[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAD=FV=V4DAUGEapnre1C0HJ80ooHJU=7fy+JESbRtnJEiL3gCA@mail.gmail.com>
Date: Fri, 26 Apr 2024 17:01:21 -0700
From: Doug Anderson <dianders@...omium.org>
To: Jani Nikula <jani.nikula@...ux.intel.com>
Cc: dri-devel@...ts.freedesktop.org,
Javier Martinez Canillas <javierm@...hat.com>, Neil Armstrong <neil.armstrong@...aro.org>,
Dmitry Baryshkov <dmitry.baryshkov@...aro.org>, linus.walleij@...aro.org,
Cong Yang <yangcong5@...qin.corp-partner.google.com>,
lvzhaoxiong@...qin.corp-partner.google.com, Hsin-Yi Wang <hsinyi@...gle.com>,
Sam Ravnborg <sam@...nborg.org>, Daniel Vetter <daniel@...ll.ch>, David Airlie <airlied@...il.com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>, Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/mipi-dsi: Reduce driver bloat of mipi_dsi_*_write_seq()
Hi,
On Fri, Apr 26, 2024 at 8:28 AM Doug Anderson <dianders@...omium.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
Powered by blists - more mailing lists