context: update for new execbuf2 element
authorBen Widawsky <ben@bwidawsk.net>
Mon, 19 Mar 2012 01:42:44 +0000 (18:42 -0700)
committerBen Widawsky <ben@bwidawsk.net>
Thu, 14 Jun 2012 17:15:42 +0000 (10:15 -0700)
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
12 files changed:
lib/drmtest.c
lib/intel_batchbuffer.h
tests/gem_bad_length.c
tests/gem_exec_blt.c
tests/gem_exec_faulting_reloc.c
tests/gem_exec_nop.c
tests/gem_linear_blits.c
tests/gen3_mixed_blits.c
tests/gen3_render_linear_blits.c
tests/gen3_render_mixed_blits.c
tests/gen3_render_tiledx_blits.c
tests/gen3_render_tiledy_blits.c

index cdf46aa..871c1d0 100644 (file)
@@ -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);
index 5a1fc17..7ea1368 100644 (file)
@@ -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
index 512effa..41f44d7 100644 (file)
@@ -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");
index 472065c..eb5ae66 100644 (file)
@@ -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) {
index e67056d..863a1b0 100644 (file)
@@ -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);
index d2b35ed..9dd055c 100644 (file)
@@ -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) {
index ec2ba26..fe15f1d 100644 (file)
@@ -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) {
index 0e2fdbc..5bb6d86 100644 (file)
@@ -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) {
index f474789..529e23f 100644 (file)
@@ -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) {
index 1c3d528..1353b9d 100644 (file)
@@ -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) {
index c9e6ff9..0e96e79 100644 (file)
@@ -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) {
index 922ea1d..90fc7eb 100644 (file)
@@ -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) {