mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-30 12:32:43 +00:00
rsx: Implement basic infinite FIFO desync detection
This commit is contained in:
parent
433a21286a
commit
38c8dd98b4
@ -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)
|
||||
|
@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <queue>
|
||||
#include <deque>
|
||||
#include <variant>
|
||||
#include <stack>
|
||||
@ -726,6 +727,14 @@ namespace rsx
|
||||
bool sync_point_request = false;
|
||||
bool in_begin_end = false;
|
||||
|
||||
struct desync_fifo_cmd_info
|
||||
{
|
||||
u32 cmd;
|
||||
u64 timestamp;
|
||||
};
|
||||
|
||||
std::queue<desync_fifo_cmd_info> recovered_fifo_cmds_history;
|
||||
|
||||
atomic_t<s32> async_tasks_pending{ 0 };
|
||||
|
||||
bool zcull_stats_enabled = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user