[PATCH 10/13] drm/radeon: return -ENOENT in fence_wait_*

Michel Dänzer michel at daenzer.net
Fri Apr 20 00:20:12 PDT 2012


On Fre, 2012-04-20 at 00:39 +0200, Christian König wrote: 
> Signed-off-by: Christian König <deathsimple at vodafone.de>
> ---
>  drivers/gpu/drm/radeon/radeon_fence.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c
> index 1a9765a..764ab7e 100644
> --- a/drivers/gpu/drm/radeon/radeon_fence.c
> +++ b/drivers/gpu/drm/radeon/radeon_fence.c
> @@ -286,7 +286,7 @@ int radeon_fence_wait_next(struct radeon_device *rdev, int ring)
>  	}
>  	if (list_empty(&rdev->fence_drv[ring].emitted)) {
>  		write_unlock_irqrestore(&rdev->fence_lock, irq_flags);
> -		return 0;
> +		return -ENOENT;
>  	}
>  	fence = list_entry(rdev->fence_drv[ring].emitted.next,
>  			   struct radeon_fence, list);
> @@ -310,7 +310,7 @@ int radeon_fence_wait_last(struct radeon_device *rdev, int ring)
>  	}
>  	if (list_empty(&rdev->fence_drv[ring].emitted)) {
>  		write_unlock_irqrestore(&rdev->fence_lock, irq_flags);
> -		return 0;
> +		return -ENOENT;
>  	}
>  	fence = list_entry(rdev->fence_drv[ring].emitted.prev,
>  			   struct radeon_fence, list);

It seems weird to declare a fence wait as failed when there are no
outstanding fences in the first place. If there are callers which
require outstanding fences, they should probably handle that themselves.


-- 
Earthling Michel Dänzer           |                   http://www.amd.com
Libre software enthusiast         |          Debian, X and DRI developer


More information about the dri-devel mailing list