[Intel-gfx] [PATCH v2] drm/i915: Decouple execbuf uAPI from internal implementation

Chris Wilson chris at chris-wilson.co.uk
Fri Jan 15 07:53:26 PST 2016


On Fri, Jan 15, 2016 at 03:12:50PM +0000, Tvrtko Ursulin wrote:
> +static int
> +eb_select_ring(struct drm_i915_private *dev_priv,
> +	       struct drm_file *file,
> +	       struct drm_i915_gem_execbuffer2 *args,
> +	       struct intel_engine_cs **ring)
> +{
> +	unsigned int user_ring_id = args->flags & I915_EXEC_RING_MASK;
> +
> +	if (user_ring_id > I915_USER_RINGS) {
> +		DRM_DEBUG("execbuf with unknown ring: %u\n", user_ring_id);
> +		return -EINVAL;
> +	}
> +
> +	if ((user_ring_id != I915_EXEC_BSD) &&
> +	    ((args->flags & I915_EXEC_BSD_MASK) != 0)) {
> +		DRM_DEBUG("execbuf with non bsd ring but with invalid "
> +			  "bsd dispatch flags: %d\n", (int)(args->flags));

Not your bug, but we should limit the flags reported here to
(int)(args->flags & I915_EXEC_BSD_MASK).

Though actually just nuke the test. At the moment, we complain for !BSD,
then allow them even if we don't have BSD2 (and ignore the setting).
A little inconsistent.

If we just document that these flags only provide extra selection
criteria for the I915_EXEC_BSD ring, we would be done. I'll pretend that
it is adequately documented...

Looks good and we completed our review of ABI impact for reordering
the ring ids, so

Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list