diff options
author | Ben Widawsky <ben@bwidawsk.net> | 2012-03-18 18:42:44 -0700 |
---|---|---|
committer | Ben Widawsky <ben@bwidawsk.net> | 2012-06-14 10:15:42 -0700 |
commit | 5a28ef8580a83375fc663b84873c4e18207ed3fb (patch) | |
tree | 0f0c7e0af273577480109c174b4f347a2483f4d5 | |
parent | b28a399dcd8d28b6b9bde4baa105f9e78e520122 (diff) |
context: update for new execbuf2 element
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
-rw-r--r-- | lib/drmtest.c | 2 | ||||
-rw-r--r-- | lib/intel_batchbuffer.h | 7 | ||||
-rw-r--r-- | tests/gem_bad_length.c | 2 | ||||
-rw-r--r-- | tests/gem_exec_blt.c | 2 | ||||
-rw-r--r-- | tests/gem_exec_faulting_reloc.c | 2 | ||||
-rw-r--r-- | tests/gem_exec_nop.c | 2 | ||||
-rw-r--r-- | tests/gem_linear_blits.c | 3 | ||||
-rw-r--r-- | tests/gen3_mixed_blits.c | 6 | ||||
-rw-r--r-- | tests/gen3_render_linear_blits.c | 3 | ||||
-rw-r--r-- | tests/gen3_render_mixed_blits.c | 3 | ||||
-rw-r--r-- | tests/gen3_render_tiledx_blits.c | 3 | ||||
-rw-r--r-- | tests/gen3_render_tiledy_blits.c | 3 |
12 files changed, 26 insertions, 12 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 diff --git a/tests/gem_bad_length.c b/tests/gem_bad_length.c index 512effa3..41f44d7f 100644 --- a/tests/gem_bad_length.c +++ b/tests/gem_bad_length.c @@ -107,7 +107,7 @@ static void exec0(int fd) execbuf.DR1 = 0; execbuf.DR4 = 0; execbuf.flags = 0; - execbuf.rsvd1 = 0; + i915_execbuffer2_set_context_id(execbuf, 0); execbuf.rsvd2 = 0; printf("trying to run an empty batchbuffer\n"); diff --git a/tests/gem_exec_blt.c b/tests/gem_exec_blt.c index 472065c0..eb5ae668 100644 --- a/tests/gem_exec_blt.c +++ b/tests/gem_exec_blt.c @@ -224,7 +224,7 @@ static void run(int object_size) execbuf.DR1 = 0; execbuf.DR4 = 0; execbuf.flags = ring; - execbuf.rsvd1 = 0; + i915_execbuffer2_set_context_id(execbuf, 0); execbuf.rsvd2 = 0; for (count = 1; count <= 1<<17; count <<= 1) { diff --git a/tests/gem_exec_faulting_reloc.c b/tests/gem_exec_faulting_reloc.c index e67056da..863a1b03 100644 --- a/tests/gem_exec_faulting_reloc.c +++ b/tests/gem_exec_faulting_reloc.c @@ -207,7 +207,7 @@ static void run(int object_size) execbuf.DR1 = 0; execbuf.DR4 = 0; execbuf.flags = ring; - execbuf.rsvd1 = 0; + i915_execbuffer2_set_context_id(execbuf, 0); execbuf.rsvd2 = 0; gem_exec(fd, &execbuf); diff --git a/tests/gem_exec_nop.c b/tests/gem_exec_nop.c index d2b35ed3..9dd055cf 100644 --- a/tests/gem_exec_nop.c +++ b/tests/gem_exec_nop.c @@ -75,7 +75,7 @@ static int exec(int fd, uint32_t handle, int loops) execbuf.DR1 = 0; execbuf.DR4 = 0; execbuf.flags = 0; - execbuf.rsvd1 = 0; + i915_execbuffer2_set_context_id(execbuf, 0); execbuf.rsvd2 = 0; while (loops-- && ret == 0) { diff --git a/tests/gem_linear_blits.c b/tests/gem_linear_blits.c index ec2ba269..fe15f1d1 100644 --- a/tests/gem_linear_blits.c +++ b/tests/gem_linear_blits.c @@ -130,7 +130,8 @@ copy(int fd, uint32_t dst, uint32_t src) exec.num_cliprects = 0; exec.cliprects_ptr = 0; exec.flags = HAS_BLT_RING(intel_get_drm_devid(fd)) ? I915_EXEC_BLT : 0; - exec.rsvd1 = exec.rsvd2 = 0; + i915_execbuffer2_set_context_id(exec, 0); + exec.rsvd2 = 0; ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec); while (ret && errno == EBUSY) { diff --git a/tests/gen3_mixed_blits.c b/tests/gen3_mixed_blits.c index 0e2fdbc6..5bb6d868 100644 --- a/tests/gen3_mixed_blits.c +++ b/tests/gen3_mixed_blits.c @@ -312,7 +312,8 @@ render_copy(int fd, exec.num_cliprects = 0; exec.cliprects_ptr = 0; exec.flags = 0; - exec.rsvd1 = exec.rsvd2 = 0; + i915_execbuffer2_set_context_id(exec, 0); + exec.rsvd2 = 0; ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec); while (ret && errno == EBUSY) { @@ -389,7 +390,8 @@ static void blt_copy(int fd, uint32_t dst, uint32_t src) exec.num_cliprects = 0; exec.cliprects_ptr = 0; exec.flags = 0; - exec.rsvd1 = exec.rsvd2 = 0; + i915_execbuffer2_set_context_id(exec, 0); + exec.rsvd2 = 0; ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec); while (ret && errno == EBUSY) { diff --git a/tests/gen3_render_linear_blits.c b/tests/gen3_render_linear_blits.c index f4747894..529e23ff 100644 --- a/tests/gen3_render_linear_blits.c +++ b/tests/gen3_render_linear_blits.c @@ -281,7 +281,8 @@ copy(int fd, uint32_t dst, uint32_t src) exec.num_cliprects = 0; exec.cliprects_ptr = 0; exec.flags = 0; - exec.rsvd1 = exec.rsvd2 = 0; + i915_execbuffer2_set_context_id(exec, 0); + exec.rsvd2 = 0; ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec); while (ret && errno == EBUSY) { diff --git a/tests/gen3_render_mixed_blits.c b/tests/gen3_render_mixed_blits.c index 1c3d5287..1353b9d7 100644 --- a/tests/gen3_render_mixed_blits.c +++ b/tests/gen3_render_mixed_blits.c @@ -295,7 +295,8 @@ copy(int fd, exec.num_cliprects = 0; exec.cliprects_ptr = 0; exec.flags = 0; - exec.rsvd1 = exec.rsvd2 = 0; + i915_execbuffer2_set_context_id(exec, 0); + exec.rsvd2 = 0; ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec); while (ret && errno == EBUSY) { diff --git a/tests/gen3_render_tiledx_blits.c b/tests/gen3_render_tiledx_blits.c index c9e6ff99..0e96e797 100644 --- a/tests/gen3_render_tiledx_blits.c +++ b/tests/gen3_render_tiledx_blits.c @@ -282,7 +282,8 @@ copy(int fd, uint32_t dst, uint32_t src) exec.num_cliprects = 0; exec.cliprects_ptr = 0; exec.flags = 0; - exec.rsvd1 = exec.rsvd2 = 0; + i915_execbuffer2_set_context_id(exec, 0); + exec.rsvd2 = 0; ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec); while (ret && errno == EBUSY) { diff --git a/tests/gen3_render_tiledy_blits.c b/tests/gen3_render_tiledy_blits.c index 922ea1db..90fc7eb9 100644 --- a/tests/gen3_render_tiledy_blits.c +++ b/tests/gen3_render_tiledy_blits.c @@ -282,7 +282,8 @@ copy(int fd, uint32_t dst, uint32_t src) exec.num_cliprects = 0; exec.cliprects_ptr = 0; exec.flags = 0; - exec.rsvd1 = exec.rsvd2 = 0; + i915_execbuffer2_set_context_id(exec, 0); + exec.rsvd2 = 0; ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec); while (ret && errno == EBUSY) { |