aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/panfrost
diff options
context:
space:
mode:
authorBoris Brezillon <[email protected]>2019-08-02 19:18:43 +0200
committerBoris Brezillon <[email protected]>2019-08-02 21:54:58 +0200
commit8645afce4c19ca78fe7087b325467293c3c04bea (patch)
treeb91a369120655e6d2dd25ee548e91ce82440ec04 /src/gallium/drivers/panfrost
parent17d6ee2bd14fa81c33b4024e0a18fb8cf1f0ce25 (diff)
panfrost: Bail out early when new and current FB states are equal
If the current FB matches the new one there's nothing to be done in panfrost_set_framebuffer_state(). By bailing out early in that case we avoid emitting new FB descriptors (the old ones are still valid). Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium/drivers/panfrost')
-rw-r--r--src/gallium/drivers/panfrost/pan_context.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index a88e6a4607d..65e6824a9b0 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -2365,6 +2365,10 @@ panfrost_set_framebuffer_state(struct pipe_context *pctx,
bool is_scanout = panfrost_is_scanout(ctx);
bool has_draws = job->last_job.gpu;
+ /* Bail out early when the current and new states are the same. */
+ if (util_framebuffer_state_equal(&ctx->pipe_framebuffer, fb))
+ return;
+
if (!ctx->wallpaper_batch && (!is_scanout || has_draws)) {
panfrost_flush(pctx, NULL, PIPE_FLUSH_END_OF_FRAME);
}