From ed3281290d8e8b5d721b217b2ffe449d03b56526 Mon Sep 17 00:00:00 2001 From: "memberTwo.mb2" Date: Wed, 14 Jan 2009 11:23:00 +0000 Subject: [PATCH] More green. CPU sleeps when fifo HiWaterMark reached now. Showing more obviously when GPU become the bottleneck. Again, if it hurts perf -> GPU needs improvement where CPU load drop. I need to check some fifo stuff. TODO: test if HiWM are less reached with or without sending the whole fifoReadWriteDistance. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1867 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/HW/CommandProcessor.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/Core/Core/Src/HW/CommandProcessor.cpp b/Source/Core/Core/Src/HW/CommandProcessor.cpp index d3957f24a0..cb030e13ea 100644 --- a/Source/Core/Core/Src/HW/CommandProcessor.cpp +++ b/Source/Core/Core/Src/HW/CommandProcessor.cpp @@ -372,6 +372,8 @@ void Write16(const u16 _Value, const u32 _Address) */ LOG(COMMANDPROCESSOR, "*********************** GXSetGPFifo very soon? ***********************"); u32 ct=0; + // (mb2) We don't sleep here since it could be a perf issue for super monkey ball (yup only this game IIRC) + // Touching that game is a no-go so I don't want to take the risk :p while (fifo.bFF_GPReadEnable && fifo.CPReadWriteDistance > 0 ) ct++; if (ct) {LOG(COMMANDPROCESSOR, "(Write16): %lu cycles for nothing :[ ", ct);} @@ -603,10 +605,9 @@ void STACKALIGN GatherPipeBursted() while (!(fifo.bFF_BPEnable && fifo.bFF_Breakpoint) && fifo.CPReadWriteDistance > fifo.CPLoWatermark) { ct++; - // dunno if others threads (like the audio thread) really need a forced context switch here - //Common::SleepCurrentThread(1); + Common::SleepCurrentThread(1); } - if (ct) {LOG(COMMANDPROCESSOR, "(GatherPipeBursted): %lu cycles for nothing :[", ct);} + if (ct) {LOG(COMMANDPROCESSOR, "(GatherPipeBursted): %lu ms for nothing :[", ct);} /**/ } // check if we are in sync