From f517f824167a6d01a65dcbb8662e4a071b5210bb Mon Sep 17 00:00:00 2001 From: ameerj <52414509+ameerj@users.noreply.github.com> Date: Sun, 25 Dec 2022 14:13:07 -0500 Subject: nvdrv: Use std::span for inputs Allows the use of HLERequestContext::ReadBufferSpan --- .../hle/service/nvdrv/devices/nvhost_as_gpu.cpp | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp') 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 b635e6ed1..681bd0867 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp @@ -27,7 +27,7 @@ nvhost_as_gpu::nvhost_as_gpu(Core::System& system_, Module& module_, NvCore::Con nvhost_as_gpu::~nvhost_as_gpu() = default; -NvResult nvhost_as_gpu::Ioctl1(DeviceFD fd, Ioctl command, const std::vector& input, +NvResult nvhost_as_gpu::Ioctl1(DeviceFD fd, Ioctl command, std::span input, std::vector& output) { switch (command.group) { case 'A': @@ -60,13 +60,13 @@ NvResult nvhost_as_gpu::Ioctl1(DeviceFD fd, Ioctl command, const std::vector return NvResult::NotImplemented; } -NvResult nvhost_as_gpu::Ioctl2(DeviceFD fd, Ioctl command, const std::vector& input, - const std::vector& inline_input, std::vector& output) { +NvResult nvhost_as_gpu::Ioctl2(DeviceFD fd, Ioctl command, std::span input, + std::span inline_input, std::vector& output) { UNIMPLEMENTED_MSG("Unimplemented ioctl={:08X}", command.raw); return NvResult::NotImplemented; } -NvResult nvhost_as_gpu::Ioctl3(DeviceFD fd, Ioctl command, const std::vector& input, +NvResult nvhost_as_gpu::Ioctl3(DeviceFD fd, Ioctl command, std::span input, std::vector& output, std::vector& inline_output) { switch (command.group) { case 'A': @@ -87,7 +87,7 @@ NvResult nvhost_as_gpu::Ioctl3(DeviceFD fd, Ioctl command, const std::vector void nvhost_as_gpu::OnOpen(DeviceFD fd) {} void nvhost_as_gpu::OnClose(DeviceFD fd) {} -NvResult nvhost_as_gpu::AllocAsEx(const std::vector& input, std::vector& output) { +NvResult nvhost_as_gpu::AllocAsEx(std::span input, std::vector& output) { IoctlAllocAsEx params{}; std::memcpy(¶ms, input.data(), input.size()); @@ -141,7 +141,7 @@ NvResult nvhost_as_gpu::AllocAsEx(const std::vector& input, std::vector& return NvResult::Success; } -NvResult nvhost_as_gpu::AllocateSpace(const std::vector& input, std::vector& output) { +NvResult nvhost_as_gpu::AllocateSpace(std::span input, std::vector& output) { IoctlAllocSpace params{}; std::memcpy(¶ms, input.data(), input.size()); @@ -220,7 +220,7 @@ void nvhost_as_gpu::FreeMappingLocked(u64 offset) { mapping_map.erase(offset); } -NvResult nvhost_as_gpu::FreeSpace(const std::vector& input, std::vector& output) { +NvResult nvhost_as_gpu::FreeSpace(std::span input, std::vector& output) { IoctlFreeSpace params{}; std::memcpy(¶ms, input.data(), input.size()); @@ -266,7 +266,7 @@ NvResult nvhost_as_gpu::FreeSpace(const std::vector& input, std::vector& return NvResult::Success; } -NvResult nvhost_as_gpu::Remap(const std::vector& input, std::vector& output) { +NvResult nvhost_as_gpu::Remap(std::span input, std::vector& output) { const auto num_entries = input.size() / sizeof(IoctlRemapEntry); LOG_DEBUG(Service_NVDRV, "called, num_entries=0x{:X}", num_entries); @@ -320,7 +320,7 @@ NvResult nvhost_as_gpu::Remap(const std::vector& input, std::vector& out return NvResult::Success; } -NvResult nvhost_as_gpu::MapBufferEx(const std::vector& input, std::vector& output) { +NvResult nvhost_as_gpu::MapBufferEx(std::span input, std::vector& output) { IoctlMapBufferEx params{}; std::memcpy(¶ms, input.data(), input.size()); @@ -424,7 +424,7 @@ NvResult nvhost_as_gpu::MapBufferEx(const std::vector& input, std::vector& input, std::vector& output) { +NvResult nvhost_as_gpu::UnmapBuffer(std::span input, std::vector& output) { IoctlUnmapBuffer params{}; std::memcpy(¶ms, input.data(), input.size()); @@ -463,7 +463,7 @@ NvResult nvhost_as_gpu::UnmapBuffer(const std::vector& input, std::vector& input, std::vector& output) { +NvResult nvhost_as_gpu::BindChannel(std::span input, std::vector& output) { IoctlBindChannel params{}; std::memcpy(¶ms, input.data(), input.size()); LOG_DEBUG(Service_NVDRV, "called, fd={:X}", params.fd); @@ -492,7 +492,7 @@ void nvhost_as_gpu::GetVARegionsImpl(IoctlGetVaRegions& params) { }; } -NvResult nvhost_as_gpu::GetVARegions(const std::vector& input, std::vector& output) { +NvResult nvhost_as_gpu::GetVARegions(std::span input, std::vector& output) { IoctlGetVaRegions params{}; std::memcpy(¶ms, input.data(), input.size()); @@ -511,7 +511,7 @@ NvResult nvhost_as_gpu::GetVARegions(const std::vector& input, std::vector& input, std::vector& output, +NvResult nvhost_as_gpu::GetVARegions(std::span input, std::vector& output, std::vector& inline_output) { IoctlGetVaRegions params{}; std::memcpy(¶ms, input.data(), input.size()); -- cgit v1.2.3