From a4493a54f348e547027eff3cb1607805f39f955d Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 21 Jan 2016 09:19:02 +0000 Subject: [PATCH] igt/gem_softpin: Fix MI_STORE_DWORD_IMM for gen2-3 Before gen4, MI_STORE_DWORD was just 3 dwords long (cmd, offset, value). Signed-off-by: Chris Wilson --- tests/gem_softpin.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/gem_softpin.c b/tests/gem_softpin.c index f1885591..b686c154 100644 --- a/tests/gem_softpin.c +++ b/tests/gem_softpin.c @@ -391,7 +391,10 @@ static void test_noreloc(int fd) for (i = 0; i < ARRAY_SIZE(object) - 1; i++) { *b++ = MI_STORE_DWORD_IMM; if (gen < 8) { - *b++ = 0; + if (gen < 4) + b[-1]--; + else + *b++ = 0; *b++ = object[i].offset; } else { *b++ = object[i].offset;