[Intel-gfx] [PATCH v1.1 1/5] drm/i915: Handle return value in intel_pin_and_fence_fb_obj, v2.

Ander Conselvan De Oliveira conselvan2 at gmail.com
Fri Jul 24 06:26:27 PDT 2015


On Tue, 2015-07-21 at 16:09 +0200, Maarten Lankhorst wrote:
> -EDEADLK has special meaning in atomic, but get_fence may call
> i915_find_fence_reg which can return -EDEADLK.
> 
> This has special meaning in the atomic world, so convert the error
> to -EBUSY for this case.

Doesn't this change the behavior of intel_crtc_page_flip() slightly? It
now would return -EBUSY to user space if it can't find a fence instead
of -EDEADLK. Not sure if that is a problem though. I don't expect user
space would actually check for -EDEADLK.

Ander

> Changes since v1:
> - Add comment in the code.
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
> ---
> Like this?
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c 
> b/drivers/gpu/drm/i915/intel_display.c
> index af0bcfee4771..11387f5ed681 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -2395,8 +2395,20 @@ intel_pin_and_fence_fb_obj(struct drm_plane 
> *plane,
>  	 * a fence as the cost is not that onerous.
>  	 */
>  	ret = i915_gem_object_get_fence(obj);
> -	if (ret)
> +	if (ret) {
> +		if (ret == -EDEADLK) {
> +			/*
> +			 * -EDEADLK means there are no free fences
> +			 * and no pending flips.
> +			 *
> +			 * This is propagated to atomic, but it uses
> +			 * -EDEADLK to force a locking recovery, so
> +			 * change the returned error to -EBUSY.
> +			 */
> +			ret = -EBUSY;
> +		}
>  		goto err_unpin;
> +	}
>  
>  	i915_gem_object_pin_fence(obj);
>  
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx


More information about the Intel-gfx mailing list