[Mesa-dev] [PATCH libdrm 1/9] panfrost/midgard: Initial implementation of panfrost_job_submit

Rohan Garg rohan.garg at collabora.com
Wed Jun 12 11:24:31 UTC 2019


Start fleshing out panfrost_job
---
 src/gallium/drivers/panfrost/pan_context.c |  3 +--
 src/gallium/drivers/panfrost/pan_job.c     | 20 ++++++++++++++++++++
 src/gallium/drivers/panfrost/pan_job.h     |  2 ++
 3 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index 6dab13de1f2..4680dd2ff8c 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -1350,8 +1350,7 @@ panfrost_submit_frame(struct panfrost_context *ctx, bool flush_immediate,
 
 #ifndef DRY_RUN
         
-        bool is_scanout = panfrost_is_scanout(ctx);
-        screen->driver->submit_vs_fs_job(ctx, has_draws, is_scanout);
+        panfrost_job_submit(ctx, job);
 
         /* If visual, we can stall a frame */
 
diff --git a/src/gallium/drivers/panfrost/pan_job.c b/src/gallium/drivers/panfrost/pan_job.c
index 6e913ac3374..1e09760871c 100644
--- a/src/gallium/drivers/panfrost/pan_job.c
+++ b/src/gallium/drivers/panfrost/pan_job.c
@@ -140,6 +140,26 @@ panfrost_flush_jobs_writing_resource(struct panfrost_context *panfrost,
         /* TODO stub */
 }
 
+void
+panfrost_job_submit(struct panfrost_context *ctx, struct panfrost_job *job)
+{
+        struct pipe_context *gallium = (struct pipe_context *) ctx;
+        struct panfrost_screen *screen = pan_screen(gallium->screen);
+        int ret;
+
+        bool has_draws = ctx->draw_count > 0;
+        bool is_scanout = panfrost_is_scanout(ctx);
+
+        if (!job)
+                return;
+
+        ret = screen->driver->submit_vs_fs_job(ctx, has_draws, is_scanout);
+
+        if (ret)
+                fprintf(stderr, "panfrost_job_submit failed: %d\n", ret);
+
+}
+
 void
 panfrost_flush_jobs_reading_resource(struct panfrost_context *panfrost,
                                 struct pipe_resource *prsc)
diff --git a/src/gallium/drivers/panfrost/pan_job.h b/src/gallium/drivers/panfrost/pan_job.h
index 1b28084c599..afc9ac4e58f 100644
--- a/src/gallium/drivers/panfrost/pan_job.h
+++ b/src/gallium/drivers/panfrost/pan_job.h
@@ -88,4 +88,6 @@ void
 panfrost_flush_jobs_reading_resource(struct panfrost_context *panfrost,
                                 struct pipe_resource *prsc);
 
+void
+panfrost_job_submit(struct panfrost_context *ctx, struct panfrost_job *job);
 #endif
-- 
2.17.1



More information about the mesa-dev mailing list