[Mesa-dev] [PATCH 5/5] panfrost: Wait for last job to finish in force_flush_fragment

Tomeu Vizoso tomeu.vizoso at collabora.com
Wed Mar 27 15:32:52 UTC 2019


Signed-off-by: Tomeu Vizoso <tomeu.vizoso at collabora.com>
---
 src/gallium/drivers/panfrost/pan_drm.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/gallium/drivers/panfrost/pan_drm.c b/src/gallium/drivers/panfrost/pan_drm.c
index 887bf19148e7..c30beaf2b500 100644
--- a/src/gallium/drivers/panfrost/pan_drm.c
+++ b/src/gallium/drivers/panfrost/pan_drm.c
@@ -296,6 +296,14 @@ panfrost_drm_force_flush_fragment(struct panfrost_context *ctx,
 				  struct pipe_fence_handle **fence)
 {
         struct pipe_context *gallium = (struct pipe_context *) ctx;
+        struct panfrost_screen *screen = pan_screen(gallium->screen);
+        struct panfrost_drm *drm = (struct panfrost_drm *)screen->driver;
+        int ret;
+
+        if (!screen->last_fragment_flushed) {
+		drmSyncobjWait(drm->fd, &ctx->out_sync, 1, INT64_MAX, 0, NULL);
+                screen->last_fragment_flushed = true;
+	}
 
         if (fence) {
                 struct panfrost_fence *f = panfrost_fence_create(ctx);
-- 
2.20.1



More information about the mesa-dev mailing list