[Intel-gfx] [PATCH 2/2] drm/i915/bdw: Expose I915_EXEC_RESOURCE_STREAMER flag
Chris Wilson
chris at chris-wilson.co.uk
Tue May 6 22:33:00 CEST 2014
On Tue, May 06, 2014 at 10:25:06PM +0300, Abdiel Janulgue wrote:
> Ensures that the batch buffer is executed by the resource streamer
>
> Signed-off-by: Abdiel Janulgue <abdiel.janulgue at linux.intel.com>
> ---
> drivers/gpu/drm/i915/i915_gem_execbuffer.c | 8 ++++++++
> include/uapi/drm/i915_drm.h | 7 ++++++-
> 2 files changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> index 47fe8ec..68aaa9b 100644
> --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> @@ -1074,6 +1074,14 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
> if (args->flags & I915_EXEC_IS_PINNED)
> flags |= I915_DISPATCH_PINNED;
>
> + if (args->flags & I915_EXEC_RESOURCE_STREAMER) {
> + if ((args->flags & I915_EXEC_RING_MASK) != I915_EXEC_RENDER ||
> + !IS_BROADWELL(dev))
> + return -EINVAL;
This misses I915_EXEC_DEFAULT. If you reorder this testing to after we
decide upon which ring is being run, this should look simpler.
if (args->flags & I915_EXEC_RESOURCE_STREAMER) {
if (!IS_BROADWELL(dev)) {
DRM_DEBUG("resource streamer is only enabled for Broadwell\n");
return -EINVAL;
}
if (ring->id != RCS) {
DRM_DEBUG("resource streamer is only available on the render ring (not %s)\n", ring->name);
return -EINVAL;
}
flags |= I915_DISPATCH_RS;
}
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
More information about the Intel-gfx
mailing list