From 0fe02e686a7cd3b26690957d1cd5b926fd6dbd0f Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 13 Nov 2013 11:27:03 +0000 Subject: [PATCH] sna/gen7: Apply the depth-stall w/a before disabling VS References: https://bugs.freedesktop.org/show_bug.cgi?id=68410 Signed-off-by: Chris Wilson --- src/sna/gen7_render.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c index 82c785f..01a4de8 100644 --- a/src/sna/gen7_render.c +++ b/src/sna/gen7_render.c @@ -552,15 +552,21 @@ gen7_emit_state_base_address(struct sna *sna) static void gen7_disable_vs(struct sna *sna) { - /* For future reference: - * A PIPE_CONTROL with post-sync op set to 1 and a depth stall needs + /* A PIPE_CONTROL with post-sync op set to 1 and a depth stall needs * to be emitted just prior to change VS state, i.e. 3DSTATE_VS, * 3DSTATE_URB_VS, 3DSTATE_CONSTANT_VS, * 3DSTATE_BINDING_TABLE_POINTER_VS, 3DSTATE_SAMPLER_STATE_POINTER_VS. - * - * Here we saved by the full-flush incurred when emitting - * the batchbuffer. */ + OUT_BATCH(GEN7_PIPE_CONTROL | (4 - 2)); + OUT_BATCH(GEN7_PIPE_CONTROL_DEPTH_STALL | + GEN7_PIPE_CONTROL_WRITE_QWORD); + OUT_BATCH(kgem_add_reloc(&sna->kgem, sna->kgem.nbatch, + sna->render_state.gen7.general_bo, + I915_GEM_DOMAIN_INSTRUCTION << 16 | + I915_GEM_DOMAIN_INSTRUCTION, + 0)); + OUT_BATCH(0); + OUT_BATCH(GEN7_3DSTATE_VS | (6 - 2)); OUT_BATCH(0); /* no VS kernel */ OUT_BATCH(0); -- 1.7.9.5