Introduce per-channel sequence number for invalidation tracking

For cases like shaders, which may be uploaded through I2M (which no longer causes an execution) we need a way to cause an invalidation on all writes
This commit is contained in:
Billy Laws 2022-11-12 13:58:15 +00:00
parent 97e3f7fd34
commit 06095918a9
4 changed files with 10 additions and 1 deletions

View File

@ -13,5 +13,9 @@ namespace skyline::soc::gm20b {
keplerCompute{state, *this},
inline2Memory{state, *this},
gpfifo{state, *this, numEntries},
globalChannelLock{state.gpu->channelLock} {}
globalChannelLock{state.gpu->channelLock} {
executor.AddFlushCallback([this] {
channelSequenceNumber++;
});
}
}

View File

@ -31,6 +31,7 @@ namespace skyline::soc::gm20b {
engine::Inline2Memory inline2Memory;
ChannelGpfifo gpfifo;
std::mutex &globalChannelLock;
size_t channelSequenceNumber{};
ChannelContext(const DeviceState &state, std::shared_ptr<AddressSpaceContext> asCtx, size_t numEntries);

View File

@ -26,6 +26,7 @@ namespace skyline::soc::gm20b::engine {
// Wait forever for another channel to increment
channelCtx.executor.Submit();
channelCtx.Unlock();
syncpoints.at(action.index).Wait(registers.syncpoint->payload, std::chrono::steady_clock::duration::max());
channelCtx.Lock();
@ -44,6 +45,7 @@ namespace skyline::soc::gm20b::engine {
switch (action.operation) {
case Registers::Semaphore::Operation::Acquire:
Logger::Debug("Acquire semaphore: 0x{:X} payload: {}", address, registers.semaphore->payload);
channelCtx.executor.Submit();
channelCtx.Unlock();
while (channelCtx.asCtx->gmmu.Read<u32>(address) != registers.semaphore->payload)
@ -57,6 +59,7 @@ namespace skyline::soc::gm20b::engine {
break;
case Registers::Semaphore::Operation::AcqGeq :
Logger::Debug("Acquire semaphore: 0x{:X} payload: {}", address, registers.semaphore->payload);
channelCtx.executor.Submit();
channelCtx.Unlock();
while (channelCtx.asCtx->gmmu.Read<u32>(address) < registers.semaphore->payload)

View File

@ -21,6 +21,7 @@ namespace skyline::soc::gm20b::engine {
if (state.launchDma.layout == RegisterState::DmaDstMemoryLayout::Pitch && state.lineCount == 1) {
Logger::Debug("range: 0x{:X} -> 0x{:X}", u64{state.offsetOut}, u64{state.offsetOut} + buffer.size() * 0x4);
channelCtx.channelSequenceNumber++;
interconnect.Upload(u64{state.offsetOut}, span{buffer});
} else {
channelCtx.executor.Submit();