anv: Wait for the GPU to be idle before invalidating the aux table.
authorRafael Antognolli <rafael.antognolli@intel.com>
Fri, 28 Feb 2020 21:57:07 +0000 (13:57 -0800)
committerMarge Bot <eric+marge@anholt.net>
Mon, 2 Mar 2020 22:28:11 +0000 (22:28 +0000)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4005>

src/intel/vulkan/genX_cmd_buffer.c

index b270b79fd4038d16f80e655e6dd5397943fd4faa..7e8c2d57eba209985e4025e1631ef6df9707208f 100644 (file)
@@ -2029,6 +2029,16 @@ genX(cmd_buffer_apply_pipe_flushes)(struct anv_cmd_buffer *cmd_buffer)
    if (bits & ANV_PIPE_FLUSH_BITS)
       bits |= ANV_PIPE_NEEDS_END_OF_PIPE_SYNC_BIT;
 
+
+   /* HSD 1209978178: docs say that before programming the aux table:
+    *
+    *    "Driver must ensure that the engine is IDLE but ensure it doesn't
+    *    add extra flushes in the case it knows that the engine is already
+    *    IDLE."
+    */
+   if (GEN_GEN == 12 && ANV_PIPE_AUX_TABLE_INVALIDATE_BIT)
+      bits |= ANV_PIPE_NEEDS_END_OF_PIPE_SYNC_BIT;
+
    /* If we're going to do an invalidate and we have a pending end-of-pipe
     * sync that has yet to be resolved, we do the end-of-pipe sync now.
     */