iris: Zero the compute predicate when changing the render condition

1. Set a render condition.  We emit it immediately on the render
   engine, and stash q->bo as ice->state.compute_predicate in case
   the compute engine needs it.

2. Clear the render condition.  We were incorrectly leaving a stale
   compute_predicate kicking around...

3. Dispatch compute.  We would then read the stale compute predicate,
   and try to load it into MI_PREDICATE_DATA.  But q->bo may have been
   freed altogether, causing us to try and use garbage memory as a BO,
   adding it to the validation list, failing asserts, and tripping
   EINVALs in execbuf.

Huge thanks to Mark Janes for narrowing this sporadic GL CTS failure
down to a list of 48 tests I could easily run to reproduce it.  Huge
thanks to the Valgrind authors for the memcheck tool that immediately
pinpointed the problem.
This commit is contained in:
Kenneth Graunke
2019-01-22 14:22:55 -08:00
parent 4fd1f70e62
commit 5d3d757178
+3
View File
@@ -1028,6 +1028,9 @@ iris_render_condition(struct pipe_context *ctx,
struct iris_context *ice = (void *) ctx;
struct iris_query *q = (void *) query;
/* The old condition isn't relevant; we'll update it if necessary */
ice->state.compute_predicate = NULL;
if (!q) {
ice->state.predicate = IRIS_PREDICATE_STATE_RENDER;
return;