summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-02-03 21:57:33 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2017-02-03 21:08:03 +0000
commitee6a40fd01871b79a391646e15ce76bd9d5c1138 (patch)
tree75d2ffffa9baa7cbd64c10a040014ce3d3982b82
parentba0d1dcb2b6e6a5ec6cb1645988df7c8eccec5c3 (diff)
igt: Skip MI_STORE_DWORD_IMM on gen2
On gen2 MI_STORE_DWORD_IMM operates on a physical, not virtual, address i.e. we can't use it. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--tests/drv_module_reload.c11
-rw-r--r--tests/gem_busy.c6
-rw-r--r--tests/gem_exec_flush.c6
-rw-r--r--tests/gem_exec_gttfill.c6
-rw-r--r--tests/gem_exec_parallel.c2
-rw-r--r--tests/gem_exec_store.c6
-rw-r--r--tests/gem_exec_suspend.c8
-rw-r--r--tests/gem_exec_whisper.c8
-rw-r--r--tests/gem_ringfill.c6
-rw-r--r--tests/gem_sync.c8
-rw-r--r--tests/kms_atomic.c2
-rw-r--r--tests/kms_pipe_b_c_ivb.c1
12 files changed, 64 insertions, 6 deletions
diff --git a/tests/drv_module_reload.c b/tests/drv_module_reload.c
index ac7a7a46..99678513 100644
--- a/tests/drv_module_reload.c
+++ b/tests/drv_module_reload.c
@@ -42,6 +42,11 @@
#define ENGINE_MASK (I915_EXEC_RING_MASK | LOCAL_I915_EXEC_BSD_MASK)
+static bool can_store_dword_imm(int fd)
+{
+ return intel_gen(intel_gen(intel_get_drm_devid(fd))) > 2;
+}
+
static void store_dword(int fd, unsigned ring)
{
const int gen = intel_gen(intel_get_drm_devid(fd));
@@ -51,6 +56,9 @@ static void store_dword(int fd, unsigned ring)
uint32_t batch[16];
int i;
+ if (!can_store_dword_imm(fd))
+ return;
+
if (!gem_has_ring(fd, ring))
return;
@@ -117,6 +125,9 @@ static void store_all(int fd)
int value;
int i, j;
+ if (!can_store_dword_imm(fd))
+ return;
+
memset(&execbuf, 0, sizeof(execbuf));
execbuf.buffers_ptr = (uintptr_t)obj;
execbuf.buffer_count = 2;
diff --git a/tests/gem_busy.c b/tests/gem_busy.c
index edd74d9e..edec7c9b 100644
--- a/tests/gem_busy.c
+++ b/tests/gem_busy.c
@@ -500,6 +500,11 @@ static void basic(int fd, unsigned ring, unsigned flags)
igt_spin_batch_free(fd, spin);
}
+static bool can_store_dword_imm(int fd)
+{
+ return intel_gen(intel_gen(intel_get_drm_devid(fd))) > 2;
+}
+
igt_main
{
const struct intel_execution_engine *e;
@@ -509,6 +514,7 @@ igt_main
igt_fixture {
fd = drm_open_driver_master(DRIVER_INTEL);
+ igt_require(can_store_dword_imm(fd));
}
igt_subtest_group {
diff --git a/tests/gem_exec_flush.c b/tests/gem_exec_flush.c
index 57e88109..4b51fbb0 100644
--- a/tests/gem_exec_flush.c
+++ b/tests/gem_exec_flush.c
@@ -541,6 +541,11 @@ static const char *yesno(bool x)
return x ? "yes" : "no";
}
+static bool can_store_dword_imm(int gen)
+{
+ return gen > 2;
+}
+
igt_main
{
const struct intel_execution_engine *e;
@@ -580,6 +585,7 @@ igt_main
fd = drm_open_driver(DRIVER_INTEL);
gem_require_mmap_wc(fd);
gen = intel_gen(intel_get_drm_devid(fd));
+ igt_require(can_store_dword_imm(gen));
igt_info("Has LLC? %s\n", yesno(gem_has_llc(fd)));
if (cpu) {
diff --git a/tests/gem_exec_gttfill.c b/tests/gem_exec_gttfill.c
index 5e84698e..7e82b8f0 100644
--- a/tests/gem_exec_gttfill.c
+++ b/tests/gem_exec_gttfill.c
@@ -209,6 +209,11 @@ static void fillgtt(int fd, unsigned ring, int timeout)
igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0);
}
+static bool can_store_dword_imm(int fd)
+{
+ return intel_gen(intel_gen(intel_get_drm_devid(fd))) > 2;
+}
+
igt_main
{
const struct intel_execution_engine *e;
@@ -218,6 +223,7 @@ igt_main
igt_fixture {
device = drm_open_driver(DRIVER_INTEL);
+ igt_require(can_store_dword_imm(device));
igt_fork_hang_detector(device);
}
diff --git a/tests/gem_exec_parallel.c b/tests/gem_exec_parallel.c
index 8c1ec724..3be5017a 100644
--- a/tests/gem_exec_parallel.c
+++ b/tests/gem_exec_parallel.c
@@ -73,7 +73,7 @@ static void gem_require_context(int fd)
static bool can_mi_store_dword(int gen, unsigned engine)
{
- return !(gen == 6 && (engine & ~(3<<13)) == I915_EXEC_BSD);
+ return gen > 2 && !(gen == 6 && (engine & ~(3<<13)) == I915_EXEC_BSD);
}
static bool ignore_engine(int gen, unsigned engine)
diff --git a/tests/gem_exec_store.c b/tests/gem_exec_store.c
index 83f79e8b..e9893787 100644
--- a/tests/gem_exec_store.c
+++ b/tests/gem_exec_store.c
@@ -208,6 +208,11 @@ static void store_all(int fd)
igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0);
}
+static bool can_store_dword_imm(int fd)
+{
+ return intel_gen(intel_gen(intel_get_drm_devid(fd))) > 2;
+}
+
igt_main
{
const struct intel_execution_engine *e;
@@ -215,6 +220,7 @@ igt_main
igt_fixture {
fd = drm_open_driver_master(DRIVER_INTEL);
+ igt_require(can_store_dword_imm(fd));
igt_fork_hang_detector(fd);
}
diff --git a/tests/gem_exec_suspend.c b/tests/gem_exec_suspend.c
index 6149c50a..89862f3a 100644
--- a/tests/gem_exec_suspend.c
+++ b/tests/gem_exec_suspend.c
@@ -62,7 +62,7 @@ static void check_bo(int fd, uint32_t handle)
static bool can_mi_store_dword(int gen, unsigned engine)
{
- return !(gen == 6 && (engine & ~(3<<13)) == I915_EXEC_BSD);
+ return gen > 2 && !(gen == 6 && (engine & ~(3<<13)) == I915_EXEC_BSD);
}
static bool ignore_engine(int gen, unsigned engine)
@@ -238,6 +238,11 @@ static void run_test(int fd, unsigned engine, unsigned flags)
test_all(fd, flags);
}
+static bool can_store_dword_imm(int fd)
+{
+ return intel_gen(intel_gen(intel_get_drm_devid(fd))) > 2;
+}
+
igt_main
{
const struct {
@@ -254,6 +259,7 @@ igt_main
igt_fixture {
fd = drm_open_driver_master(DRIVER_INTEL);
+ igt_require(can_store_dword_imm(fd));
igt_fork_hang_detector(fd);
}
diff --git a/tests/gem_exec_whisper.c b/tests/gem_exec_whisper.c
index 63e76303..500bd611 100644
--- a/tests/gem_exec_whisper.c
+++ b/tests/gem_exec_whisper.c
@@ -97,7 +97,7 @@ static int __gem_context_create(int fd, uint32_t *ctx_id)
static bool can_mi_store_dword(int gen, unsigned engine)
{
- return !(gen == 6 && (engine & ~(3<<13)) == I915_EXEC_BSD);
+ return gen > 2 && !(gen == 6 && (engine & ~(3<<13)) == I915_EXEC_BSD);
}
static bool ignore_engine(int gen, unsigned engine)
@@ -516,6 +516,11 @@ out:
close(dir);
}
+static bool can_store_dword_imm(int fd)
+{
+ return intel_gen(intel_gen(intel_get_drm_devid(fd))) > 2;
+}
+
igt_main
{
const struct mode {
@@ -542,6 +547,7 @@ igt_main
igt_fixture {
fd = drm_open_driver_master(DRIVER_INTEL);
+ igt_require(can_store_dword_imm(fd));
print_welcome(fd);
igt_fork_hang_detector(fd);
diff --git a/tests/gem_ringfill.c b/tests/gem_ringfill.c
index e47dbbb5..74bb0a10 100644
--- a/tests/gem_ringfill.c
+++ b/tests/gem_ringfill.c
@@ -230,6 +230,11 @@ static void run_test(int fd, unsigned ring, unsigned flags)
run_test(fd, ring, 0);
}
+static bool can_store_dword_imm(int fd)
+{
+ return intel_gen(intel_gen(intel_get_drm_devid(fd))) > 2;
+}
+
igt_main
{
const struct {
@@ -256,6 +261,7 @@ igt_main
int gen;
fd = drm_open_driver(DRIVER_INTEL);
+ igt_require(can_store_dword_imm(fd));
gen = intel_gen(intel_get_drm_devid(fd));
if (gen > 3 && gen < 6) { /* ctg and ilk need secure batches */
igt_require(drmSetMaster(fd) == 0);
diff --git a/tests/gem_sync.c b/tests/gem_sync.c
index 60ba38cc..a6669a8f 100644
--- a/tests/gem_sync.c
+++ b/tests/gem_sync.c
@@ -77,7 +77,7 @@ out:
static bool can_mi_store_dword(int gen, unsigned engine)
{
- return !(gen == 6 && (engine & ~(3<<13)) == I915_EXEC_BSD);
+ return gen > 2 && !(gen == 6 && (engine & ~(3<<13)) == I915_EXEC_BSD);
}
static void
@@ -719,6 +719,11 @@ out:
close(dir);
}
+static bool can_store_dword_imm(int fd)
+{
+ return intel_gen(intel_gen(intel_get_drm_devid(fd))) > 2;
+}
+
igt_main
{
const struct intel_execution_engine *e;
@@ -729,6 +734,7 @@ igt_main
igt_fixture {
fd = drm_open_driver(DRIVER_INTEL);
+ igt_require(can_store_dword_imm(fd));
print_welcome(fd);
igt_fork_hang_detector(fd);
diff --git a/tests/kms_atomic.c b/tests/kms_atomic.c
index e794a62b..d6273f4f 100644
--- a/tests/kms_atomic.c
+++ b/tests/kms_atomic.c
@@ -443,7 +443,7 @@ static void crtc_populate_req(struct kms_atomic_crtc_state *crtc,
{
if (crtc->out_fence_ptr)
crtc_set_prop(req, crtc, IGT_CRTC_OUT_FENCE_PTR,
- (uint64_t) crtc->out_fence_ptr);
+ to_user_pointer(crtc->out_fence_ptr));
crtc_set_prop(req, crtc, IGT_CRTC_MODE_ID, crtc->mode.id);
crtc_set_prop(req, crtc, IGT_CRTC_ACTIVE, crtc->active);
diff --git a/tests/kms_pipe_b_c_ivb.c b/tests/kms_pipe_b_c_ivb.c
index 89005383..64086915 100644
--- a/tests/kms_pipe_b_c_ivb.c
+++ b/tests/kms_pipe_b_c_ivb.c
@@ -117,7 +117,6 @@ set_normal_mode_on_pipe(data_t *data, enum pipe pipe, igt_output_t *output)
static void
find_outputs(data_t *data, igt_output_t **output1, igt_output_t **output2)
{
- int count = 0;
igt_output_t *output;
enum pipe pipe;