From 97e3a3ea6fda441b2b342f795aa0afd9de2d8e14 Mon Sep 17 00:00:00 2001 From: Rodolfo Osvaldo Bogado Date: Sat, 4 Dec 2010 03:44:56 +0000 Subject: [PATCH] remove fifowait flag, is not needed now as we execute all events that need to be executed even if the cpu is waiting for the fifo. this way fifo will not avid other thread events to bi executed. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6514 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/CoreTiming.cpp | 17 ++++++----------- Source/Core/Core/Src/CoreTiming.h | 2 +- .../Core/VideoCommon/Src/CommandProcessor.cpp | 2 +- Source/Core/VideoCommon/Src/PixelEngine.cpp | 4 ++-- Source/PluginSpecs/pluginspecs_video.h | 2 +- .../Src/CommandProcessor.cpp | 2 +- .../Plugin_VideoSoftware/Src/PixelEngine.cpp | 4 ++-- 7 files changed, 14 insertions(+), 19 deletions(-) diff --git a/Source/Core/Core/Src/CoreTiming.cpp b/Source/Core/Core/Src/CoreTiming.cpp index 35311f8154..3207112cbf 100644 --- a/Source/Core/Core/Src/CoreTiming.cpp +++ b/Source/Core/Core/Src/CoreTiming.cpp @@ -42,7 +42,6 @@ struct BaseEvent s64 time; u64 userdata; int type; - bool fifoWait; // Event *next; }; @@ -177,8 +176,7 @@ void DoState(PointerWrap &p) prev->next = ev; p.Do(ev->time); p.Do(ev->type); - p.Do(ev->userdata); - p.Do(ev->fifoWait); + p.Do(ev->userdata); ev->next = 0; prev = ev; ev = ev->next; @@ -195,8 +193,7 @@ void DoState(PointerWrap &p) p.Do(more_events); p.Do(ev->time); p.Do(ev->type); - p.Do(ev->userdata); - p.Do(ev->fifoWait); + p.Do(ev->userdata); ev = ev->next; } more_events = 0; @@ -219,7 +216,7 @@ u64 GetIdleTicks() // This is to be called when outside threads, such as the graphics thread, wants to // schedule things to be executed on the main thread. -void ScheduleEvent_Threadsafe(int cyclesIntoFuture, int event_type, u64 userdata, bool fifoWait) +void ScheduleEvent_Threadsafe(int cyclesIntoFuture, int event_type, u64 userdata) { externalEventSection.Enter(); Event *ne = GetNewTsEvent(); @@ -227,7 +224,6 @@ void ScheduleEvent_Threadsafe(int cyclesIntoFuture, int event_type, u64 userdata ne->type = event_type; ne->next = 0; ne->userdata = userdata; - ne->fifoWait = fifoWait; if(!tsFirst) tsFirst = ne; if(tsLast) @@ -247,7 +243,7 @@ void ScheduleEvent_Threadsafe_Immediate(int event_type, u64 userdata) externalEventSection.Leave(); } else - ScheduleEvent_Threadsafe(0, event_type, userdata, false); + ScheduleEvent_Threadsafe(0, event_type, userdata); } void ClearPendingEvents() @@ -287,7 +283,6 @@ void ScheduleEvent(int cyclesIntoFuture, int event_type, u64 userdata) ne->userdata = userdata; ne->type = event_type; ne->time = globalTimer + cyclesIntoFuture; - ne->fifoWait = false; AddEventToQueue(ne); } @@ -403,7 +398,7 @@ void ProcessFifoWaitEvents() if (!first) return; - if (first->time <= globalTimer && first->fifoWait) + if (first->time <= globalTimer) { Event *next = first->next; event_types[first->type].callback(first->userdata, (int)(globalTimer - first->time)); @@ -418,7 +413,7 @@ void ProcessFifoWaitEvents() Event *ptr = prev->next; while (ptr) { - if (ptr->time <= globalTimer && ptr->fifoWait) + if (ptr->time <= globalTimer) { prev->next = ptr->next; event_types[ptr->type].callback(ptr->userdata, (int)(globalTimer - ptr->time)); diff --git a/Source/Core/Core/Src/CoreTiming.h b/Source/Core/Core/Src/CoreTiming.h index 7514727fc8..818c5a9e5f 100644 --- a/Source/Core/Core/Src/CoreTiming.h +++ b/Source/Core/Core/Src/CoreTiming.h @@ -57,7 +57,7 @@ void UnregisterAllEvents(); // userdata MAY NOT CONTAIN POINTERS. userdata might get written and reloaded from disk, // when we implement state saves. void ScheduleEvent(int cyclesIntoFuture, int event_type, u64 userdata=0); -void ScheduleEvent_Threadsafe(int cyclesIntoFuture, int event_type, u64 userdata=0, bool fifoWait=true); +void ScheduleEvent_Threadsafe(int cyclesIntoFuture, int event_type, u64 userdata=0); void ScheduleEvent_Threadsafe_Immediate(int event_type, u64 userdata=0); // We only permit one event of each type in the queue at a time. diff --git a/Source/Core/VideoCommon/Src/CommandProcessor.cpp b/Source/Core/VideoCommon/Src/CommandProcessor.cpp index 0dc3fc3b0b..8f9b621284 100644 --- a/Source/Core/VideoCommon/Src/CommandProcessor.cpp +++ b/Source/Core/VideoCommon/Src/CommandProcessor.cpp @@ -717,7 +717,7 @@ void UpdateInterrupts() void UpdateInterruptsFromVideoPlugin() { - g_VideoInitialize.pScheduleEvent_Threadsafe(0, et_UpdateInterrupts, 0, true); + g_VideoInitialize.pScheduleEvent_Threadsafe(0, et_UpdateInterrupts, 0); } void SetFifoIdleFromVideoPlugin() diff --git a/Source/Core/VideoCommon/Src/PixelEngine.cpp b/Source/Core/VideoCommon/Src/PixelEngine.cpp index 580571b328..4913e21cfc 100644 --- a/Source/Core/VideoCommon/Src/PixelEngine.cpp +++ b/Source/Core/VideoCommon/Src/PixelEngine.cpp @@ -343,7 +343,7 @@ void SetToken(const u16 _token, const int _bSetTokenAcknowledge) // This seems smelly... CommandProcessor::IncrementGPWDToken(); // for DC watchdog hack since PEToken seems to be a frame-finish too g_VideoInitialize.pScheduleEvent_Threadsafe( - 0, et_SetTokenOnMainThread, _token | (_bSetTokenAcknowledge << 16), true); + 0, et_SetTokenOnMainThread, _token | (_bSetTokenAcknowledge << 16)); } else // set token value { @@ -362,7 +362,7 @@ void SetFinish() { CommandProcessor::IncrementGPWDToken(); // for DC watchdog hack g_VideoInitialize.pScheduleEvent_Threadsafe( - 0, et_SetFinishOnMainThread, 0, true); + 0, et_SetFinishOnMainThread, 0); INFO_LOG(PIXELENGINE, "VIDEO Set Finish"); } diff --git a/Source/PluginSpecs/pluginspecs_video.h b/Source/PluginSpecs/pluginspecs_video.h index 7fde0e43fa..d6e71a5de9 100644 --- a/Source/PluginSpecs/pluginspecs_video.h +++ b/Source/PluginSpecs/pluginspecs_video.h @@ -13,7 +13,7 @@ typedef void (*TimedCallback)(u64 userdata, int cyclesLate); typedef void (*TSetInterrupt)(u32 _causemask, bool _bSet); typedef int (*TRegisterEvent)(const char *name, TimedCallback callback); -typedef void (*TScheduleEvent_Threadsafe)(int cyclesIntoFuture, int event_type, u64 userdata, bool fifoWait); +typedef void (*TScheduleEvent_Threadsafe)(int cyclesIntoFuture, int event_type, u64 userdata); typedef void (*TRemoveEvent)(int event_type); typedef unsigned char* (*TGetMemoryPointer)(const unsigned int _iAddress); typedef void (*TVideoLog)(const char* _pMessage, int _bBreak); diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/CommandProcessor.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/CommandProcessor.cpp index 200d1200e3..6b2d0733b4 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/CommandProcessor.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/CommandProcessor.cpp @@ -322,7 +322,7 @@ void UpdateInterrupts(u64 userdata) void UpdateInterruptsFromVideoPlugin(u64 userdata) { - g_VideoInitialize.pScheduleEvent_Threadsafe(0, et_UpdateInterrupts, userdata, true); + g_VideoInitialize.pScheduleEvent_Threadsafe(0, et_UpdateInterrupts, userdata); } void ReadFifo() diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/PixelEngine.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/PixelEngine.cpp index 255c195d84..119a3b5417 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/PixelEngine.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/PixelEngine.cpp @@ -155,7 +155,7 @@ void SetToken(const u16 _token, const int _bSetTokenAcknowledge) if (_bSetTokenAcknowledge) // set token INT { g_VideoInitialize.pScheduleEvent_Threadsafe( - 0, et_SetTokenOnMainThread, _token | (_bSetTokenAcknowledge << 16), true); + 0, et_SetTokenOnMainThread, _token | (_bSetTokenAcknowledge << 16)); } } @@ -164,7 +164,7 @@ void SetToken(const u16 _token, const int _bSetTokenAcknowledge) void SetFinish() { g_VideoInitialize.pScheduleEvent_Threadsafe( - 0, et_SetFinishOnMainThread, 0, true); + 0, et_SetFinishOnMainThread, 0); INFO_LOG(PIXELENGINE, "VIDEO Set Finish"); }