diff options
author | Xiang, Haihao <haihao.xiang@intel.com> | 2013-04-23 15:06:42 +0800 |
---|---|---|
committer | Ben Widawsky <ben@bwidawsk.net> | 2013-04-24 18:55:16 -0700 |
commit | f187990bbf4396c7ae1796030377301bdd493852 (patch) | |
tree | 6fd54b7cd355204c3082921e31c2c849e6d63b8b | |
parent | 0a413cd8a935744c1abf3c4ee3d95698dd68ca93 (diff) |
gem_ring_sync_loop: test the new ring
The code is surround by a #ifdef...#endif to avoid to break compiling against
the current libdrm release
v2 (Ben): Use VEBOX get param. Thankfully Daniel let us carve this out
way back when.
Spacing cleanups
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
-rw-r--r-- | tests/gem_ring_sync_loop.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/tests/gem_ring_sync_loop.c b/tests/gem_ring_sync_loop.c index 2875cf3b9..3607fcae4 100644 --- a/tests/gem_ring_sync_loop.c +++ b/tests/gem_ring_sync_loop.c @@ -55,6 +55,7 @@ static drm_intel_bo *target_buffer; #define MI_COND_BATCH_BUFFER_END (0x36<<23 | 1) #define MI_DO_COMPARE (1<<21) +#define LOCAL_I915_PARAM_HAS_VEBOX 22 static int get_num_rings(int fd) { @@ -67,12 +68,12 @@ get_num_rings(int fd) gp.param = I915_PARAM_HAS_BSD; ret = drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp); - + if ((ret == 0) & (*gp.value > 0)) num_rings++; else goto skip; - + gp.param = I915_PARAM_HAS_BLT; ret = drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp); @@ -81,7 +82,16 @@ get_num_rings(int fd) else goto skip; -skip: + gp.param = LOCAL_I915_PARAM_HAS_VEBOX; + ret = drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp); + + if ((ret == 0) & (*gp.value > 0)) + num_rings++; + else + goto skip; + + +skip: return num_rings; } |