mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-06 23:11:25 +12:00
rsx: Implement basic infinite FIFO desync detection
This commit is contained in:
parent
433a21286a
commit
38c8dd98b4
2 changed files with 28 additions and 0 deletions
|
@ -2256,6 +2256,23 @@ namespace rsx
|
||||||
|
|
||||||
void thread::recover_fifo()
|
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
|
// Error. Should reset the queue
|
||||||
fifo_ctrl->set_get(restore_point);
|
fifo_ctrl->set_get(restore_point);
|
||||||
fifo_ret_addr = saved_fifo_ret;
|
fifo_ret_addr = saved_fifo_ret;
|
||||||
|
@ -2267,6 +2284,8 @@ namespace rsx
|
||||||
execute_nop_draw();
|
execute_nop_draw();
|
||||||
rsx::thread::end();
|
rsx::thread::end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
recovered_fifo_cmds_history.push({fifo_ctrl->last_cmd(), current_time});
|
||||||
}
|
}
|
||||||
|
|
||||||
void thread::fifo_wake_delay(u64 div)
|
void thread::fifo_wake_delay(u64 div)
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <queue>
|
||||||
#include <deque>
|
#include <deque>
|
||||||
#include <variant>
|
#include <variant>
|
||||||
#include <stack>
|
#include <stack>
|
||||||
|
@ -726,6 +727,14 @@ namespace rsx
|
||||||
bool sync_point_request = false;
|
bool sync_point_request = false;
|
||||||
bool in_begin_end = 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 };
|
atomic_t<s32> async_tasks_pending{ 0 };
|
||||||
|
|
||||||
bool zcull_stats_enabled = false;
|
bool zcull_stats_enabled = false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue