Skip to content

Commit

Permalink
gpu: add 8 gfx indirect rings
Browse files Browse the repository at this point in the history
  • Loading branch information
DHrpcs3 committed Oct 22, 2024
1 parent 2432a5c commit 6a2507c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
25 changes: 24 additions & 1 deletion rpcsx/gpu/Pipe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ bool ComputePipe::processRing(Ring &ring) {
ring.rptr = ring.base + *ring.rptrReportLocation;
}

auto origRptr = ring.rptr;

while (ring.rptr != ring.wptr) {
if (ring.rptr >= ring.base + ring.size) {
ring.rptr = ring.base;
Expand Down Expand Up @@ -167,7 +169,7 @@ bool ComputePipe::processRing(Ring &ring) {
rx::die("unexpected pm4 packet type %u", type);
}

if (ring.rptrReportLocation != nullptr) {
if (origRptr != ring.rptr && ring.rptrReportLocation != nullptr) {
*ring.rptrReportLocation = ring.rptr - ring.base;
}

Expand Down Expand Up @@ -619,10 +621,31 @@ bool GraphicsPipe::processAllRings() {

if (ring.rptr != ring.wptr) {
allProcessed = false;

for (auto &delayedRing : delayedRings) {
if (delayedRing.rptr != delayedRing.wptr) {
continue;
}

delayedRing = ring;
ring.rptr = ring.wptr;
break;
}

break;
}
}

if (allProcessed) {
for (auto &ring : delayedRings) {
if (ring.rptr == ring.wptr) {
continue;
}

processRing(ring);
}
}

return allProcessed;
}

Expand Down
2 changes: 2 additions & 0 deletions rpcsx/gpu/Pipe.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ struct GraphicsPipe {
Registers::Context context;
Registers::UConfig uConfig;

Ring delayedRings[8];

Ring deQueues[3];
Ring ceQueue;

Expand Down
2 changes: 1 addition & 1 deletion rpcsx/iodev/gc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ static orbis::ErrorCode gc_ioctl(orbis::File *file, std::uint64_t request,

case 0xc0048116: { // submit done?
if (auto gpu = amdgpu::DeviceCtl{orbis::g_context.gpuDevice}) {
gpu.waitForIdle();
// gpu.waitForIdle();
} else {
return orbis::ErrorCode::BUSY;
}
Expand Down

0 comments on commit 6a2507c

Please sign in to comment.