@@ -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,9 +82,7 @@ get_num_rings(int fd)
else
goto skip;
-#ifdef I915_PARAM_HAS_VEBOX /* remove it once the upstream libdrm support VEBOX */
-
- gp.param = I915_PARAM_HAS_VEBOX;
+ gp.param = LOCAL_I915_PARAM_HAS_VEBOX;
ret = drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp);
if ((ret == 0) & (*gp.value > 0))
@@ -91,9 +90,8 @@ get_num_rings(int fd)
else
goto skip;
-#endif
-skip:
+skip:
return num_rings;
}
And with a couple of corrections to this file:
@@ -1,5 +1,5 @@
/*
- * Copyright ? 2009 Intel Corporation
+ * Copyright ? 2012 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -21,9 +21,7 @@
* IN THE SOFTWARE.
*
* Authors:
- * Xiang, Haihao <haihao.xiang@intel.com>
- * Eric Anholt <eric@anholt.net>
- * Jesse Barnes <jbarnes@virtuousgeek.org> (based on gem_bad_blit.c)
+ * Xiang, Haihao <haihao.xiang@intel.com> (based on gem_store_dw_loop_*)
*
*/
@@ -48,6 +46,8 @@ struct intel_batchbuffer *batch;
static drm_intel_bo *target_buffer;
static int has_ppgtt = 0;
+#define LOCAL_I915_EXEC_VEBOX (4<<0)
+
/*
* Testcase: Basic vebox MI check using MI_STORE_DATA_IMM
*/
@@ -71,7 +71,7 @@ store_dword_loop(void)
OUT_BATCH(val);
ADVANCE_BATCH();
- intel_batchbuffer_flush_on_ring(batch, I915_EXEC_VEBOX);
+ intel_batchbuffer_flush_on_ring(batch, LOCAL_I915_EXEC_VEBOX);