Commit ee6a40fd authored by Chris Wilson's avatar Chris Wilson

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's avatarChris Wilson <chris@chris-wilson.co.uk>
parent ba0d1dcb
......@@ -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;
......
......@@ -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 {
......
......@@ -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) {
......
......@@ -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);
}
......
......@@ -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)
......
......@@ -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);
}
......
......@@ -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);
}
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment