diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c index aabb8693..2aa8d2c4 100644 --- a/src/sna/gen7_render.c +++ b/src/sna/gen7_render.c @@ -532,7 +532,11 @@ gen7_emit_state_base_address(struct sna *sna) uint32_t mocs = sna->render_state.gen7.info->mocs << 8; OUT_BATCH(GEN7_STATE_BASE_ADDRESS | (10 - 2)); - OUT_BATCH(0); /* general */ + OUT_BATCH(kgem_add_reloc(&sna->kgem, /* general */ + sna->kgem.nbatch, + sna->render_state.gen7.general_bo, + I915_GEM_DOMAIN_INSTRUCTION << 16, + mocs | BASE_ADDRESS_MODIFY)); OUT_BATCH(kgem_add_reloc(&sna->kgem, /* surface */ sna->kgem.nbatch, NULL, @@ -543,7 +547,11 @@ gen7_emit_state_base_address(struct sna *sna) sna->render_state.gen7.general_bo, I915_GEM_DOMAIN_INSTRUCTION << 16, mocs | BASE_ADDRESS_MODIFY)); - OUT_BATCH(0); /* indirect */ + OUT_BATCH(kgem_add_reloc(&sna->kgem, /* indirect */ + sna->kgem.nbatch, + sna->render_state.gen7.general_bo, + I915_GEM_DOMAIN_INSTRUCTION << 16, + mocs | BASE_ADDRESS_MODIFY)); OUT_BATCH(kgem_add_reloc(&sna->kgem, /* instruction */ sna->kgem.nbatch, sna->render_state.gen7.general_bo, @@ -551,10 +559,26 @@ gen7_emit_state_base_address(struct sna *sna) mocs | BASE_ADDRESS_MODIFY)); /* upper bounds, disable */ - OUT_BATCH(0); - OUT_BATCH(BASE_ADDRESS_MODIFY); - OUT_BATCH(0); - OUT_BATCH(BASE_ADDRESS_MODIFY); + OUT_BATCH(kgem_add_reloc(&sna->kgem, /* general */ + sna->kgem.nbatch, + sna->render_state.gen7.general_bo, + I915_GEM_DOMAIN_INSTRUCTION << 16, + kgem_bo_size(sna->render_state.gen7.general_bo) | BASE_ADDRESS_MODIFY)); + OUT_BATCH(kgem_add_reloc(&sna->kgem, /* dynamic */ + sna->kgem.nbatch, + sna->render_state.gen7.general_bo, + I915_GEM_DOMAIN_INSTRUCTION << 16, + kgem_bo_size(sna->render_state.gen7.general_bo) | BASE_ADDRESS_MODIFY)); + OUT_BATCH(kgem_add_reloc(&sna->kgem, /* indirect */ + sna->kgem.nbatch, + sna->render_state.gen7.general_bo, + I915_GEM_DOMAIN_INSTRUCTION << 16, + kgem_bo_size(sna->render_state.gen7.general_bo) | BASE_ADDRESS_MODIFY)); + OUT_BATCH(kgem_add_reloc(&sna->kgem, /* instruction */ + sna->kgem.nbatch, + sna->render_state.gen7.general_bo, + I915_GEM_DOMAIN_INSTRUCTION << 16, + kgem_bo_size(sna->render_state.gen7.general_bo) | BASE_ADDRESS_MODIFY)); } static void