Re: [PATCH 3/5] drm/msm: Remove call to reservation_object_test_signaled_rcu before wait

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 11, 2016 at 11:19:50PM +0530, Sumit Semwal wrote:
> Hi Chris,
> 
> On 11 August 2016 at 20:16, Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> wrote:
> > Since fence_wait_timeout_reservation_object_wait_timeout_rcu() with a
> > timeout of 0 becomes reservation_object_test_signaled_rcu(), we do not
> > need to handle such conversion in the caller. The only challenge are
> > those callers that wish to differentiate the error code between the
> > nonblocking busy check and potentially blocking wait.
> >
> > Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> > Cc: Rob Clark <robdclark@xxxxxxxxx>
> > ---
> >  drivers/gpu/drm/msm/msm_gem.c | 22 ++++++++++------------
> >  1 file changed, 10 insertions(+), 12 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c
> > index 6cd4af443139..ab07eb6de25e 100644
> > --- a/drivers/gpu/drm/msm/msm_gem.c
> > +++ b/drivers/gpu/drm/msm/msm_gem.c
> > @@ -584,18 +584,16 @@ int msm_gem_cpu_prep(struct drm_gem_object *obj, uint32_t op, ktime_t *timeout)
> >  {
> >         struct msm_gem_object *msm_obj = to_msm_bo(obj);
> >         bool write = !!(op & MSM_PREP_WRITE);
> > -
> > -       if (op & MSM_PREP_NOSYNC) {
> > -               if (!reservation_object_test_signaled_rcu(msm_obj->resv, write))
> > -                       return -EBUSY;
> > -       } else {
> > -               int ret;
> > -
> > -               ret = reservation_object_wait_timeout_rcu(msm_obj->resv, write,
> > -                               true, timeout_to_jiffies(timeout));
> > -               if (ret <= 0)
> > -                       return ret == 0 ? -ETIMEDOUT : ret;
> > -       }
> > +       unsigned long remain =
> > +               op & MSG_PREP_NOSYNC ? 0 : timeout_to_jiffies(timeout);
> > +       long ret;
> > +
> > +       ret = reservation_object_wait_timeout_rcu(msm_obj->resv, write,
> > +                                                 true,  remain);
> > +       if (ret == 0)
> > +               return remain == 9 ? -EBUSY : -ETIMEDOUT;
> 
> Am sure this must be a typo - 0 instead of 9?

Eek. It's close, but not that close.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux