From a346767a72d22613e61132ab3da1144802a42ba4 Mon Sep 17 00:00:00 2001 From: Eladash Date: Fri, 13 Aug 2021 21:46:38 +0300 Subject: [PATCH] rsx: Improve rsx::recover_fifo() to take a hint from driver wake-up delay --- rpcs3/Emu/RSX/RSXThread.cpp | 7 ++++--- rpcs3/Emu/RSX/RSXThread.h | 7 ++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/rpcs3/Emu/RSX/RSXThread.cpp b/rpcs3/Emu/RSX/RSXThread.cpp index 65d2844ed5..2097b5703b 100644 --- a/rpcs3/Emu/RSX/RSXThread.cpp +++ b/rpcs3/Emu/RSX/RSXThread.cpp @@ -2545,7 +2545,7 @@ namespace rsx fifo_ctrl->sync_get(); } - void thread::recover_fifo() + void thread::recover_fifo(u32 line, u32 col, const char* file, const char* func) { const u64 current_time = get_system_time(); @@ -2554,10 +2554,11 @@ namespace rsx const auto cmd_info = recovered_fifo_cmds_history.front(); // Check timestamp of last tracked cmd - if (current_time - cmd_info.timestamp < 2'000'000u) + // Shorten the range of forbidden difference if driver wake-up delay is used + if (current_time - cmd_info.timestamp < 2'000'000u - std::min(g_cfg.video.driver_wakeup_delay * 700, 1'400'000)) { // Probably hopeless - fmt::throw_exception("Dead FIFO commands queue state has been detected!\nTry increasing \"Driver Wake-Up Delay\" setting in Advanced settings."); + fmt::throw_exception("Dead FIFO commands queue state has been detected!\nTry increasing \"Driver Wake-Up Delay\" setting in Advanced settings. Called from %s", src_loc{line, col, file, func}); } // Erase the last command from history, keep the size of the queue the same diff --git a/rpcs3/Emu/RSX/RSXThread.h b/rpcs3/Emu/RSX/RSXThread.h index ec4bcf0b54..2d0262f038 100644 --- a/rpcs3/Emu/RSX/RSXThread.h +++ b/rpcs3/Emu/RSX/RSXThread.h @@ -653,7 +653,12 @@ namespace rsx atomic_t is_inited{ false }; bool is_fifo_idle() const; void flush_fifo(); - void recover_fifo(); + + void recover_fifo(u32 line = __builtin_LINE(), + u32 col = __builtin_COLUMN(), + const char* file = __builtin_FILE(), + const char* func = __builtin_FUNCTION()); + static void fifo_wake_delay(u64 div = 1); u32 get_fifo_cmd() const;