From c87d5a637b2367c6f54a4b022b732ce625c1a411 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 7 Jul 2019 13:10:28 -0700 Subject: [PATCH] GPU: Forget pause signal on new list. Otherwise, when the list gets executed again, we just pause it when it finishes instead of letting it finish properly. --- GPU/GPUCommon.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/GPU/GPUCommon.cpp b/GPU/GPUCommon.cpp index 1af5afd5c2b5..649a37f4d1b6 100644 --- a/GPU/GPUCommon.cpp +++ b/GPU/GPUCommon.cpp @@ -720,6 +720,8 @@ u32 GPUCommon::EnqueueList(u32 listpc, u32 stall, int subIntrBase, PSPPointerstate != PSP_GE_DL_STATE_PAUSED) return SCE_KERNEL_ERROR_INVALID_VALUE; currentList->state = PSP_GE_DL_STATE_QUEUED; + // Make sure we clear the signal so we don't try to pause it again. + currentList->signal = PSP_GE_SIGNAL_NONE; } dl.state = PSP_GE_DL_STATE_PAUSED; @@ -786,8 +788,7 @@ u32 GPUCommon::Continue() { if (currentList->state == PSP_GE_DL_STATE_PAUSED) { - if (!isbreak) - { + if (!isbreak) { // TODO: Supposedly this returns SCE_KERNEL_ERROR_BUSY in some case, previously it had // currentList->signal == PSP_GE_SIGNAL_HANDLER_PAUSE, but it doesn't reproduce. @@ -799,9 +800,10 @@ u32 GPUCommon::Continue() { // We have a list now, so it's not complete. drawCompleteTicks = (u64)-1; - } - else + } else { currentList->state = PSP_GE_DL_STATE_QUEUED; + currentList->signal = PSP_GE_SIGNAL_NONE; + } } else if (currentList->state == PSP_GE_DL_STATE_RUNNING) { @@ -2446,6 +2448,14 @@ void GPUCommon::InterruptEnd(int listid) { } dl.waitTicks = 0; __GeTriggerWait(GPU_SYNC_LIST, listid); + + // Make sure the list isn't still queued since it's now completed. + if (!dlQueue.empty()) { + if (listid == dlQueue.front()) + PopDLQueue(); + else + dlQueue.remove(listid); + } } ProcessDLQueue();