summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChad Versace <chad.versace@linux.intel.com>2013-12-20 04:39:03 -0800
committerCarl Worth <cworth@cworth.org>2014-01-02 15:59:44 -0800
commit9ccb6cc7b7466687813c651b75d84598a7789321 (patch)
tree797e5999ab9e78698819d603718eb17a55835417 /src
parent4d7961e95e53f80196c24a26309ae7ba9765297c (diff)
i965/gen6: Fix HiZ hang in WebGL Google Maps
Emitting flushes before depth and hiz resolves at the top of blorp's state emission fixes the hang. Marchesin and I found the fix experimentally, as opposed to adhering to a documented hardware workaround. A more minimal fix likely exists, but this gets the job done. Fixes HiZ hangs in the new WebGL Google maps on Sandybridge Chrome OS. Tested by zooming in and out continuously for 2 hours. This patch is based on https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/8bc07bb70163c3706fb4ba5f980e57dc942f56dd CC: mesa-stable@lists.freedesktop.org Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70740 Signed-off-by: St├ęphane Marchesin <marcheu@chromium.org> Signed-off-by: Chad Versace <chad.versace@linux.intel.com> Reviewed-by: Paul Berry <stereotype441@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (cherry picked from commit 1a928816a1b717201f3b3cc998a42731b280e6ba)
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/gen6_blorp.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/gen6_blorp.cpp b/src/mesa/drivers/dri/i965/gen6_blorp.cpp
index 8fb8ca14dae..ccb09e7452a 100644
--- a/src/mesa/drivers/dri/i965/gen6_blorp.cpp
+++ b/src/mesa/drivers/dri/i965/gen6_blorp.cpp
@@ -1012,6 +1012,19 @@ gen6_blorp_emit_primitive(struct brw_context *brw,
ADVANCE_BATCH();
}
+static void
+gen6_emit_hiz_workaround(struct brw_context *brw, enum gen6_hiz_op hiz_op)
+{
+ /* This fixes a HiZ hang in WebGL Google Maps. A more minimal fix likely
+ * exists, but this gets the job done.
+ */
+ if (hiz_op == GEN6_HIZ_OP_DEPTH_RESOLVE ||
+ hiz_op == GEN6_HIZ_OP_HIZ_RESOLVE) {
+ brw->batch.need_workaround_flush = true;
+ intel_emit_post_sync_nonzero_flush(brw);
+ intel_emit_depth_stall_flushes(brw);
+ }
+}
/**
* \brief Execute a blit or render pass operation.
@@ -1034,6 +1047,8 @@ gen6_blorp_exec(struct brw_context *brw,
uint32_t wm_bind_bo_offset = 0;
uint32_t prog_offset = params->get_wm_prog(brw, &prog_data);
+
+ gen6_emit_hiz_workaround(brw, params->hiz_op);
gen6_emit_3dstate_multisample(brw, params->num_samples);
gen6_emit_3dstate_sample_mask(brw, params->num_samples, 1.0, false, ~0u);
gen6_blorp_emit_state_base_address(brw, params);