diff options
author | Nicolai Hähnle <nicolai.haehnle@amd.com> | 2017-10-22 17:38:50 +0200 |
---|---|---|
committer | Nicolai Hähnle <nicolai.haehnle@amd.com> | 2017-11-06 11:09:22 +0100 |
commit | 84e38f12e67c7c019ad0588dc60dfab5dc80ff68 (patch) | |
tree | d200c43dfd29dfbf6a2e85313c98e4e82cec3310 | |
parent | b64c9274283bd8bf0a03d4df79c8e663facd0a0b (diff) |
gallium/u_threaded: mark queries flushed only for non-deferred flushes
The driver uses (and must use) the flushed flag of queries as a hint that
it does not have to check for synchronization with currently queued up
commands. Deferred flushes do not actually flush queued up commands, so
we must not set the flushed flag for them.
Found by inspection.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
-rw-r--r-- | src/gallium/auxiliary/util/u_threaded_context.c | 8 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_threaded_context.h | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/util/u_threaded_context.c b/src/gallium/auxiliary/util/u_threaded_context.c index 7e28b87a7f..24fab7f5cb 100644 --- a/src/gallium/auxiliary/util/u_threaded_context.c +++ b/src/gallium/auxiliary/util/u_threaded_context.c @@ -1790,9 +1790,11 @@ tc_flush(struct pipe_context *_pipe, struct pipe_fence_handle **fence, struct pipe_context *pipe = tc->pipe; struct threaded_query *tq, *tmp; - LIST_FOR_EACH_ENTRY_SAFE(tq, tmp, &tc->unflushed_queries, head_unflushed) { - tq->flushed = true; - LIST_DEL(&tq->head_unflushed); + if (!(flags & PIPE_FLUSH_DEFERRED)) { + LIST_FOR_EACH_ENTRY_SAFE(tq, tmp, &tc->unflushed_queries, head_unflushed) { + tq->flushed = true; + LIST_DEL(&tq->head_unflushed); + } } /* TODO: deferred flushes? */ diff --git a/src/gallium/auxiliary/util/u_threaded_context.h b/src/gallium/auxiliary/util/u_threaded_context.h index 8977b03cd2..57805ee4a1 100644 --- a/src/gallium/auxiliary/util/u_threaded_context.h +++ b/src/gallium/auxiliary/util/u_threaded_context.h @@ -258,7 +258,7 @@ struct threaded_query { /* The query is added to the list in end_query and removed in flush. */ struct list_head head_unflushed; - /* Whether pipe->flush has been called after end_query. */ + /* Whether pipe->flush has been called in non-deferred mode after end_query. */ bool flushed; }; |