diff options
author | bunnei <bunneidev@gmail.com> | 2021-03-25 01:37:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-25 01:37:01 +0100 |
commit | 65774084fd9209c9d812cdf10c2b82c2ee35f360 (patch) | |
tree | 7490204bc8c2724b0c5e5c0cffd7d5b0b20b1372 /src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp | |
parent | Merge pull request #6108 from jbeich/freebsd-async-shaders (diff) | |
parent | nvdrv: Change InitializeEx to AllocAsEx (diff) | |
download | yuzu-65774084fd9209c9d812cdf10c2b82c2ee35f360.tar yuzu-65774084fd9209c9d812cdf10c2b82c2ee35f360.tar.gz yuzu-65774084fd9209c9d812cdf10c2b82c2ee35f360.tar.bz2 yuzu-65774084fd9209c9d812cdf10c2b82c2ee35f360.tar.lz yuzu-65774084fd9209c9d812cdf10c2b82c2ee35f360.tar.xz yuzu-65774084fd9209c9d812cdf10c2b82c2ee35f360.tar.zst yuzu-65774084fd9209c9d812cdf10c2b82c2ee35f360.zip |
Diffstat (limited to 'src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp')
-rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp | 49 |
1 files changed, 33 insertions, 16 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 6b062e10e..485ac5f50 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<u8>& 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<u8>& input, std: return NvResult::NotImplemented; } -NvResult nvhost_as_gpu::InitalizeEx(const std::vector<u8>& input, std::vector<u8>& output) { - IoctlInitalizeEx params{}; +NvResult nvhost_as_gpu::AllocAsEx(const std::vector<u8>& input, std::vector<u8>& 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<u8>& input, std::vector<u params.buf_size); params.buf_size = 0x30; - params.regions[0].offset = 0x04000000; - params.regions[0].page_size = 0x1000; - params.regions[0].pages = 0x3fbfff; - params.regions[1].offset = 0x04000000; - params.regions[1].page_size = 0x10000; - params.regions[1].pages = 0x1bffff; + params.small = IoctlVaRegion{ + .offset = 0x04000000, + .page_size = DEFAULT_SMALL_PAGE_SIZE, + .pages = 0x3fbfff, + }; + + params.big = IoctlVaRegion{ + .offset = 0x04000000, + .page_size = big_page_size, + .pages = 0x1bffff, + }; // TODO(ogniK): This probably can stay stubbed but should add support way way later @@ -299,18 +309,25 @@ NvResult nvhost_as_gpu::GetVARegions(const std::vector<u8>& input, std::vector<u params.buf_size); params.buf_size = 0x30; - params.regions[0].offset = 0x04000000; - params.regions[0].page_size = 0x1000; - params.regions[0].pages = 0x3fbfff; - params.regions[1].offset = 0x04000000; - params.regions[1].page_size = 0x10000; - params.regions[1].pages = 0x1bffff; + params.small = IoctlVaRegion{ + .offset = 0x04000000, + .page_size = 0x1000, + .pages = 0x3fbfff, + }; + + params.big = IoctlVaRegion{ + .offset = 0x04000000, + .page_size = big_page_size, + .pages = 0x1bffff, + }; // TODO(ogniK): This probably can stay stubbed but should add support way way later std::memcpy(output.data(), ¶ms, output.size()); - std::memcpy(inline_output.data(), ¶ms.regions, inline_output.size()); + std::memcpy(inline_output.data(), ¶ms.small, sizeof(IoctlVaRegion)); + std::memcpy(inline_output.data() + sizeof(IoctlVaRegion), ¶ms.big, sizeof(IoctlVaRegion)); + return NvResult::Success; } |