blorp: Emit a dummy 3DSTATE_WM prior to 3DSTATE_WM_HZ_OP
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 16 Oct 2018 19:58:18 +0000 (14:58 -0500)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 26 Oct 2018 21:39:35 +0000 (16:39 -0500)
Cc: mesa-stable@lists.freedesktop.org
Suggested-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/intel/blorp/blorp_genX_exec.h

index 7a8c45dbee57a196029049401139020358d113e8..065980616ecc932bcbcda4b4c58897a79fe262e0 100644 (file)
@@ -1642,6 +1642,15 @@ blorp_emit_gen8_hiz_op(struct blorp_batch *batch,
       blorp_emit_cc_viewport(batch);
    }
 
+   /* According to the SKL PRM formula for WM_INT::ThreadDispatchEnable, the
+    * 3DSTATE_WM::ForceThreadDispatchEnable field can force WM thread dispatch
+    * even when WM_HZ_OP is active.  However, WM thread dispatch is normally
+    * disabled for HiZ ops and it appears that force-enabling it can lead to
+    * GPU hangs on at least Skylake.  Since we don't know the current state of
+    * the 3DSTATE_WM packet, just emit a dummy one prior to 3DSTATE_WM_HZ_OP.
+    */
+   blorp_emit(batch, GENX(3DSTATE_WM), wm);
+
    /* If we can't alter the depth stencil config and multiple layers are
     * involved, the HiZ op will fail. This is because the op requires that a
     * new config is emitted for each additional layer.