<div dir="ltr">On 6 January 2014 17:05, Chad Versace <span dir="ltr"><<a href="mailto:chad.versace@linux.intel.com" target="_blank">chad.versace@linux.intel.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Unconditionally set brw->need_workaround_flush at the top of gen6 blorp<br>
state emission. This is an extra safety measure to prevent undiscovered<br>
difficult-to-diagnose gpu hangs.<br>
<br>
The art of emitting workaround flushes on Sandybridge is mysterious and<br>
not fully understood. Ken and I believe that<br>
intel_emit_post_sync_nonzero_flush() may be required when switching from<br>
regular drawing to blorp.<br>
<br>
CC: <a href="mailto:mesa-stable@lists.freedesktop.org">mesa-stable@lists.freedesktop.org</a><br>
CC: Kenneth Graunke <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>><br>
CC: Paul Berry <<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>><br>
CC: Stéphane Marchesin <<a href="mailto:marcheu@chromium.org">marcheu@chromium.org</a>><br>
Signed-off-by: Chad Versace <<a href="mailto:chad.versace@linux.intel.com">chad.versace@linux.intel.com</a>><br>
---<br>
src/mesa/drivers/dri/i965/gen6_blorp.cpp | 4 +++-<br>
1 file changed, 3 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/gen6_blorp.cpp b/src/mesa/drivers/dri/i965/gen6_blorp.cpp<br>
index 929d7b5..9db0840 100644<br>
--- a/src/mesa/drivers/dri/i965/gen6_blorp.cpp<br>
+++ b/src/mesa/drivers/dri/i965/gen6_blorp.cpp<br>
@@ -1023,7 +1023,6 @@ gen6_emit_hiz_workaround(struct brw_context *brw, enum gen6_hiz_op hiz_op)<br>
*/<br>
if (hiz_op == GEN6_HIZ_OP_DEPTH_RESOLVE ||<br>
hiz_op == GEN6_HIZ_OP_HIZ_RESOLVE) {<br>
- brw->batch.need_workaround_flush = true;<br>
intel_emit_post_sync_nonzero_flush(brw);<br>
intel_emit_depth_stall_flushes(brw);<br>
}<br>
@@ -1051,6 +1050,9 @@ gen6_blorp_exec(struct brw_context *brw,<br>
<br>
uint32_t prog_offset = params->get_wm_prog(brw, &prog_data);<br>
<br>
+ /* Emit workaround flushes when we switch from drawing to blorping. */<br>
+ brw->batch.need_workaround_flush = true;<br>
+<br></blockquote><div><br></div><div>This seems unnecessary to me. We already set need_workaround_flush whenever we emit a primitive, so isn't it guaranteed to be set whenever we reach this point in the code?<br></div>
</div></div></div>