summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2018-03-23 15:28:40 -0700
committerEric Anholt <[email protected]>2018-03-26 17:46:19 -0700
commitef2cf9cc3c1a4bc96fcc46eb623768a400c3d68d (patch)
tree5607fdfd0b1872244adba3c4effb0a3e2cdf7ff7 /src/gallium/drivers
parent1fa820cef861b0f2efd001cfb3c4adecf2fa549b (diff)
broadcom/vc5: Disable transform feedback on V3D 4.x at the end of the job.
The next job from this client will turn it back on unless TF gets disabled, but we don't want the state to leak from this client to another (which causes GPU hangs).
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/vc5/v3dx_job.c21
-rw-r--r--src/gallium/drivers/vc5/vc5_context.h6
-rw-r--r--src/gallium/drivers/vc5/vc5_emit.c7
3 files changed, 29 insertions, 5 deletions
diff --git a/src/gallium/drivers/vc5/v3dx_job.c b/src/gallium/drivers/vc5/v3dx_job.c
index d4b0adfea0a..ca3831c75bb 100644
--- a/src/gallium/drivers/vc5/v3dx_job.c
+++ b/src/gallium/drivers/vc5/v3dx_job.c
@@ -33,8 +33,12 @@
void v3dX(bcl_epilogue)(struct vc5_context *vc5, struct vc5_job *job)
{
vc5_cl_ensure_space_with_branch(&job->bcl,
- 7 +
- cl_packet_length(OCCLUSION_QUERY_COUNTER));
+ cl_packet_length(OCCLUSION_QUERY_COUNTER) +
+#if V3D_VERSION >= 41
+ cl_packet_length(TRANSFORM_FEEDBACK_SPECS) +
+#endif
+ cl_packet_length(INCREMENT_SEMAPHORE) +
+ cl_packet_length(FLUSH_ALL_STATE));
if (job->oq_enabled) {
/* Disable the OQ at the end of the CL, so that the
@@ -44,6 +48,19 @@ void v3dX(bcl_epilogue)(struct vc5_context *vc5, struct vc5_job *job)
cl_emit(&job->bcl, OCCLUSION_QUERY_COUNTER, counter);
}
+ /* Disable TF at the end of the CL, so that the next job to be
+ * run doesn't start out trying to write TF primitives. On
+ * V3D 3.x, it's only the TF primitive mode that triggers TF
+ * writes.
+ */
+#if V3D_VERSION >= 41
+ if (job->tf_enabled) {
+ cl_emit(&job->bcl, TRANSFORM_FEEDBACK_SPECS, tfe) {
+ tfe.enable = false;
+ };
+ }
+#endif /* V3D_VERSION >= 41 */
+
/* Increment the semaphore indicating that binning is done and
* unblocking the render thread. Note that this doesn't act
* until the FLUSH completes.
diff --git a/src/gallium/drivers/vc5/vc5_context.h b/src/gallium/drivers/vc5/vc5_context.h
index 7272e045c4f..f6ed91c27ae 100644
--- a/src/gallium/drivers/vc5/vc5_context.h
+++ b/src/gallium/drivers/vc5/vc5_context.h
@@ -294,6 +294,12 @@ struct vc5_job {
*/
bool oq_enabled;
+ /**
+ * Set when a packet enabling TF on all further primitives has been
+ * emitted.
+ */
+ bool tf_enabled;
+
bool uses_early_z;
/**
diff --git a/src/gallium/drivers/vc5/vc5_emit.c b/src/gallium/drivers/vc5/vc5_emit.c
index 061d6e7c9d9..a98fd037d08 100644
--- a/src/gallium/drivers/vc5/vc5_emit.c
+++ b/src/gallium/drivers/vc5/vc5_emit.c
@@ -585,12 +585,13 @@ v3dX(emit_state)(struct pipe_context *pctx)
vc5->prog.bind_vs->tf_specs);
#if V3D_VERSION >= 40
+ job->tf_enabled = (vc5->prog.bind_vs->num_tf_specs != 0 &&
+ vc5->active_queries);
+
cl_emit(&job->bcl, TRANSFORM_FEEDBACK_SPECS, tfe) {
tfe.number_of_16_bit_output_data_specs_following =
vc5->prog.bind_vs->num_tf_specs;
- tfe.enable =
- (vc5->prog.bind_vs->num_tf_specs != 0 &&
- vc5->active_queries);
+ tfe.enable = job->tf_enabled;
};
#else /* V3D_VERSION < 40 */
cl_emit(&job->bcl, TRANSFORM_FEEDBACK_ENABLE, tfe) {