[PATCH 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. -- 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 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c index e5ead7d3..fe9da285 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; @@ -6800,8 +6801,6 @@ static HRESULT d3d12_command_queue_fixup_after_flush(struct d3d12_command_queue hr = d3d12_command_queue_record_as_blocked(queue); - vkd3d_mutex_unlock(&queue->op_mutex); - return hr; } @@ -6855,7 +6854,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
This merge request was approved by Giovanni Mascellani. -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/137
Giovanni Mascellani (@giomasce) commented about libs/vkd3d/command.c:
hr = d3d12_command_queue_record_as_blocked(queue);
- vkd3d_mutex_unlock(&queue->op_mutex); - return hr;
Completely minor, but then you can ditch `hr` and directly return from `d3d12_command_queue_record_as_blocked()`. -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/137#note_28663
participants (3)
-
Conor McCarthy -
Conor McCarthy (@cmccarthy) -
Giovanni Mascellani (@giomasce)