freedreno/a6xx: Initialize VFD_FETCH[n].SIZE to zero
authorRob Clark <robdclark@chromium.org>
Thu, 30 Jun 2022 17:44:20 +0000 (10:44 -0700)
committerMarge Bot <emma+marge@anholt.net>
Sun, 3 Jul 2022 23:20:46 +0000 (23:20 +0000)
Avoid inheriting VBOs from other processes/submits (ie. anywhere it
might not be an actual valid iova).

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6763
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17317>

src/gallium/drivers/freedreno/a6xx/fd6_emit.c

index 7fa2754..9059853 100644 (file)
@@ -1352,6 +1352,15 @@ fd6_emit_restore(struct fd_batch *batch, struct fd_ringbuffer *ring)
    OUT_PKT4(ring, REG_A6XX_RB_LRZ_CNTL, 1);
    OUT_RING(ring, 0x00000000);
 
+   /* Initialize VFD_FETCH[n].SIZE to zero to avoid iova faults trying
+    * to fetch from a VFD_FETCH[n].BASE which we've potentially inherited
+    * from another process:
+    */
+   for (int32_t i = 0; i < 32; i++) {
+      OUT_PKT4(ring, REG_A6XX_VFD_FETCH_SIZE(i), 1);
+      OUT_RING(ring, 0);
+   }
+
    /* This happens after all drawing has been emitted to the draw CS, so we know
     * whether we need the tess BO pointers.
     */