diff options
author | bunnei <bunneidev@gmail.com> | 2019-03-22 23:41:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-22 23:41:12 +0100 |
commit | e5893db3e618fd276733a24eebc0606c5fd1e7f2 (patch) | |
tree | 5a3ae98bb04d3fb3f513a51504b63940e70c5130 /src/core/hle/service/nvdrv | |
parent | Merge pull request #2277 from bunnei/fix-smo-transitions (diff) | |
parent | memory_manager: Cleanup FindFreeRegion. (diff) | |
download | yuzu-e5893db3e618fd276733a24eebc0606c5fd1e7f2.tar yuzu-e5893db3e618fd276733a24eebc0606c5fd1e7f2.tar.gz yuzu-e5893db3e618fd276733a24eebc0606c5fd1e7f2.tar.bz2 yuzu-e5893db3e618fd276733a24eebc0606c5fd1e7f2.tar.lz yuzu-e5893db3e618fd276733a24eebc0606c5fd1e7f2.tar.xz yuzu-e5893db3e618fd276733a24eebc0606c5fd1e7f2.tar.zst yuzu-e5893db3e618fd276733a24eebc0606c5fd1e7f2.zip |
Diffstat (limited to 'src/core/hle/service/nvdrv')
-rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp index b031ebc66..af62d33d2 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp @@ -89,7 +89,7 @@ u32 nvhost_as_gpu::Remap(const std::vector<u8>& input, std::vector<u8>& output) for (const auto& entry : entries) { LOG_WARNING(Service_NVDRV, "remap entry, offset=0x{:X} handle=0x{:X} pages=0x{:X}", entry.offset, entry.nvmap_handle, entry.pages); - Tegra::GPUVAddr offset = static_cast<Tegra::GPUVAddr>(entry.offset) << 0x10; + GPUVAddr offset = static_cast<GPUVAddr>(entry.offset) << 0x10; auto object = nvmap_dev->GetObject(entry.nvmap_handle); if (!object) { LOG_CRITICAL(Service_NVDRV, "nvmap {} is an invalid handle!", entry.nvmap_handle); @@ -102,7 +102,7 @@ u32 nvhost_as_gpu::Remap(const std::vector<u8>& input, std::vector<u8>& output) u64 size = static_cast<u64>(entry.pages) << 0x10; ASSERT(size <= object->size); - Tegra::GPUVAddr returned = gpu.MemoryManager().MapBufferEx(object->addr, offset, size); + GPUVAddr returned = gpu.MemoryManager().MapBufferEx(object->addr, offset, size); ASSERT(returned == offset); } std::memcpy(output.data(), entries.data(), output.size()); @@ -173,16 +173,8 @@ u32 nvhost_as_gpu::UnmapBuffer(const std::vector<u8>& input, std::vector<u8>& ou return 0; } - auto& system_instance = Core::System::GetInstance(); - - // Remove this memory region from the rasterizer cache. - auto& gpu = system_instance.GPU(); - auto cpu_addr = gpu.MemoryManager().GpuToCpuAddress(params.offset); - ASSERT(cpu_addr); - gpu.FlushAndInvalidateRegion(ToCacheAddr(Memory::GetPointer(*cpu_addr)), itr->second.size); - - params.offset = gpu.MemoryManager().UnmapBuffer(params.offset, itr->second.size); - + params.offset = Core::System::GetInstance().GPU().MemoryManager().UnmapBuffer(params.offset, + itr->second.size); buffer_mappings.erase(itr->second.offset); std::memcpy(output.data(), ¶ms, output.size()); |