A paused list will allow a context save.

Just not stall, drawing, etc.
This commit is contained in:
Unknown W. Brackets 2013-09-21 19:31:54 -07:00
parent db1f2f2535
commit 881cefbc83
4 changed files with 15 additions and 2 deletions

View File

@ -498,7 +498,7 @@ u32 sceGeSaveContext(u32 ctxAddr)
DEBUG_LOG(SCEGE, "sceGeSaveContext(%08x)", ctxAddr);
gpu->SyncThread();
if (gpu->DrawSync(1) != PSP_GE_LIST_COMPLETED)
if (gpu->BusyDrawing())
{
WARN_LOG(SCEGE, "sceGeSaveContext(%08x): lists in process, aborting", ctxAddr);
// Real error code.
@ -521,7 +521,7 @@ u32 sceGeRestoreContext(u32 ctxAddr)
DEBUG_LOG(SCEGE, "sceGeRestoreContext(%08x)", ctxAddr);
gpu->SyncThread();
if (gpu->DrawSync(1) != PSP_GE_LIST_COMPLETED)
if (gpu->BusyDrawing())
{
WARN_LOG(SCEGE, "sceGeRestoreContext(%08x): lists in process, aborting", ctxAddr);
return SCE_KERNEL_ERROR_BUSY;

View File

@ -48,6 +48,17 @@ void GPUCommon::PopDLQueue() {
}
}
bool GPUCommon::BusyDrawing() {
u32 state = DrawSync(1);
if (state == PSP_GE_LIST_DRAWING || state == PSP_GE_LIST_STALLING) {
lock_guard guard(listLock);
if (currentList && currentList->state != PSP_GE_DL_STATE_PAUSED) {
return true;
}
}
return false;
}
u32 GPUCommon::DrawSync(int mode) {
// FIXME: Workaround for displaylists sometimes hanging unprocessed. Not yet sure of the cause.
if (g_Config.bSeparateCPUThread) {

View File

@ -44,6 +44,7 @@ public:
SyncThread();
return true;
}
virtual bool BusyDrawing();
virtual u32 Continue();
virtual u32 Break(int mode);
virtual void ReapplyGfxState();

View File

@ -237,6 +237,7 @@ public:
virtual void Resized() = 0;
virtual bool FramebufferDirty() = 0;
virtual bool FramebufferReallyDirty() = 0;
virtual bool BusyDrawing() = 0;
// Debugging
virtual void DumpNextFrame() = 0;