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>
This commit is contained in:
Xiang, Haihao 2013-04-23 15:06:42 +08:00 committed by Ben Widawsky
parent 0a413cd8a9
commit f187990bbf

View File

@ -55,6 +55,7 @@ static drm_intel_bo *target_buffer;
#define MI_COND_BATCH_BUFFER_END (0x36<<23 | 1) #define MI_COND_BATCH_BUFFER_END (0x36<<23 | 1)
#define MI_DO_COMPARE (1<<21) #define MI_DO_COMPARE (1<<21)
#define LOCAL_I915_PARAM_HAS_VEBOX 22
static int static int
get_num_rings(int fd) get_num_rings(int fd)
{ {
@ -81,6 +82,15 @@ get_num_rings(int fd)
else else
goto skip; goto 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: skip:
return num_rings; return num_rings;
} }