Rob Herring <r...@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 <e...@anholt.net>
> Cc: Daniel Vetter <dan...@ffwll.ch>
> Cc: David Airlie <airl...@linux.ie>
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Rob Herring <r...@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.

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.

Attachment: signature.asc
Description: PGP signature

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

Reply via email to