From 875183e7c5da01960af629d4d52529296242a9a2 Mon Sep 17 00:00:00 2001 From: Chloe Marcec Date: Mon, 22 Mar 2021 19:59:30 +1100 Subject: [PATCH] nvdrv: Change InitializeEx to AllocAsEx Wee also report the correct "big page size" now in GetVARegions & fix up the struct for IoctlAllocAsEx --- .../service/nvdrv/devices/nvhost_as_gpu.cpp | 49 +++++++++++++------ .../hle/service/nvdrv/devices/nvhost_as_gpu.h | 27 +++++----- 2 files changed, 49 insertions(+), 27 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 6b062e10e3..485ac5f507 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp @@ -39,7 +39,7 @@ NvResult nvhost_as_gpu::Ioctl1(Ioctl command, const std::vector& input, case 0x8: return GetVARegions(input, output); case 0x9: - return InitalizeEx(input, output); + return AllocAsEx(input, output); case 0x14: return Remap(input, output); default: @@ -78,11 +78,16 @@ NvResult nvhost_as_gpu::Ioctl3(Ioctl command, const std::vector& input, std: return NvResult::NotImplemented; } -NvResult nvhost_as_gpu::InitalizeEx(const std::vector& input, std::vector& output) { - IoctlInitalizeEx params{}; +NvResult nvhost_as_gpu::AllocAsEx(const std::vector& input, std::vector& output) { + IoctlAllocAsEx params{}; std::memcpy(¶ms, input.data(), input.size()); LOG_WARNING(Service_NVDRV, "(STUBBED) called, big_page_size=0x{:X}", params.big_page_size); + if (params.big_page_size == 0) { + params.big_page_size = DEFAULT_BIG_PAGE_SIZE; + } + + big_page_size = params.big_page_size; return NvResult::Success; } @@ -276,13 +281,18 @@ NvResult nvhost_as_gpu::GetVARegions(const std::vector& input, std::vector& input, std::vector& input, std::vector& output); + NvResult AllocAsEx(const std::vector& input, std::vector& output); NvResult AllocateSpace(const std::vector& input, std::vector& output); NvResult Remap(const std::vector& input, std::vector& output); NvResult MapBufferEx(const std::vector& input, std::vector& output);