Mesa (master): panfrost: Flush scanout too

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jun 17 15:25:47 UTC 2019


Module: Mesa
Branch: master
Commit: 6460442049012977a96e84307a128d2b7c27abfd
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6460442049012977a96e84307a128d2b7c27abfd

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Fri Jun 14 12:26:19 2019 -0700

panfrost: Flush scanout too

In a poorly coded app, the framebuffer can be partially drawn, an FBO
switched, switch back to the framebuffer and keep drawing, etc.
Reordering would fix this, but for now we need to just be careful about
flushing scanout too.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>

---

 src/gallium/drivers/panfrost/pan_context.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index bce57625163..b6839e71ca1 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -2153,12 +2153,15 @@ panfrost_set_framebuffer_state(struct pipe_context *pctx,
 {
         struct panfrost_context *ctx = pan_context(pctx);
 
-        /* Flush when switching away from an FBO, but not if the framebuffer
+        /* Flush when switching framebuffers, but not if the framebuffer
          * state is being restored by u_blitter
          */
 
-        if (!panfrost_is_scanout(ctx) && !ctx->blitter->running) {
-                panfrost_flush(pctx, NULL, 0);
+        bool is_scanout = panfrost_is_scanout(ctx);
+        bool has_draws = ctx->draw_count > 0;
+
+        if (!ctx->blitter->running && (!is_scanout || has_draws)) {
+                panfrost_flush(pctx, NULL, PIPE_FLUSH_END_OF_FRAME);
         }
 
         ctx->pipe_framebuffer.nr_cbufs = fb->nr_cbufs;




More information about the mesa-commit mailing list