summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/iris/iris_query.c
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2018-09-30 08:49:02 +0200
committerKenneth Graunke <[email protected]>2019-02-21 10:26:09 -0800
commitc6016d3761c4df3d29b0a0fec39cfb2523c5c608 (patch)
tree187b1a88ab4730fb48da0eed33732b22398e1eb0 /src/gallium/drivers/iris/iris_query.c
parent3c0ef22edb3e696a1e1d3b78e14a1c5f108c66fb (diff)
iris: just mark snapshots_landed from the CPU
otherwise, get results may check q->map->snapshots_landed...before our commands to initialize it to false have actually executed...so it'd get some random garbage from the BO...
Diffstat (limited to 'src/gallium/drivers/iris/iris_query.c')
-rw-r--r--src/gallium/drivers/iris/iris_query.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/src/gallium/drivers/iris/iris_query.c b/src/gallium/drivers/iris/iris_query.c
index b9a7823afe9..1183a65fef2 100644
--- a/src/gallium/drivers/iris/iris_query.c
+++ b/src/gallium/drivers/iris/iris_query.c
@@ -127,25 +127,18 @@ iris_is_query_pipelined(struct iris_query *q)
}
static void
-write_availability(struct iris_context *ice,
- struct iris_query *q,
- bool available)
+mark_available(struct iris_context *ice, struct iris_query *q)
{
struct iris_batch *batch = &ice->render_batch;
unsigned flags = PIPE_CONTROL_WRITE_IMMEDIATE;
unsigned offset = offsetof(struct iris_query_snapshots, snapshots_landed);
if (!iris_is_query_pipelined(q)) {
- ice->vtbl.store_data_imm64(batch, q->bo, offset, available);
+ ice->vtbl.store_data_imm64(batch, q->bo, offset, true);
} else {
- if (available) {
- /* Order available *after* the query results. */
- flags |= PIPE_CONTROL_FLUSH_ENABLE;
- } else {
- /* Make it unavailable *before* any pipelined reads. */
- flags |= PIPE_CONTROL_CS_STALL;
- }
- iris_emit_pipe_control_write(batch, flags, q->bo, offset, available);
+ /* Order available *after* the query results. */
+ flags |= PIPE_CONTROL_FLUSH_ENABLE;
+ iris_emit_pipe_control_write(batch, flags, q->bo, offset, true);
}
}
@@ -371,19 +364,19 @@ iris_begin_query(struct pipe_context *ctx, struct pipe_query *query)
if (!q->bo)
return false;
- q->map = iris_bo_map(&ice->dbg, q->bo, MAP_READ | MAP_ASYNC);
+ q->map = iris_bo_map(&ice->dbg, q->bo, MAP_READ | MAP_WRITE | MAP_ASYNC);
if (!q->map)
return false;
q->result = 0ull;
q->ready = false;
+ q->map->snapshots_landed = false;
if (q->type == PIPE_QUERY_PRIMITIVES_GENERATED && q->index == 0) {
ice->state.prims_generated_query_active = true;
ice->state.dirty |= IRIS_DIRTY_STREAMOUT;
}
- write_availability(ice, q, false);
write_value(ice, q, offsetof(struct iris_query_snapshots, start));
return true;
@@ -397,7 +390,7 @@ iris_end_query(struct pipe_context *ctx, struct pipe_query *query)
if (q->type == PIPE_QUERY_TIMESTAMP) {
iris_begin_query(ctx, query);
- write_availability(ice, q, true);
+ mark_available(ice, q);
return true;
}
@@ -407,7 +400,7 @@ iris_end_query(struct pipe_context *ctx, struct pipe_query *query)
}
write_value(ice, q, offsetof(struct iris_query_snapshots, end));
- write_availability(ice, q, true);
+ mark_available(ice, q);
return true;
}