From 3a3400be8d7af1e7117df7a6c10527e000a28008 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Wed, 14 Jan 2026 19:53:53 -0400 Subject: [PATCH] Revert "[video_core, macro, scheduler] Following Lizzie's request of change" --- src/video_core/control/scheduler.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/video_core/control/scheduler.cpp b/src/video_core/control/scheduler.cpp index c2267acede..bd3b8b860e 100644 --- a/src/video_core/control/scheduler.cpp +++ b/src/video_core/control/scheduler.cpp @@ -17,12 +17,16 @@ Scheduler::Scheduler(GPU& gpu_) : gpu{gpu_} {} Scheduler::~Scheduler() = default; void Scheduler::Push(s32 channel, CommandList&& entries) { - std::unique_lock lk(scheduling_guard); - auto it = channels.find(channel); - ASSERT(it != channels.end()); - auto& channel_state = it->second; - gpu.BindChannel(channel_state->bind_id); - lk.unlock(); + std::shared_ptr channel_state; + { + std::unique_lock lk(scheduling_guard); + auto it = channels.find(channel); + ASSERT(it != channels.end()); + channel_state = it->second; + gpu.BindChannel(channel_state->bind_id); + } + // Process commands outside the lock to reduce contention. + // Multiple channels can prepare their commands in parallel. channel_state->dma_pusher->Push(std::move(entries)); channel_state->dma_pusher->DispatchCalls(); }