rsx: PS3 Native frame limiter improvements, add Infinite frame limiter

* Do not wait on DEVICE 0x30 semaphore, it seems like it is something to do with queue command synchronization.
 - This also fixes cellGcmSetFlipWithWaitLabel which is built specifically to enable accurate RSX flipping time, its waiting command is confirmed to be placed **AFTER** DEVICE 0x30 waiting.
* Fix default vsync state to be enabled. (and set it to enabled in cellGcmSetVBlankFrequency as well)
* Add experimental "Infinite" frame limiter mode.
* Fix spurious enabling of second vblank.
This commit is contained in:
Eladash 2022-05-21 19:39:14 +03:00 committed by Megamouse
parent 9cf7a63c77
commit f66256cc13
11 changed files with 88 additions and 57 deletions

View file

@ -37,7 +37,7 @@ namespace rsx
template<bool FlushDMA, bool FlushPipe>
void write_gcm_label(thread* rsx, u32 address, u32 data)
{
const bool is_flip_sema = (address == (rsx->label_addr + 0x10) || address == (rsx->label_addr + 0x30));
const bool is_flip_sema = (address == (rsx->label_addr + 0x10) || address == (rsx->device_addr + 0x30));
if (!is_flip_sema)
{
// First, queue the GPU work. If it flushes the queue for us, the following routines will be faster.
@ -108,18 +108,6 @@ namespace rsx
rsx->flush_fifo();
}
if (addr == rsx->device_addr + 0x30)
{
if (g_cfg.video.frame_limit == frame_limit_type::_ps3 && rsx->requested_vsync)
{
// Enables PS3-compliant vblank behavior
rsx->flip_sema_wait_val = arg;
rsx->wait_for_flip_sema = (sema != arg);
}
return;
}
u64 start = rsx::uclock();
u64 last_check_val = start;
@ -189,6 +177,12 @@ namespace rsx
return;
}
if (addr == rsx->device_addr + 0x30 && !arg)
{
// HW flip synchronization related, 1 is not written without display queue command (TODO: make it behave as real hw)
arg = 1;
}
write_gcm_label<false, true>(rsx, addr, arg);
}
}