rsx: Implement basic infinite FIFO desync detection

This commit is contained in:
Eladash 2020-03-26 09:05:20 +02:00 committed by Ivan
parent 433a21286a
commit 38c8dd98b4
2 changed files with 28 additions and 0 deletions

View file

@ -2256,6 +2256,23 @@ namespace rsx
void thread::recover_fifo()
{
const u64 current_time = get_system_time();
if (recovered_fifo_cmds_history.size() == 20u)
{
const auto cmd_info = recovered_fifo_cmds_history.front();
// Check timestamp of last tracked cmd
if (current_time - cmd_info.timestamp < 1'500'000u)
{
// Probably hopeless
fmt::throw_exception("Dead FIFO commands queue state has been detected!\nTry increasing \"Driver Wake-Up Delay\" setting in Advanced settings." HERE);
}
// Erase the last command from history, keep the size of the queue the same
recovered_fifo_cmds_history.pop();
}
// Error. Should reset the queue
fifo_ctrl->set_get(restore_point);
fifo_ret_addr = saved_fifo_ret;
@ -2267,6 +2284,8 @@ namespace rsx
execute_nop_draw();
rsx::thread::end();
}
recovered_fifo_cmds_history.push({fifo_ctrl->last_cmd(), current_time});
}
void thread::fifo_wake_delay(u64 div)