Re: [PATCH 4/5] drm: v3d: Switch to use drm_gem_object reservation_object

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

 



Rob Herring <robh@xxxxxxxxxx> 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@xxxxxxxxxx>
> Cc: Daniel Vetter <daniel@xxxxxxxx>
> Cc: David Airlie <airlied@xxxxxxxx>
> Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx
> Signed-off-by: Rob Herring <robh@xxxxxxxxxx>

> @@ -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@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