freedreno/a6xx: Restore mode
authorRob Clark <robdclark@chromium.org>
Wed, 22 Mar 2023 18:56:09 +0000 (11:56 -0700)
committerMarge Bot <emma+marge@anholt.net>
Wed, 22 Mar 2023 20:53:17 +0000 (20:53 +0000)
We set the "mode" to 1 for CS because we want CP_SET_DRAW_STATE to
immediately execute the state groups.  But in the 3d path, we don't
restore the value in the sysmem path.  This was causing GPU faults
on 7c3 and presumably other a6xx gen4 things.  But somehow not on
a6xx gen1.

Let's just set it as part of initial state restore where we are
ensuring that the GPU is in a sane state.

Fixes: dec49ec50a2 ("freedreno/a6xx: Move CS state to PROG state group")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22080>

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

index b8d976c..03dc180 100644 (file)
@@ -760,6 +760,9 @@ fd6_emit_restore(struct fd_batch *batch, struct fd_ringbuffer *ring)
       trace_start_state_restore(&batch->trace, ring);
    }
 
+   OUT_PKT7(ring, CP_SET_MODE, 1);
+   OUT_RING(ring, 0);
+
    fd6_cache_inv(batch, ring);
 
    OUT_REG(ring,