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

Eric Anholt eric at anholt.net
Fri Feb 1 17:12:05 UTC 2019


Rob Herring <robh at 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 at anholt.net>
> Cc: Daniel Vetter <daniel at ffwll.ch>
> Cc: David Airlie <airlied at linux.ie>
> Cc: dri-devel at lists.freedesktop.org
> Signed-off-by: Rob Herring <robh at 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/freedreno/attachments/20190201/2f9022c1/attachment.sig>


More information about the Freedreno mailing list