panfrost: Initial implementation of panfrost_job_submit
authorRohan Garg <rohan.garg@collabora.com>
Wed, 5 Jun 2019 14:20:59 +0000 (16:20 +0200)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 18 Jun 2019 16:52:01 +0000 (09:52 -0700)
Start fleshing out panfrost_job

v2: [Alyssa: Remove unused variable, warning introduced]

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/gallium/drivers/panfrost/pan_context.c
src/gallium/drivers/panfrost/pan_job.c
src/gallium/drivers/panfrost/pan_job.h

index ed19fa176450fa30a7a8358e9679b513938a3e4f..9b6ab41373d85ab7ae25d7abed9307a3c51cf2c7 100644 (file)
@@ -1473,13 +1473,9 @@ panfrost_submit_frame(struct panfrost_context *ctx, bool flush_immediate,
         struct pipe_context *gallium = (struct pipe_context *) ctx;
         struct panfrost_screen *screen = pan_screen(gallium->screen);
 
-        /* Edge case if screen is cleared and nothing else */
-        bool has_draws = ctx->draw_count > 0;
-
 #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 */
 
index 6e913ac3374daa0300277c8181141816b758fac2..1e09760871c01ed91c8afae07a990a41ae3373c5 100644 (file)
@@ -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)
index 1b28084c599a020c0f07e38df033915b9cf776f6..afc9ac4e58f27902b9048a7406383a9c806829e3 100644 (file)
@@ -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