rsx: Implement basic infinite FIFO desync detection
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user