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
1 changed files with 16 additions and 17 deletions

View File

@ -121,6 +121,8 @@ namespace rsx
}
u64 start = rsx::uclock();
u64 last_check_val = start;
while (sema != arg)
{
if (rsx->test_stopped())
@ -130,26 +132,23 @@ namespace rsx
if (const auto tdr = static_cast<u64>(g_cfg.video.driver_recovery_timeout))
{
if (rsx->is_paused())
const u64 current = rsx::uclock();
if (current - last_check_val > 20'000)
{
const u64 start0 = rsx::uclock();
while (rsx->is_paused())
{
rsx->check_state();
}
// Reset
start += rsx::uclock() - start0;
// 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;
}
else
last_check_val = current;
if ((current - start) > tdr)
{
if ((rsx::uclock() - start) > tdr)
{
// If longer than driver timeout force exit
rsx_log.error("nv406e::semaphore_acquire has timed out. semaphore_address=0x%X", addr);
break;
}
// If longer than driver timeout force exit
rsx_log.error("nv406e::semaphore_acquire has timed out. semaphore_address=0x%X", addr);
break;
}
}