Skip to content

Commit

Permalink
Implement MEM_SEMAPHORE as a global pipeline barrier
Browse files Browse the repository at this point in the history
  • Loading branch information
mikusp committed Dec 17, 2024
1 parent 2c1aa0f commit 715d73b
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions src/video_core/amdgpu/liverpool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,15 +293,15 @@ Liverpool::Task Liverpool::ProcessGraphics(std::span<const u32> dcb, std::span<c
const auto* mem_semaphore = reinterpret_cast<const PM4CmdMemSemaphore*>(header);
const auto addr = mem_semaphore->Address<VAddr>();
const auto select = mem_semaphore->semSel;
const auto client = mem_semaphore->clientCode;
const auto signal_type = mem_semaphore->signalType;
LOG_WARNING(Lib_GnmDriver, "MemSemaphore ignored: addr {:#X}, select {}, client {}, signal {}, wait {}, mailbox {}",
using enum PM4CmdMemSemaphore::MemSemaphoreSelect;
using enum PM4CmdMemSemaphore::MemSemaphoreSignalType;
LOG_DEBUG(Lib_GnmDriver,
"MemSemaphore GFX addr = {:#X}: {}, {}",
addr,
select.Value() == PM4CmdMemSemaphore::MemSemaphoreSelect::SignalSemaphore ? "signal" : "wait",
client.Value() == PM4CmdMemSemaphore::MemSemaphoreClientCode::CP ? "CP" : std::to_string(std::to_underlying(client.Value())),
std::to_underlying(signal_type.Value()) == 1 ? "increment/decrement" : "set 1/do nothing",
mem_semaphore->waitOnSignal.Value(),
std::to_underlying(mem_semaphore->useMailbox.Value())
select.Value() == SignalSemaphore ? "signal" : "wait",
signal_type.Value() == SignalIncrementOrDecrement
? "increment/decrement" : "set 1/do nothing"
);
if (rasterizer) {
rasterizer->GlobalBarrier();
Expand Down Expand Up @@ -868,15 +868,14 @@ Liverpool::Task Liverpool::ProcessCompute(std::span<const u32> acb, u32 vqid) {
const auto* mem_semaphore = reinterpret_cast<const PM4CmdMemSemaphore*>(header);
const auto addr = mem_semaphore->Address<VAddr>();
const auto select = mem_semaphore->semSel;
const auto client = mem_semaphore->clientCode;
const auto signal_type = mem_semaphore->signalType;
LOG_WARNING(Lib_GnmDriver, "MemSemaphore ignored: addr {:#X}, select {}, client {}, signal {}, wait {}, mailbox {}",
using enum PM4CmdMemSemaphore::MemSemaphoreSelect;
using enum PM4CmdMemSemaphore::MemSemaphoreSignalType;
LOG_DEBUG(Lib_GnmDriver, "MemSemaphore CE addr = {:#X}: {}, {}",
addr,
select.Value() == PM4CmdMemSemaphore::MemSemaphoreSelect::SignalSemaphore ? "signal" : "wait",
client.Value() == PM4CmdMemSemaphore::MemSemaphoreClientCode::CP ? "CP" : std::to_string(std::to_underlying(client.Value())),
std::to_underlying(signal_type.Value()) == 1 ? "increment/decrement" : "set 1/do nothing",
mem_semaphore->waitOnSignal.Value(),
std::to_underlying(mem_semaphore->useMailbox.Value())
select.Value() == SignalSemaphore ? "signal" : "wait",
signal_type.Value() == SignalIncrementOrDecrement
? "increment/decrement" : "set 1/do nothing"
);
if (rasterizer) {
rasterizer->GlobalBarrier();
Expand Down

0 comments on commit 715d73b

Please sign in to comment.