All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Eric Anholt <eric@anholt.net>
Cc: Sean Paul <sean@poorly.run>, David Airlie <airlied@linux.ie>,
	linux-arm-msm <linux-arm-msm@vger.kernel.org>,
	etnaviv@lists.freedesktop.org,
	dri-devel <dri-devel@lists.freedesktop.org>,
	Maxime Ripard <maxime.ripard@bootlin.com>,
	Russell King <linux+etnaviv@armlinux.org.uk>,
	freedreno <freedreno@lists.freedesktop.org>
Subject: Re: [PATCH 4/5] drm: v3d: Switch to use drm_gem_object reservation_object
Date: Fri, 1 Feb 2019 11:38:25 -0600	[thread overview]
Message-ID: <CAL_JsqKxnr7k+U-6XOiwoATSzUA=+dzPQO-O12j0tcuBYVjicA@mail.gmail.com> (raw)
In-Reply-To: <87tvhn4emy.fsf@anholt.net>

On Fri, Feb 1, 2019 at 11:12 AM Eric Anholt <eric@anholt.net> wrote:
>
> Rob Herring <robh@kernel.org> writes:
>
> > Now that the base struct drm_gem_object has a reservation_object, use it
> > and remove the private BO one.
> >
> > Cc: Eric Anholt <eric@anholt.net>
> > Cc: Daniel Vetter <daniel@ffwll.ch>
> > Cc: David Airlie <airlied@linux.ie>
> > Cc: dri-devel@lists.freedesktop.org
> > Signed-off-by: Rob Herring <robh@kernel.org>
>
> > @@ -453,8 +453,6 @@ v3d_wait_bo_ioctl(struct drm_device *dev, void *data,
> >  {
> >       int ret;
> >       struct drm_v3d_wait_bo *args = data;
> > -     struct drm_gem_object *gem_obj;
> > -     struct v3d_bo *bo;
> >       ktime_t start = ktime_get();
> >       u64 delta_ns;
> >       unsigned long timeout_jiffies =
> > @@ -463,21 +461,8 @@ v3d_wait_bo_ioctl(struct drm_device *dev, void *data,
> >       if (args->pad != 0)
> >               return -EINVAL;
> >
> > -     gem_obj = drm_gem_object_lookup(file_priv, args->handle);
> > -     if (!gem_obj) {
> > -             DRM_DEBUG("Failed to look up GEM BO %d\n", args->handle);
> > -             return -EINVAL;
> > -     }
> > -     bo = to_v3d_bo(gem_obj);
> > -
> > -     ret = reservation_object_wait_timeout_rcu(bo->resv,
> > -                                               true, true,
> > -                                               timeout_jiffies);
> > -
> > -     if (ret == 0)
> > -             ret = -ETIME;
> > -     else if (ret > 0)
> > -             ret = 0;
> > +     ret = drm_gem_reservation_object_wait(file_priv, args->handle,
> > +                                           true, timeout_jiffies);
>
> Looks like you lost my ret handling in the change.

Indeed as initially I had moved that internal.

> Honestly, I'd love to see drm_gem_reservation_object_wait return
> sensible values like this (0 for success, -ETIME for timeouts) instead
> of drivers having to stubmle over this API.

Me too, but then I found some drivers use ETIMEDOUT instead. I didn't
really want to have to fixup one value to the other and gave up. They
also pass an absolute timeout instead.

Rob
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-02-01 17:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-01  0:50 [PATCH 0/5] Add reservation_object to drm_gem_object Rob Herring
2019-02-01  0:50 ` [PATCH 1/5] drm: " Rob Herring
2019-02-01 12:39   ` kbuild test robot
     [not found]   ` <20190201005057.13648-2-robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2019-02-01 17:21     ` Daniel Vetter
2019-02-01  0:50 ` [PATCH 5/5] drm: vc4: Switch to use drm_gem_object reservation_object Rob Herring
     [not found]   ` <20190201005057.13648-6-robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2019-02-01 17:13     ` Eric Anholt
     [not found] ` <20190201005057.13648-1-robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2019-02-01  0:50   ` [PATCH 2/5] drm: etnaviv: " Rob Herring
2019-02-01  0:50   ` [PATCH 3/5] drm: msm: " Rob Herring
2019-02-01  0:50   ` [PATCH 4/5] drm: v3d: " Rob Herring
     [not found]     ` <20190201005057.13648-5-robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2019-02-01 17:12       ` Eric Anholt
2019-02-01 17:38         ` Rob Herring [this message]
2019-02-01 17:23   ` [PATCH 0/5] Add reservation_object to drm_gem_object Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAL_JsqKxnr7k+U-6XOiwoATSzUA=+dzPQO-O12j0tcuBYVjicA@mail.gmail.com' \
    --to=robh@kernel.org \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=eric@anholt.net \
    --cc=etnaviv@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=linux+etnaviv@armlinux.org.uk \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=maxime.ripard@bootlin.com \
    --cc=sean@poorly.run \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.