i965: CS writes/reads should use I915_GEM_INSTRUCTION
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 9 Oct 2013 13:49:11 +0000 (15:49 +0200)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 28 Oct 2013 18:29:15 +0000 (11:29 -0700)
Otherwise the gen6 w/a in the kernel won't kick in and the write will
land nowhere.

Inspired by a patch Ken pointed me at which had the same issue (but
isn't yet merged and also for a gen7+ feature). An audit of the entire
driver didn't reveal any other case than the one in in the write_reg
helper used by the gen6 queryobj code.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Tested-by: Xinkai Chen <yeled.nova@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
src/mesa/drivers/dri/i965/gen6_queryobj.c

index add4df94ea3fa65fb22068d3f8d6c435ca349ceb..56e9d5db9374f6c4f8cc2c4e709b75923a840158 100644 (file)
@@ -115,14 +115,14 @@ brw_store_register_mem64(struct brw_context *brw,
    BEGIN_BATCH(3);
    OUT_BATCH(MI_STORE_REGISTER_MEM | (3 - 2));
    OUT_BATCH(reg);
-   OUT_RELOC(bo, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER,
+   OUT_RELOC(bo, I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION,
              idx * sizeof(uint64_t));
    ADVANCE_BATCH();
 
    BEGIN_BATCH(3);
    OUT_BATCH(MI_STORE_REGISTER_MEM | (3 - 2));
    OUT_BATCH(reg + sizeof(uint32_t));
-   OUT_RELOC(bo, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER,
+   OUT_RELOC(bo, I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION,
              sizeof(uint32_t) + idx * sizeof(uint64_t));
    ADVANCE_BATCH();
 }