[Mesa-dev] [PATCH libdrm 3/9] panfrost/midgard: Figure out job requirements in pan_job.c

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


Requirements for a job should be figured out in pan_job.c
---
 src/gallium/drivers/panfrost/pan_context.c |  8 +-------
 src/gallium/drivers/panfrost/pan_job.c     | 11 +++++++++++
 src/gallium/drivers/panfrost/pan_job.h     |  4 ++++
 3 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index d6a54f9a9f5..4c53b2d58f5 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -921,13 +921,7 @@ panfrost_emit_for_draw(struct panfrost_context *ctx, bool with_vertex_data)
                 SET_BIT(ctx->fragment_shader_core.unknown2_4, MALI_NO_MSAA, !msaa);
         }
 
-        /* Enable job requirements at draw-time */
-
-        if (msaa)
-                job->requirements |= PAN_REQ_MSAA;
-
-        if (ctx->depth_stencil->depth.writemask)
-                job->requirements |= PAN_REQ_DEPTH_WRITE;
+        panfrost_job_set_requirements(ctx, job);
 
         if (ctx->occlusion_query) {
                 ctx->payload_tiler.gl_enables |= MALI_OCCLUSION_QUERY | MALI_OCCLUSION_PRECISE;
diff --git a/src/gallium/drivers/panfrost/pan_job.c b/src/gallium/drivers/panfrost/pan_job.c
index 333c9f1f147..0083ca6499e 100644
--- a/src/gallium/drivers/panfrost/pan_job.c
+++ b/src/gallium/drivers/panfrost/pan_job.c
@@ -164,6 +164,17 @@ panfrost_job_submit(struct panfrost_context *ctx, struct panfrost_job *job)
         ctx->tiler_job_count = 0;
 }
 
+void
+panfrost_job_set_requirements(struct panfrost_context *ctx,
+                         struct panfrost_job *job)
+{
+        if (ctx->rasterizer->base.multisample)
+                job->requirements |= PAN_REQ_MSAA;
+
+        if (ctx->depth_stencil->depth.writemask)
+                job->requirements |= PAN_REQ_DEPTH_WRITE;
+}
+
 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 afc9ac4e58f..cbfd6cb0c7f 100644
--- a/src/gallium/drivers/panfrost/pan_job.h
+++ b/src/gallium/drivers/panfrost/pan_job.h
@@ -90,4 +90,8 @@ panfrost_flush_jobs_reading_resource(struct panfrost_context *panfrost,
 
 void
 panfrost_job_submit(struct panfrost_context *ctx, struct panfrost_job *job);
+
+void
+panfrost_job_set_requirements(struct panfrost_context *ctx,
+                         struct panfrost_job *job);
 #endif
-- 
2.17.1



More information about the mesa-dev mailing list