summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/panfrost
diff options
context:
space:
mode:
authorRohan Garg <[email protected]>2019-06-05 17:49:14 +0200
committerAlyssa Rosenzweig <[email protected]>2019-06-18 09:52:20 -0700
commitbfca21b622dfd2fcfe32494339aea9061070c7e5 (patch)
tree9e95c77145ba4d81f4d8adb97a5979ce4139f868 /src/gallium/drivers/panfrost
parentdebb85d1ecccaad237261906186a2612f951a9b8 (diff)
panfrost: Figure out job requirements in pan_job.c
Requirements for a job should be figured out in pan_job.c v2: [Alyssa] Fix early return Reviewed-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium/drivers/panfrost')
-rw-r--r--src/gallium/drivers/panfrost/pan_context.c8
-rw-r--r--src/gallium/drivers/panfrost/pan_job.c12
-rw-r--r--src/gallium/drivers/panfrost/pan_job.h4
3 files changed, 16 insertions, 8 deletions
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index 0441c3d573c..65f9255dd72 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -1103,14 +1103,6 @@ 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;
-
if (ctx->occlusion_query) {
ctx->payload_tiler.gl_enables |= MALI_OCCLUSION_QUERY | MALI_OCCLUSION_PRECISE;
ctx->payload_tiler.postfix.occlusion_counter = ctx->occlusion_query->transfer.gpu;
diff --git a/src/gallium/drivers/panfrost/pan_job.c b/src/gallium/drivers/panfrost/pan_job.c
index 333c9f1f147..a7fc5f975cf 100644
--- a/src/gallium/drivers/panfrost/pan_job.c
+++ b/src/gallium/drivers/panfrost/pan_job.c
@@ -89,6 +89,7 @@ panfrost_get_job(struct panfrost_context *ctx,
memcpy(&job->key, &key, sizeof(key));
_mesa_hash_table_insert(ctx->jobs, &job->key, job);
+ panfrost_job_set_requirements(ctx, job);
return job;
}
@@ -165,6 +166,17 @@ panfrost_job_submit(struct panfrost_context *ctx, struct panfrost_job *job)
}
void
+panfrost_job_set_requirements(struct panfrost_context *ctx,
+ struct panfrost_job *job)
+{
+ if (ctx->rasterizer && ctx->rasterizer->base.multisample)
+ job->requirements |= PAN_REQ_MSAA;
+
+ if (ctx->depth_stencil && 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