diff options
author | Ben Widawsky <ben@bwidawsk.net> | 2012-06-04 17:42:55 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-06-14 11:36:21 -0400 |
commit | 6e0a69dbc81b88f5a42e08344203021571f6fb2f (patch) | |
tree | a5952c8ff568fab09aea7edae1bc63e35b5714c1 /include/drm/i915_drm.h | |
parent | 846248136dd3a6723135b8515ed7dc4c52a7b2ae (diff) |
drm/i915/context: switch contexts with execbuf2
Use the rsvd1 field in execbuf2 to specify the context ID associated
with the workload. This will allow the driver to do the proper context
switch when/if needed.
v2: Add checks for context switches on rings not supporting contexts.
Before the code would silently ignore such requests.
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Diffstat (limited to 'include/drm/i915_drm.h')
-rw-r--r-- | include/drm/i915_drm.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h index 5da73244486a..8cc70837f929 100644 --- a/include/drm/i915_drm.h +++ b/include/drm/i915_drm.h | |||
@@ -663,13 +663,19 @@ struct drm_i915_gem_execbuffer2 { | |||
663 | #define I915_EXEC_CONSTANTS_ABSOLUTE (1<<6) | 663 | #define I915_EXEC_CONSTANTS_ABSOLUTE (1<<6) |
664 | #define I915_EXEC_CONSTANTS_REL_SURFACE (2<<6) /* gen4/5 only */ | 664 | #define I915_EXEC_CONSTANTS_REL_SURFACE (2<<6) /* gen4/5 only */ |
665 | __u64 flags; | 665 | __u64 flags; |
666 | __u64 rsvd1; | 666 | __u64 rsvd1; /* now used for context info */ |
667 | __u64 rsvd2; | 667 | __u64 rsvd2; |
668 | }; | 668 | }; |
669 | 669 | ||
670 | /** Resets the SO write offset registers for transform feedback on gen7. */ | 670 | /** Resets the SO write offset registers for transform feedback on gen7. */ |
671 | #define I915_EXEC_GEN7_SOL_RESET (1<<8) | 671 | #define I915_EXEC_GEN7_SOL_RESET (1<<8) |
672 | 672 | ||
673 | #define I915_EXEC_CONTEXT_ID_MASK (0xffffffff) | ||
674 | #define i915_execbuffer2_set_context_id(eb2, context) \ | ||
675 | (eb2).rsvd1 = context & I915_EXEC_CONTEXT_ID_MASK | ||
676 | #define i915_execbuffer2_get_context_id(eb2) \ | ||
677 | ((eb2).rsvd1 & I915_EXEC_CONTEXT_ID_MASK) | ||
678 | |||
673 | struct drm_i915_gem_pin { | 679 | struct drm_i915_gem_pin { |
674 | /** Handle of the buffer to be pinned. */ | 680 | /** Handle of the buffer to be pinned. */ |
675 | __u32 handle; | 681 | __u32 handle; |