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

SPU: Implement RSX accurate reservations on TSX #8721

Merged
merged 2 commits into from Aug 12, 2020
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
11 changes: 11 additions & 0 deletions rpcs3/Emu/Cell/SPUThread.cpp
Expand Up @@ -1775,6 +1775,10 @@ void spu_thread::do_putlluc(const spu_mfc_cmd& args)
{
const u32 result = spu_putlluc_tx(addr, to_write.data(), this);

const auto render = result != 1 ? get_rsx_if_needs_res_pause(addr) : nullptr;

if (render) render->pause();

if (result == 2)
{
cpu_thread::suspend_all cpu_lock(this);
Expand Down Expand Up @@ -1809,6 +1813,7 @@ void spu_thread::do_putlluc(const spu_mfc_cmd& args)
vm::reservation_acquire(addr, 128) += 64;
}

if (render) render->unpause();
static_cast<void>(test_stopped());
}
else
Expand Down Expand Up @@ -2121,6 +2126,10 @@ bool spu_thread::process_mfc_cmd()
{
case 2:
{
const auto render = get_rsx_if_needs_res_pause(addr);

if (render) render->pause();

cpu_thread::suspend_all cpu_lock(this);

// Give up if PUTLLUC happened
Expand All @@ -2132,11 +2141,13 @@ bool spu_thread::process_mfc_cmd()
{
mov_rdata(data, to_write);
res += 127;
if (render) render->unpause();
return true;
}
}

res -= 1;
if (render) render->unpause();
return false;
}
case 1: return true;
Expand Down