[PATCH] tests/gem_bad_address: Adapt test to ppgtt to pass with command parser

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The gem_bad_address test started to fail on Gen7 with enabled command parser.
Error message is printed because MI_GLOBAL_GTT equals to MI_MEM_VIRTUAL:
    "CMD: Rejected command 0x10600002 for bitmask 0x00400000...".
MI_MEM_VIRTUAL means global gtt. This bit shouldn't be set for ppgtt.

Changed test like it was done previously for storedw tests in the commit:
    afbdc7af8d9324ae065c47d6122bb020c579fd0a.

Signed-off-by: Pavel Popov <pavel.e.popov@xxxxxxxxx>
---
 tests/gem_bad_address.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tests/gem_bad_address.c b/tests/gem_bad_address.c
index 4a4a570..ccc55f1 100644
--- a/tests/gem_bad_address.c
+++ b/tests/gem_bad_address.c
@@ -44,14 +44,19 @@
 
 static drm_intel_bufmgr *bufmgr;
 struct intel_batchbuffer *batch;
+static int has_ppgtt = 0;
 
 #define BAD_GTT_DEST ((512*1024*1024)) /* past end of aperture */
 
 static void
 bad_store(void)
 {
+	int cmd = MI_STORE_DWORD_IMM | 1 << 21;
+	if (!has_ppgtt)
+		cmd |= MI_MEM_VIRTUAL;
+
 	BEGIN_BATCH(4, 0);
-	OUT_BATCH(MI_STORE_DWORD_IMM | MI_MEM_VIRTUAL | 1 << 21);
+	OUT_BATCH(cmd);
 	OUT_BATCH(0);
 	OUT_BATCH(BAD_GTT_DEST);
 	OUT_BATCH(0xdeadbeef);
@@ -66,6 +71,8 @@ igt_simple_main
 
 	fd = drm_open_any();
 
+	has_ppgtt = gem_uses_aliasing_ppgtt(fd);
+
 	bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
 	drm_intel_bufmgr_gem_enable_reuse(bufmgr);
 	batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd));
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux