[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <7unkxysvdn57fp6t7sjmgqsiacg5grbrk4lp3fbfdvaht3hq4o@gqshn45sa5ww>
Date: Thu, 23 Jan 2025 13:05:47 +0200
From: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
To: Jani Nikula <jani.nikula@...ux.intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>, Rob Clark <robdclark@...il.com>,
Abhinav Kumar <quic_abhinavk@...cinc.com>, Sean Paul <sean@...rly.run>,
Marijn Suijten <marijn.suijten@...ainline.org>, dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
linux-arm-msm@...r.kernel.org, freedreno@...ts.freedesktop.org
Subject: Re: [PATCH RFC 4/7] drm/display: dp-aux-dev: use new DCPD access
helpers
On Thu, Jan 23, 2025 at 12:05:29PM +0200, Jani Nikula wrote:
> On Fri, 17 Jan 2025, Dmitry Baryshkov <dmitry.baryshkov@...aro.org> wrote:
> > Switch drm_dp_aux_dev.c to use new set of DPCD read / write helpers.
>
> This might be one of the few places where the old functions and the old
> return value was used in a sensible manner.
Well... Yes and no. What does it mean if we return less bytes? Is that
still a protocol error?
>
> BR,
> Jani.
>
> >
> > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
> > ---
> > drivers/gpu/drm/display/drm_dp_aux_dev.c | 12 +++++-------
> > 1 file changed, 5 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/display/drm_dp_aux_dev.c b/drivers/gpu/drm/display/drm_dp_aux_dev.c
> > index 29555b9f03c8c42681c17c4a01e74a966cf8611f..a31ab3f41efb71fd5f936c24ba5c3b8ebea68a5e 100644
> > --- a/drivers/gpu/drm/display/drm_dp_aux_dev.c
> > +++ b/drivers/gpu/drm/display/drm_dp_aux_dev.c
> > @@ -163,17 +163,16 @@ static ssize_t auxdev_read_iter(struct kiocb *iocb, struct iov_iter *to)
> > break;
> > }
> >
> > - res = drm_dp_dpcd_read(aux_dev->aux, pos, buf, todo);
> > -
> > + res = drm_dp_dpcd_read_data(aux_dev->aux, pos, buf, todo);
> > if (res <= 0)
> > break;
> >
> > - if (copy_to_iter(buf, res, to) != res) {
> > + if (copy_to_iter(buf, todo, to) != todo) {
> > res = -EFAULT;
> > break;
> > }
> >
> > - pos += res;
> > + pos += todo;
> > }
> >
> > if (pos != iocb->ki_pos)
> > @@ -211,12 +210,11 @@ static ssize_t auxdev_write_iter(struct kiocb *iocb, struct iov_iter *from)
> > break;
> > }
> >
> > - res = drm_dp_dpcd_write(aux_dev->aux, pos, buf, todo);
> > -
> > + res = drm_dp_dpcd_write_data(aux_dev->aux, pos, buf, todo);
> > if (res <= 0)
> > break;
> >
> > - pos += res;
> > + pos += todo;
> > }
> >
> > if (pos != iocb->ki_pos)
>
> --
> Jani Nikula, Intel
--
With best wishes
Dmitry
Powered by blists - more mailing lists