Mesa (main): panfrost: Fix batch state changes on Valhall

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jun 20 19:00:15 UTC 2022


Module: Mesa
Branch: main
Commit: 950d27f9bf148a75eb9e4bdf79f678e3b075f160
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=950d27f9bf148a75eb9e4bdf79f678e3b075f160

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Wed Jun 15 15:54:08 2022 -0400

panfrost: Fix batch state changes on Valhall

If we need to change batch state (currently just point coord origins), not only
do we need to flush the old batch, but also set the desired state on the new
batch. That second step was missing. Fix that so this mechanism works as
intended.

Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Fixes: 3641dfe4367 ("panfrost: Flip point coords in hardware")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17068>

---

 src/gallium/drivers/panfrost/pan_cmdstream.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c
index 97cf2097b9b..c8051b72d7f 100644
--- a/src/gallium/drivers/panfrost/pan_cmdstream.c
+++ b/src/gallium/drivers/panfrost/pan_cmdstream.c
@@ -4009,9 +4009,13 @@ panfrost_draw_vbo(struct pipe_context *pipe,
         if (unlikely(batch->scoreboard.job_index > 10000))
                 batch = panfrost_get_fresh_batch_for_fbo(ctx, "Too many draws");
 
-        if (unlikely(!panfrost_compatible_batch_state(batch)))
+        if (unlikely(!panfrost_compatible_batch_state(batch))) {
                 batch = panfrost_get_fresh_batch_for_fbo(ctx, "State change");
 
+                ASSERTED bool succ = panfrost_compatible_batch_state(batch);
+                assert(succ && "must be able to set state for a fresh batch");
+        }
+
         /* panfrost_batch_skip_rasterization reads
          * batch->scissor_culls_everything, which is set by
          * panfrost_emit_viewport, so call that first.



More information about the mesa-commit mailing list