[PATCH v2 0/1] MR137: vkd3d: Leave the command queue op mutex locked after a partial flush.
All return paths in d3d12_command_queue_flush_ops_locked() must leave the op mutex locked. -- v2: vkd3d: Leave the command queue op mutex locked after a partial flush. https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/137
From: Conor McCarthy <cmccarthy(a)codeweavers.com> All return paths in d3d12_command_queue_flush_ops_locked() must leave the op mutex locked. --- libs/vkd3d/command.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c index e5ead7d3..3933f791 100644 --- a/libs/vkd3d/command.c +++ b/libs/vkd3d/command.c @@ -6781,7 +6781,8 @@ static bool d3d12_command_queue_op_array_append(struct d3d12_command_queue_op_ar return true; } -static HRESULT d3d12_command_queue_fixup_after_flush(struct d3d12_command_queue *queue, unsigned int done_count) +static HRESULT d3d12_command_queue_fixup_and_lock_after_flush(struct d3d12_command_queue *queue, + unsigned int done_count) { HRESULT hr; @@ -6798,11 +6799,7 @@ static HRESULT d3d12_command_queue_fixup_after_flush(struct d3d12_command_queue queue->aux_op_queue.count = 0; queue->is_flushing = false; - hr = d3d12_command_queue_record_as_blocked(queue); - - vkd3d_mutex_unlock(&queue->op_mutex); - - return hr; + return d3d12_command_queue_record_as_blocked(queue); } static HRESULT d3d12_command_queue_flush_ops(struct d3d12_command_queue *queue, bool *flushed_any) @@ -6855,7 +6852,7 @@ static HRESULT d3d12_command_queue_flush_ops_locked(struct d3d12_command_queue * if (op->u.wait.value > fence->max_pending_value) { vkd3d_mutex_unlock(&fence->mutex); - return d3d12_command_queue_fixup_after_flush(queue, i); + return d3d12_command_queue_fixup_and_lock_after_flush(queue, i); } d3d12_command_queue_wait_locked(queue, fence, op->u.wait.value); d3d12_fence_decref(fence); -- GitLab https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/137
participants (2)
-
Conor McCarthy -
Conor McCarthy (@cmccarthy)