[Intel-gfx] [PATCH] drm/i915: WARN if the fence pin_count is invalid

Daniel Vetter daniel at ffwll.ch
Wed Jun 12 12:36:57 CEST 2013


On Wed, Jun 12, 2013 at 11:29:47AM +0100, Chris Wilson wrote:
> Stéphane Marchesin found a bug where the fences were not being restored,
> and in particular the fence pin_count was incorrect. Had we had a
> warning in place, this bug would have come to light much earlier. Better
> late than never?

Indeed. Queued for -next, thanks for the patch.
-Daniel

> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
> Cc: Stéphane Marchesin <marcheu at chromium.org>
> ---
>  drivers/gpu/drm/i915/i915_drv.h |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 1a67216..041091d 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1722,6 +1722,7 @@ i915_gem_object_unpin_fence(struct drm_i915_gem_object *obj)
>  {
>  	if (obj->fence_reg != I915_FENCE_REG_NONE) {
>  		struct drm_i915_private *dev_priv = obj->base.dev->dev_private;
> +		WARN_ON(dev_priv->fence_regs[obj->fence_reg].pin_count <= 0);
>  		dev_priv->fence_regs[obj->fence_reg].pin_count--;
>  	}
>  }
> -- 
> 1.7.10.4
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch



More information about the Intel-gfx mailing list