v3d: Emit a TF flush after each draw using TF.
authorEric Anholt <eric@anholt.net>
Mon, 25 Jun 2018 17:12:03 +0000 (10:12 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 2 Jul 2018 17:05:14 +0000 (10:05 -0700)
This fixes GPU hangs on 7278 in transform feedback tests such as
GTF-GLES3.gtf.GL3Tests.transform_feedback2.transform_feedback2_basic

src/broadcom/cle/v3d_packet_v33.xml
src/gallium/drivers/v3d/v3dx_draw.c

index ff5ecb5c171600d38e5fb7cd1c9bec748f43d8df..3e85b6723203079aec5d765c3317048e61b6384d 100644 (file)
     </field>
   </packet>
 
+  <packet code="31" name="Transform Feedback Flush and Count"/>
+
   <packet code="32" name="Indexed Primitive List" cl="B" max_ver="33">
     <field name="Minimum index" size="32" start="104" type="uint"/>
     <field name="Enable Primitive Restarts" size="1" start="103" type="bool"/>
index 1e8b472a27dc06ccd09ffa44747999d4b958f043..43dd4089f123e7aa0ea2206a38c8c0f02c3f9f98 100644 (file)
@@ -558,6 +558,13 @@ v3d_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
                         }
                 }
         }
+
+        /* A flush is required in between a TF draw and any following TF specs
+         * packet, or the GPU may hang.  Just flush each time for now.
+         */
+        if (v3d->streamout.num_targets)
+                cl_emit(&job->bcl, TRANSFORM_FEEDBACK_FLUSH_AND_COUNT, flush);
+
         job->draw_calls_queued++;
 
         /* Increment the TF offsets by how many verts we wrote.  XXX: This