mirror of
https://github.com/Takiiiiiiii/strato.git
synced 2025-07-17 08:46:39 +00:00
Transition memory handling from memfd to anonymous shared mappings
Memfd mappings are incompatible with KGSL user memory importing on older kernels, transition to shared anon mappings to avoid this.
This commit is contained in:
@ -387,7 +387,7 @@ namespace skyline::gpu {
|
||||
SynchronizeHost(true); // Will transition the Buffer to Clean
|
||||
|
||||
dirtyState = DirtyState::GpuDirty;
|
||||
gpu.state.nce->PageOutRegions(*trapHandle); // All data can be paged out from the guest as the guest mirror won't be used
|
||||
gpu.state.process->memory.FreeMemory(mirror); // All data can be paged out from the guest as the guest mirror won't be used
|
||||
|
||||
BlockAllCpuBackingWrites();
|
||||
AdvanceSequence(); // The GPU will modify buffer contents so advance to the next sequence
|
||||
|
@ -728,7 +728,7 @@ namespace skyline::gpu {
|
||||
// If a texture is Clean then we can just transition it to being GPU dirty and retrap it
|
||||
dirtyState = DirtyState::GpuDirty;
|
||||
gpu.state.nce->TrapRegions(*trapHandle, false);
|
||||
gpu.state.nce->PageOutRegions(*trapHandle);
|
||||
gpu.state.process->memory.FreeMemory(mirror);
|
||||
return;
|
||||
} else if (dirtyState != DirtyState::CpuDirty) {
|
||||
return; // If the texture has not been modified on the CPU, there is no need to synchronize it
|
||||
@ -756,7 +756,7 @@ namespace skyline::gpu {
|
||||
std::scoped_lock lock{stateMutex};
|
||||
|
||||
if (dirtyState != DirtyState::CpuDirty && gpuDirty)
|
||||
gpu.state.nce->PageOutRegions(*trapHandle); // All data can be paged out from the guest as the guest mirror won't be used
|
||||
gpu.state.process->memory.FreeMemory(mirror); // All data can be paged out from the guest as the guest mirror won't be used
|
||||
}
|
||||
}
|
||||
|
||||
@ -771,7 +771,7 @@ namespace skyline::gpu {
|
||||
if (gpuDirty && dirtyState == DirtyState::Clean) {
|
||||
dirtyState = DirtyState::GpuDirty;
|
||||
gpu.state.nce->TrapRegions(*trapHandle, false);
|
||||
gpu.state.nce->PageOutRegions(*trapHandle);
|
||||
gpu.state.process->memory.FreeMemory(mirror);
|
||||
return;
|
||||
} else if (dirtyState != DirtyState::CpuDirty) {
|
||||
return;
|
||||
@ -793,7 +793,7 @@ namespace skyline::gpu {
|
||||
std::scoped_lock lock{stateMutex};
|
||||
|
||||
if (dirtyState != DirtyState::CpuDirty && gpuDirty)
|
||||
gpu.state.nce->PageOutRegions(*trapHandle); // All data can be paged out from the guest as the guest mirror won't be used
|
||||
gpu.state.process->memory.FreeMemory(mirror); // All data can be paged out from the guest as the guest mirror won't be used
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user