[Intel-gfx] [PATCH v2] drm/i915: Avoid selecting unavailable BSD2 ring

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Tue Feb 23 11:05:43 UTC 2016


Hi,

On 23/02/16 10:52, Gabriel Feceoru wrote:
> Return error when I915_EXEC_BSD_RING2 flag is set but BSD2 ring
> is not available in the HW.

What is the reasoning behind this? So far kernel was allowing userspace 
to select these bits and execute on the first engine. With this patch it 
would start failing potentially breaking userspace. Is it not too late 
to make such change?

Regards,

Tvrtko

> v2: Reworked
> Signed-off-by: Gabriel Feceoru <gabriel.feceoru at intel.com>
> ---
>   drivers/gpu/drm/i915/i915_gem_execbuffer.c | 7 +++++++
>   1 file changed, 7 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> index 8fd00d2..9fbd023 100644
> --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> @@ -1394,6 +1394,13 @@ eb_select_ring(struct drm_i915_private *dev_priv,
>   		return -EINVAL;
>   	}
>
> +	if ((user_ring_id == I915_EXEC_BSD) && !HAS_BSD2(dev_priv) &&
> +			((args->flags & I915_EXEC_BSD_MASK) != 0)) {
> +		DRM_DEBUG("execbuf with bsd ring but with invalid "
> +			  "bsd dispatch flags: %d\n", (int)(args->flags));
> +		return -EINVAL;
> +	}
> +
>   	if (user_ring_id == I915_EXEC_BSD && HAS_BSD2(dev_priv)) {
>   		unsigned int bsd_idx = args->flags & I915_EXEC_BSD_MASK;
>
>


More information about the Intel-gfx mailing list