From c77b8df12efab9f36f007ff3b309d43588a71260 Mon Sep 17 00:00:00 2001 From: Fernando Sahmkow Date: Fri, 5 Nov 2021 03:10:20 +0100 Subject: NVASGPU: Fix Remap. --- src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') 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 9283d6aec..b1c683511 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp @@ -144,6 +144,14 @@ NvResult nvhost_as_gpu::Remap(const std::vector& input, std::vector& out LOG_DEBUG(Service_NVDRV, "remap entry, offset=0x{:X} handle=0x{:X} pages=0x{:X}", entry.offset, entry.nvmap_handle, entry.pages); + if (entry.nvmap_handle == 0) { + // If nvmap handle is null, we should unmap instead. + const auto offset{static_cast(entry.offset) << 0x10}; + const auto size{static_cast(entry.pages) << 0x10}; + system.GPU().MemoryManager().Unmap(offset, size); + continue; + } + const auto object{nvmap.GetHandle(entry.nvmap_handle)}; if (!object) { LOG_CRITICAL(Service_NVDRV, "invalid nvmap_handle={:X}", entry.nvmap_handle); -- cgit v1.2.3