summaryrefslogtreecommitdiff
path: root/tests/gem_storedw_loop_blt.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2012-03-22 13:47:57 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-03-22 14:00:22 +0100
commitafbdc7af8d9324ae065c47d6122bb020c579fd0a (patch)
tree08209f3538da667dc8c504b4c6eb8ccfa909f243 /tests/gem_storedw_loop_blt.c
parent9e531888ed0c3e34303a67e324ea4ab29057c62b (diff)
tests: adapt storedw tests to ppgtt
MI_MEM_VIRTUAL actually means use global gtt now, not setting the bit means use ppgtt. On previous gens, not setting the bits ment 'use physical memory'. So what, the usual confusion. Note that for some odd reasong this is broken on gen6, but only on the bsd ring. Unexpected. Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests/gem_storedw_loop_blt.c')
-rw-r--r--tests/gem_storedw_loop_blt.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/gem_storedw_loop_blt.c b/tests/gem_storedw_loop_blt.c
index 88b12d376..dda9b835b 100644
--- a/tests/gem_storedw_loop_blt.c
+++ b/tests/gem_storedw_loop_blt.c
@@ -45,6 +45,7 @@
static drm_intel_bufmgr *bufmgr;
struct intel_batchbuffer *batch;
static drm_intel_bo *target_buffer;
+static int has_ppgtt = 0;
/*
* Testcase: Basic blitter MI check using MI_STORE_DATA_IMM
@@ -56,7 +57,9 @@ store_dword_loop(void)
int cmd, i, val = 0;
uint32_t *buf;
- cmd = MI_STORE_DWORD_IMM | MI_MEM_VIRTUAL;
+ cmd = MI_STORE_DWORD_IMM;
+ if (!has_ppgtt)
+ cmd |= MI_MEM_VIRTUAL;
for (i = 0; i < 0x100000; i++) {
BEGIN_BATCH(4);
@@ -105,6 +108,8 @@ int main(int argc, char **argv)
fd = drm_open_any();
devid = intel_get_drm_devid(fd);
+ has_ppgtt = gem_uses_aliasing_ppgtt(fd);
+
if (IS_GEN2(devid) || IS_GEN3(devid) || IS_GEN4(devid) || IS_GEN5(devid)) {
fprintf(stderr, "MI_STORE_DATA can only use GTT address on gen4+/g33 and "
@@ -112,8 +117,11 @@ int main(int argc, char **argv)
return 77;
}
- /* This supposedly only works with ppgtt */
- return 77;
+ /* This only works with ppgtt */
+ if (!has_ppgtt) {
+ fprintf(stderr, "no ppgtt detected, which is required\n");
+ return 77;
+ }
bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
if (!bufmgr) {