Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rsx: more efficient command reading #4825

Merged
merged 1 commit into from
Jun 27, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
38 changes: 21 additions & 17 deletions rpcs3/Emu/RSX/RSXThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -576,30 +576,34 @@ namespace rsx
continue;
}

//Validate put and get registers
//TODO: Who should handle graphics exceptions??
const u32 get_address = RSXIOMem.RealAddr(internal_get);

if (!get_address)
// Validate put and get registers before reading the command
// TODO: Who should handle graphics exceptions??
u32 cmd;
{
LOG_ERROR(RSX, "Invalid FIFO queue get/put registers found, get=0x%X, put=0x%X", internal_get.load(), put);
u32 get_address;

if (mem_faults_count >= 3)
if (!RSXIOMem.getRealAddr(internal_get, get_address))
{
LOG_ERROR(RSX, "Application has failed to recover, resetting FIFO queue");
internal_get = restore_point.load();;
}
else
{
mem_faults_count++;
std::this_thread::sleep_for(10ms);
LOG_ERROR(RSX, "Invalid FIFO queue get/put registers found, get=0x%X, put=0x%X", internal_get.load(), put);

if (mem_faults_count >= 3)
{
LOG_ERROR(RSX, "Application has failed to recover, resetting FIFO queue");
internal_get = restore_point.load();
}
else
{
mem_faults_count++;
std::this_thread::sleep_for(10ms);
}

invalid_command_interrupt_raised = true;
continue;
}

invalid_command_interrupt_raised = true;
continue;
cmd = vm::read32(get_address);
}

const u32 cmd = ReadIO32(internal_get);
const u32 count = (cmd >> 18) & 0x7ff;

if ((cmd & RSX_METHOD_OLD_JUMP_CMD_MASK) == RSX_METHOD_OLD_JUMP_CMD)
Expand Down