summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBen Widawsky <ben@bwidawsk.net>2012-03-18 18:42:44 -0700
committerBen Widawsky <ben@bwidawsk.net>2012-06-14 10:15:42 -0700
commit5a28ef8580a83375fc663b84873c4e18207ed3fb (patch)
tree0f0c7e0af273577480109c174b4f347a2483f4d5 /lib
parentb28a399dcd8d28b6b9bde4baa105f9e78e520122 (diff)
context: update for new execbuf2 element
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Diffstat (limited to 'lib')
-rw-r--r--lib/drmtest.c2
-rw-r--r--lib/intel_batchbuffer.h7
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/drmtest.c b/lib/drmtest.c
index cdf46aad..871c1d0d 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -118,7 +118,7 @@ void gem_quiescent_gpu(int fd)
execbuf.DR1 = 0;
execbuf.DR4 = 0;
execbuf.flags = 0;
- execbuf.rsvd1 = 0;
+ i915_execbuffer2_set_context_id(execbuf, 0);
execbuf.rsvd2 = 0;
do_ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf);
diff --git a/lib/intel_batchbuffer.h b/lib/intel_batchbuffer.h
index 5a1fc178..7ea13684 100644
--- a/lib/intel_batchbuffer.h
+++ b/lib/intel_batchbuffer.h
@@ -100,4 +100,11 @@ void intel_copy_bo(struct intel_batchbuffer *batch,
drm_intel_bo *dst_bo, drm_intel_bo *src_bo,
int width, int height);
+#define I915_EXEC_CONTEXT_ID_MASK (0xffffffff)
+#define i915_execbuffer2_set_context_id(eb2, context) \
+ (eb2).rsvd1 = context & I915_EXEC_CONTEXT_ID_MASK
+#define i915_execbuffer2_get_context_id(eb2) \
+ ((eb2).rsvd1 & I915_EXEC_CONTEXT_ID_MASK)
+
+
#endif