diff --git a/src/gallium/drivers/freedreno/freedreno_fence.c b/src/gallium/drivers/freedreno/freedreno_fence.c index 7d748e460d6..e7677009f79 100644 --- a/src/gallium/drivers/freedreno/freedreno_fence.c +++ b/src/gallium/drivers/freedreno/freedreno_fence.c @@ -289,10 +289,10 @@ fd_pipe_fence_set_batch(struct pipe_fence_handle *fence, struct fd_batch *batch) { if (batch) { assert(!fence->batch); - fence->batch = batch; + fd_batch_reference(&fence->batch, batch); fd_batch_needs_flush(batch); } else { - fence->batch = NULL; + fd_batch_reference(&fence->batch, NULL); /* When the batch is dis-associated with the fence, we can signal TC * that the fence is flushed diff --git a/src/gallium/drivers/freedreno/freedreno_fence.h b/src/gallium/drivers/freedreno/freedreno_fence.h index 30d568ac82c..2bd4c581c7b 100644 --- a/src/gallium/drivers/freedreno/freedreno_fence.h +++ b/src/gallium/drivers/freedreno/freedreno_fence.h @@ -44,13 +44,13 @@ struct pipe_fence_handle { */ struct pipe_fence_handle *last_fence; - /* fence holds a weak reference to the batch until the batch is flushed, to + /* fence holds a reference to the batch until the batch is flushed, to * accommodate PIPE_FLUSH_DEFERRED. When the batch is actually flushed, it * is cleared (before the batch reference is dropped). If we need to wait * on a fence, and the batch is not NULL, we need to flush it. * * Note that with u_threaded_context async flushes, if a fence is requested - * by the frontend, the fence is initially created without a weak reference + * by the frontend, the fence is initially created without a reference * to the batch, which is filled in later when fd_context_flush() is called * from the driver thread. In this case tc_token will be non-null, in * which case threaded_context_flush() should be called in fd_fence_finish()