[Mesa-dev] [PATCH 08/25] gallium/u_threaded: mark queries flushed only for non-deferred flushes
Marek Olšák
maraeo at gmail.com
Mon Oct 30 12:31:03 UTC 2017
On Mon, Oct 30, 2017 at 2:57 AM, Marek Olšák <maraeo at gmail.com> wrote:
> On Sun, Oct 22, 2017 at 9:07 PM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
>> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
>>
>> 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.
>> ---
>> src/gallium/auxiliary/util/u_threaded_context.c | 8 +++++---
>> 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 7e28b87a7ff..24fab7f5cb6 100644
>> --- a/src/gallium/auxiliary/util/u_threaded_context.c
>> +++ b/src/gallium/auxiliary/util/u_threaded_context.c
>> @@ -1783,23 +1783,25 @@ tc_create_video_buffer(struct pipe_context *_pipe,
>> */
>>
>> static void
>> tc_flush(struct pipe_context *_pipe, struct pipe_fence_handle **fence,
>> unsigned flags)
>> {
>> struct threaded_context *tc = threaded_context(_pipe);
>> 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)) {
>
> Do we also need to check the ASYNC flag here? Or top-of-pipe and
> bottom-of-pipe flags that don't have to flush caches if I understand
> correctly?
ASYNC is actually OK, because buffers have their fences updated even
though they are future fences.
Marek
More information about the mesa-dev
mailing list