rsx: Fix NV406E semaphore_acquire timeout detection (#12205)

This commit is contained in:
Elad Ashkenazi 2022-06-12 12:34:29 +03:00 committed by GitHub
parent 9554adda28
commit 280aa6da91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -121,6 +121,8 @@ namespace rsx
} }
u64 start = rsx::uclock(); u64 start = rsx::uclock();
u64 last_check_val = start;
while (sema != arg) while (sema != arg)
{ {
if (rsx->test_stopped()) if (rsx->test_stopped())
@ -130,28 +132,25 @@ namespace rsx
if (const auto tdr = static_cast<u64>(g_cfg.video.driver_recovery_timeout)) if (const auto tdr = static_cast<u64>(g_cfg.video.driver_recovery_timeout))
{ {
if (rsx->is_paused()) const u64 current = rsx::uclock();
{
const u64 start0 = rsx::uclock();
while (rsx->is_paused()) if (current - last_check_val > 20'000)
{ {
rsx->check_state(); // Suspicious amnount of time has passed
// External pause such as debuggers' pause or operating system sleep may have taken place
// Ignore it
start += current - last_check_val;
} }
// Reset last_check_val = current;
start += rsx::uclock() - start0;
} if ((current - start) > tdr)
else
{
if ((rsx::uclock() - start) > tdr)
{ {
// If longer than driver timeout force exit // If longer than driver timeout force exit
rsx_log.error("nv406e::semaphore_acquire has timed out. semaphore_address=0x%X", addr); rsx_log.error("nv406e::semaphore_acquire has timed out. semaphore_address=0x%X", addr);
break; break;
} }
} }
}
rsx->cpu_wait({}); rsx->cpu_wait({});
} }