[Intel-gfx] [PATCH v2 2/4] drm/i915: Bump pin_count to 255.

Daniel Vetter daniel at ffwll.ch
Tue May 24 14:28:50 UTC 2016


On Tue, May 24, 2016 at 01:24:09PM +0200, Maarten Lankhorst wrote:
> With nonblocking unpin there can be many cursor pins before they're
> cleared by the next page flip.
> 
> Fix this by extending pin_count to 255 to prevent a
> WARN_ON(vma->pin_count == DRM_I915_GEM_OBJECT_MAX_PIN_COUNT)
> 
> Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
> Reported-by: Chris Wilson <chris at chris-wilson.co.uk>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
> Fixes: a6747b7304a9 ("drm/i915: Make unpin async.")
> ---
>  drivers/gpu/drm/i915/i915_gem_gtt.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.h b/drivers/gpu/drm/i915/i915_gem_gtt.h
> index 62be77cac5cd..bb53c285eef7 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.h
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.h
> @@ -218,8 +218,8 @@ struct i915_vma {
>  	 *
>  	 * In the worst case this is 1 + 1 + 1 + 2*2 = 7. That would fit into 3
>  	 * bits with absolutely no headroom. So use 4 bits. */
> -	unsigned int pin_count:4;
> -#define DRM_I915_GEM_OBJECT_MAX_PIN_COUNT 0xf
> +	unsigned int pin_count;
> +#define DRM_I915_GEM_OBJECT_MAX_PIN_COUNT 255

Nack. We can't just leak all over the place imo, so if this is the fix it
needs a _much_ better explanation for why it happens now, why it's
inevitable, why there's no better fix, what other fixes have been
considered and why a revert of the offending patch is not the better
course of action.
-Daneil

>  };
>  
>  struct i915_page_dma {
> -- 
> 2.5.5
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the Intel-gfx mailing list