summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-04-23 17:37:12 +0200
committerGitHub <noreply@github.com>2020-04-23 17:37:12 +0200
commitff0c49e1cee3c1dc21d56f6ca73963da5ceec80c (patch)
treef3108877d77c64d4456b7ad27d500aa1e82da33d /src/video_core
parentMerge pull request #3730 from lioncash/time (diff)
downloadyuzu-ff0c49e1cee3c1dc21d56f6ca73963da5ceec80c.tar
yuzu-ff0c49e1cee3c1dc21d56f6ca73963da5ceec80c.tar.gz
yuzu-ff0c49e1cee3c1dc21d56f6ca73963da5ceec80c.tar.bz2
yuzu-ff0c49e1cee3c1dc21d56f6ca73963da5ceec80c.tar.lz
yuzu-ff0c49e1cee3c1dc21d56f6ca73963da5ceec80c.tar.xz
yuzu-ff0c49e1cee3c1dc21d56f6ca73963da5ceec80c.tar.zst
yuzu-ff0c49e1cee3c1dc21d56f6ca73963da5ceec80c.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/memory_manager.cpp18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/video_core/memory_manager.cpp b/src/video_core/memory_manager.cpp
index fd49bc2a9..dbee9f634 100644
--- a/src/video_core/memory_manager.cpp
+++ b/src/video_core/memory_manager.cpp
@@ -51,11 +51,8 @@ GPUVAddr MemoryManager::MapBufferEx(VAddr cpu_addr, u64 size) {
const GPUVAddr gpu_addr{FindFreeRegion(address_space_base, aligned_size)};
MapBackingMemory(gpu_addr, system.Memory().GetPointer(cpu_addr), aligned_size, cpu_addr);
- ASSERT(system.CurrentProcess()
- ->PageTable()
- .SetMemoryAttribute(cpu_addr, size, Kernel::Memory::MemoryAttribute::DeviceShared,
- Kernel::Memory::MemoryAttribute::DeviceShared)
- .IsSuccess());
+ ASSERT(
+ system.CurrentProcess()->PageTable().LockForDeviceAddressSpace(cpu_addr, size).IsSuccess());
return gpu_addr;
}
@@ -66,11 +63,8 @@ GPUVAddr MemoryManager::MapBufferEx(VAddr cpu_addr, GPUVAddr gpu_addr, u64 size)
const u64 aligned_size{Common::AlignUp(size, page_size)};
MapBackingMemory(gpu_addr, system.Memory().GetPointer(cpu_addr), aligned_size, cpu_addr);
- ASSERT(system.CurrentProcess()
- ->PageTable()
- .SetMemoryAttribute(cpu_addr, size, Kernel::Memory::MemoryAttribute::DeviceShared,
- Kernel::Memory::MemoryAttribute::DeviceShared)
- .IsSuccess());
+ ASSERT(
+ system.CurrentProcess()->PageTable().LockForDeviceAddressSpace(cpu_addr, size).IsSuccess());
return gpu_addr;
}
@@ -87,9 +81,7 @@ GPUVAddr MemoryManager::UnmapBuffer(GPUVAddr gpu_addr, u64 size) {
UnmapRange(gpu_addr, aligned_size);
ASSERT(system.CurrentProcess()
->PageTable()
- .SetMemoryAttribute(cpu_addr.value(), size,
- Kernel::Memory::MemoryAttribute::DeviceShared,
- Kernel::Memory::MemoryAttribute::None)
+ .UnlockForDeviceAddressSpace(cpu_addr.value(), size)
.IsSuccess());
return gpu_addr;