summaryrefslogtreecommitdiff
path: root/tests/gem_ringfill.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-05-18 12:11:59 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2017-05-18 13:06:17 +0100
commitbc7877660c7d7a733ec484e91e2096b8daf2cf0d (patch)
tree4ade2c9751497fac6a87081920863cce63d14704 /tests/gem_ringfill.c
parent49e083a29a0942309c877ea8e9275fa985a5bf25 (diff)
lib: Refactor testing for ability to use MI_STORE_DATA_IMM
Rather than have the code in multiple locations, put a copy in lib/ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/gem_ringfill.c')
-rw-r--r--tests/gem_ringfill.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/tests/gem_ringfill.c b/tests/gem_ringfill.c
index b2419820..b52996a4 100644
--- a/tests/gem_ringfill.c
+++ b/tests/gem_ringfill.c
@@ -170,15 +170,13 @@ static int setup_execbuf(int fd,
static void run_test(int fd, unsigned ring, unsigned flags, unsigned timeout)
{
- const int gen = intel_gen(intel_get_drm_devid(fd));
struct drm_i915_gem_exec_object2 obj[2];
struct drm_i915_gem_relocation_entry reloc[1024];
struct drm_i915_gem_execbuffer2 execbuf;
igt_hang_t hang;
gem_require_ring(fd, ring);
- igt_skip_on_f(gen == 6 && (ring & ~(3<<13)) == I915_EXEC_BSD,
- "MI_STORE_DATA broken on gen6 bsd\n");
+ igt_require(gem_can_store_dword(fd, ring));
if (flags & (SUSPEND | HIBERNATE))
run_test(fd, ring, 0, 0);
@@ -238,11 +236,6 @@ static void run_test(int fd, unsigned ring, unsigned flags, unsigned timeout)
run_test(fd, ring, 0, 0);
}
-static bool can_store_dword_imm(int fd)
-{
- return intel_gen(intel_get_drm_devid(fd)) > 2;
-}
-
struct cork {
int device;
uint32_t handle;
@@ -358,7 +351,7 @@ igt_main
fd = drm_open_driver(DRIVER_INTEL);
igt_require_gem(fd);
- igt_require(can_store_dword_imm(fd));
+ igt_require(gem_can_store_dword(fd, 0));
gen = intel_gen(intel_get_drm_devid(fd));
if (gen > 3 && gen < 6) { /* ctg and ilk need secure batches */
igt_require(drmSetMaster(fd) == 0);