[libdrm,9/9] Fixes 88ae2f5870c: "panfrost/midgard: Remove unnecessary variables"

Submitted by Rohan Garg on June 12, 2019, 11:24 a.m.

Details

Message ID 20190612112439.7483-10-rohan.garg@collabora.com
State New
Headers show
Series "panfrost/midgard: Refactor pan_context" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Rohan Garg June 12, 2019, 11:24 a.m.
Make sure we link the last vertex job to the first tiler job.
---
 src/gallium/drivers/panfrost/pan_context.c | 6 ++++++
 1 file changed, 6 insertions(+)

Patch hide | download patch | download mbox

diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index 00acb464bc6..caa914e33cb 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -581,6 +581,7 @@  struct panfrost_transfer
 panfrost_vertex_tiler_job(struct panfrost_context *ctx, bool is_tiler)
 {
         struct panfrost_job *job = panfrost_get_job_for_fbo(ctx);
+        static mali_ptr first_tiler_job = 0;
 
         /* Each draw call corresponds to two jobs, and the set-value job is first */
         int draw_job_index = 1 + (2 * job->draw_count) + 1;
@@ -623,6 +624,11 @@  panfrost_vertex_tiler_job(struct panfrost_context *ctx, bool is_tiler)
                 if (job->draw_count) {
                         /* Previous vertex job points to this vertex job */
                         panfrost_link_job_pair(ctx->u_vertex_jobs[job->draw_count - 1], transfer.gpu);
+
+                        /* Last vertex job points to first tiler job */
+                        if (!first_tiler_job)
+                                first_tiler_job = transfer.gpu;
+                        panfrost_link_job_pair(&next_job, first_tiler_job);
                 } else {
                         /* Have the first vertex job depend on the set value job */
                         next_job.job_dependency_index_1 = ctx->u_set_value_job->job_index;