From 77311a121d8850fb8667c242d6a9758b8d4a061d Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 6 Apr 2013 08:19:54 -0700 Subject: [PATCH] Don't listsync until after the signal handler. --- Core/HLE/sceGe.cpp | 6 +++--- GPU/GPUCommon.cpp | 21 ++++++++++++++------- GPU/GPUCommon.h | 4 ++-- GPU/GPUInterface.h | 4 ++-- native | 2 +- 5 files changed, 22 insertions(+), 15 deletions(-) diff --git a/Core/HLE/sceGe.cpp b/Core/HLE/sceGe.cpp index 02bc6ce16..3234cdbdd 100644 --- a/Core/HLE/sceGe.cpp +++ b/Core/HLE/sceGe.cpp @@ -54,7 +54,7 @@ public: return false; } - gpu->InterruptStart(); + gpu->InterruptStart(intrdata.listid); u32 cmd = Memory::ReadUnchecked_U32(intrdata.pc - 4) >> 24; int subintr = dl->subIntrBase | (cmd == GE_CMD_FINISH ? PSP_GE_SUBINTR_FINISH : PSP_GE_SUBINTR_SIGNAL); @@ -74,7 +74,7 @@ public: } ge_pending_cb.pop_front(); - gpu->InterruptEnd(); + gpu->InterruptEnd(intrdata.listid); WARN_LOG(HLE, "Ignoring interrupt for display list %d, already been released.", intrdata.listid); return false; @@ -109,7 +109,7 @@ public: dl->signal = PSP_GE_SIGNAL_NONE; - gpu->InterruptEnd(); + gpu->InterruptEnd(intrdata.listid); } }; diff --git a/GPU/GPUCommon.cpp b/GPU/GPUCommon.cpp index 13556c7ca..e0aa05187 100644 --- a/GPU/GPUCommon.cpp +++ b/GPU/GPUCommon.cpp @@ -441,9 +441,6 @@ bool GPUCommon::ProcessDLQueue() } else { - l.shouldWait = false; - __KernelTriggerWait(WAITTYPE_GELISTSYNC, *iter, 0, "GeListSync"); - //At the end, we can remove it from the queue and continue dlQueue.erase(iter); //this invalidated the iterator, let's fix it @@ -589,8 +586,10 @@ void GPUCommon::ExecuteOp(u32 op, u32 diff) { currentList->state = PSP_GE_DL_STATE_COMPLETED; gpuState = GPUSTATE_DONE; currentList->subIntrToken = prev & 0xFFFF; - if (interruptsEnabled_) - __GeTriggerInterrupt(currentList->id, currentList->pc); + if (!interruptsEnabled_ || !__GeTriggerInterrupt(currentList->id, currentList->pc)) { + currentList->shouldWait = false; + __KernelTriggerWait(WAITTYPE_GELISTSYNC, currentList->id, 0, "GeListSync", true); + } break; default: DEBUG_LOG(G3D,"Ah, not finished: %06x", prev & 0xFFFFFF); @@ -626,13 +625,21 @@ void GPUCommon::DoState(PointerWrap &p) { p.DoMarker("GPUCommon"); } -void GPUCommon::InterruptStart() +void GPUCommon::InterruptStart(int listid) { interruptRunning = true; } -void GPUCommon::InterruptEnd() +void GPUCommon::InterruptEnd(int listid) { interruptRunning = false; isbreak = false; + + DisplayList &dl = dls[listid]; + // TODO: Unless the signal handler could change it? + if (dl.state == PSP_GE_DL_STATE_COMPLETED) { + dl.shouldWait = false; + __KernelTriggerWait(WAITTYPE_GELISTSYNC, listid, 0, "GeListSync", true); + } + ProcessDLQueue(); } diff --git a/GPU/GPUCommon.h b/GPU/GPUCommon.h index 6cc325c68..b392cff5b 100644 --- a/GPU/GPUCommon.h +++ b/GPU/GPUCommon.h @@ -8,8 +8,8 @@ public: GPUCommon(); virtual ~GPUCommon() {} - virtual void InterruptStart(); - virtual void InterruptEnd(); + virtual void InterruptStart(int listid); + virtual void InterruptEnd(int listid); virtual void EnableInterrupts(bool enable) { interruptsEnabled_ = enable; } diff --git a/GPU/GPUInterface.h b/GPU/GPUInterface.h index 1c7dd8a58..265d05145 100644 --- a/GPU/GPUInterface.h +++ b/GPU/GPUInterface.h @@ -145,8 +145,8 @@ public: virtual u32 Continue() = 0; virtual u32 Break(int mode) = 0; - virtual void InterruptStart() = 0; - virtual void InterruptEnd() = 0; + virtual void InterruptStart(int listid) = 0; + virtual void InterruptEnd(int listid) = 0; virtual void PreExecuteOp(u32 op, u32 diff) = 0; virtual void ExecuteOp(u32 op, u32 diff) = 0; diff --git a/native b/native index 7ebbe2090..8e06b06d7 160000 --- a/native +++ b/native @@ -1 +1 @@ -Subproject commit 7ebbe209043808982b227a4971f3d26a1d5cd419 +Subproject commit 8e06b06d7efb3299d8c6139651d99616273d6aa7