From 950d27f9bf148a75eb9e4bdf79f678e3b075f160 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 15 Jun 2022 15:54:08 -0400 Subject: [PATCH] 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 Fixes: 3641dfe4367 ("panfrost: Flip point coords in hardware") Part-of: --- 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 97cf209..c8051b7 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. -- 2.7.4