@@ -957,6 +957,13 @@ 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_HASWELL(dev))
+ return -EINVAL;
+
+ flags |= I915_DISPATCH_RS;
+ }
switch (args->flags & I915_EXEC_RING_MASK) {
case I915_EXEC_DEFAULT:
@@ -110,6 +110,7 @@ struct intel_ring_buffer {
unsigned flags);
#define I915_DISPATCH_SECURE 0x1
#define I915_DISPATCH_PINNED 0x2
+#define I915_DISPATCH_RS 0x4
void (*cleanup)(struct intel_ring_buffer *ring);
int (*sync_to)(struct intel_ring_buffer *ring,
struct intel_ring_buffer *to,
@@ -731,7 +731,12 @@ struct drm_i915_gem_execbuffer2 {
*/
#define I915_EXEC_HANDLE_LUT (1<<12)
-#define __I915_EXEC_UNKNOWN_FLAGS -(I915_EXEC_HANDLE_LUT<<1)
+/** Tell the kernel that the batchbuffer is processed by
+ * the resource streamer.
+ */
+#define I915_EXEC_RESOURCE_STREAMER (1<<13)
+
+#define __I915_EXEC_UNKNOWN_FLAGS -(I915_EXEC_RESOURCE_STREAMER <<1)
#define I915_EXEC_CONTEXT_ID_MASK (0xffffffff)
#define i915_execbuffer2_set_context_id(eb2, context) \
Ensures that the batch buffer is executed by the resource streamer. v3: - Make sure batch is only submitted on render ring and Haswell (Daniel) - Separate EXEC and DISPATCH flags (Chris) - Update __I915_EXEC_UNKNOWN_FLAGS (Kenneth) Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com> --- drivers/gpu/drm/i915/i915_gem_execbuffer.c | 7 +++++++ drivers/gpu/drm/i915/intel_ringbuffer.h | 1 + include/uapi/drm/i915_drm.h | 7 ++++++- 3 files changed, 14 insertions(+), 1 deletion(-)