From f187990bbf4396c7ae1796030377301bdd493852 Mon Sep 17 00:00:00 2001 From: "Xiang, Haihao" Date: Tue, 23 Apr 2013 15:06:42 +0800 Subject: [PATCH] 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 Signed-off-by: Zhong Li Signed-off-by: Ben Widawsky --- tests/gem_ring_sync_loop.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tests/gem_ring_sync_loop.c b/tests/gem_ring_sync_loop.c index 2875cf3b..3607fcae 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; }