summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2019-01-22 14:22:55 -0800
committerKenneth Graunke <[email protected]>2019-02-21 10:26:11 -0800
commit5d3d75717878d7a93d6b122fcea297d88ebf629d (patch)
tree706cfcedebbbdbd5cfc68544dc9334c1e6c47487
parent4fd1f70e62e1bbba228712065f756a1c30650432 (diff)
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.
-rw-r--r--src/gallium/drivers/iris/iris_query.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gallium/drivers/iris/iris_query.c b/src/gallium/drivers/iris/iris_query.c
index 66169d1db05..4cb59d40949 100644
--- a/src/gallium/drivers/iris/iris_query.c
+++ b/src/gallium/drivers/iris/iris_query.c
@@ -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;