[Intel-gfx] [PATCH] drm/i915: Fix VCS ring selection after uapi decoupling

Chris Wilson chris at chris-wilson.co.uk
Wed Jan 27 05:00:50 PST 2016


On Wed, Jan 27, 2016 at 12:38:43PM +0000, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> 
> This got broken in:
> 
>    commit de1add360522c876c25ef2bbbbab1c94bdb509ab
>    Author: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
>    Date:   Fri Jan 15 15:12:50 2016 +0000
> 
>        drm/i915: Decouple execbuf uAPI from internal implementation
> 
> BSD ring flags need to be shifted before they can be considered
> indices into the ring array.
> 
> Reported by Zhipeng Gong.
> 

This should be hit by gem_busy on appropriate hardware. I need to add
the extra ring to gem_exec_nop and make those all basic test.

> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Zhipeng Gong <zhipeng.gong at intel.com>
> ---
>  drivers/gpu/drm/i915/i915_gem_execbuffer.c | 11 +++++++----
>  include/uapi/drm/i915_drm.h                | 10 ++++++----
>  2 files changed, 13 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> index 2dc08ce1079a..6fc620af14fa 100644
> --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> @@ -1395,12 +1395,15 @@ eb_select_ring(struct drm_i915_private *dev_priv,
>  	}
>  
>  	if (user_ring_id == I915_EXEC_BSD && HAS_BSD2(dev_priv)) {
> -		unsigned int bsd_idx = args->flags & I915_EXEC_BSD_MASK;
> +		unsigned int bsd_idx = (args->flags & I915_EXEC_BSD_MASK) >>
> +					I915_EXEC_BSD_SHIFT;
>  
> -		if (bsd_idx == I915_EXEC_BSD_DEFAULT) {
> +		if (bsd_idx == (I915_EXEC_BSD_DEFAULT >> I915_EXEC_BSD_SHIFT)) {
>  			bsd_idx = gen8_dispatch_bsd_ring(dev_priv, file);
> -		} else if (bsd_idx >= I915_EXEC_BSD_RING1 &&
> -			   bsd_idx <= I915_EXEC_BSD_RING2) {
> +		} else if (bsd_idx >=
> +			  (I915_EXEC_BSD_RING1 >> I915_EXEC_BSD_SHIFT) &&
> +			  bsd_idx <=
> +			  (I915_EXEC_BSD_RING2 >> I915_EXEC_BSD_SHIFT)) {

Wouldn't inserting bsd_idx >>= I915_EXEC_BSD_SHIFT; here be simpler ?
>  			bsd_idx--;

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list