From b01698775b468a04e4d0a9bdd86035ff00e6decb Mon Sep 17 00:00:00 2001 From: liamwhite Date: Thu, 2 Feb 2023 15:53:28 -0500 Subject: Revert "hle_ipc: Use std::span to avoid heap allocations/copies when calling ReadBuffer" --- .../hle/service/nvdrv/devices/nvhost_nvdec_common.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.cpp') diff --git a/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.cpp b/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.cpp index 7bcef105b..99eede702 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.cpp @@ -23,7 +23,7 @@ namespace { // Copies count amount of type T from the input vector into the dst vector. // Returns the number of bytes written into dst. template -std::size_t SliceVectors(std::span input, std::vector& dst, std::size_t count, +std::size_t SliceVectors(const std::vector& input, std::vector& dst, std::size_t count, std::size_t offset) { if (dst.empty()) { return 0; @@ -63,7 +63,7 @@ nvhost_nvdec_common::~nvhost_nvdec_common() { core.Host1xDeviceFile().syncpts_accumulated.push_back(channel_syncpoint); } -NvResult nvhost_nvdec_common::SetNVMAPfd(std::span input) { +NvResult nvhost_nvdec_common::SetNVMAPfd(const std::vector& input) { IoctlSetNvmapFD params{}; std::memcpy(¶ms, input.data(), sizeof(IoctlSetNvmapFD)); LOG_DEBUG(Service_NVDRV, "called, fd={}", params.nvmap_fd); @@ -72,7 +72,7 @@ NvResult nvhost_nvdec_common::SetNVMAPfd(std::span input) { return NvResult::Success; } -NvResult nvhost_nvdec_common::Submit(DeviceFD fd, std::span input, +NvResult nvhost_nvdec_common::Submit(DeviceFD fd, const std::vector& input, std::vector& output) { IoctlSubmit params{}; std::memcpy(¶ms, input.data(), sizeof(IoctlSubmit)); @@ -121,7 +121,7 @@ NvResult nvhost_nvdec_common::Submit(DeviceFD fd, std::span input, return NvResult::Success; } -NvResult nvhost_nvdec_common::GetSyncpoint(std::span input, std::vector& output) { +NvResult nvhost_nvdec_common::GetSyncpoint(const std::vector& input, std::vector& output) { IoctlGetSyncpoint params{}; std::memcpy(¶ms, input.data(), sizeof(IoctlGetSyncpoint)); LOG_DEBUG(Service_NVDRV, "called GetSyncpoint, id={}", params.param); @@ -133,7 +133,7 @@ NvResult nvhost_nvdec_common::GetSyncpoint(std::span input, std::vecto return NvResult::Success; } -NvResult nvhost_nvdec_common::GetWaitbase(std::span input, std::vector& output) { +NvResult nvhost_nvdec_common::GetWaitbase(const std::vector& input, std::vector& output) { IoctlGetWaitbase params{}; LOG_CRITICAL(Service_NVDRV, "called WAITBASE"); std::memcpy(¶ms, input.data(), sizeof(IoctlGetWaitbase)); @@ -142,7 +142,7 @@ NvResult nvhost_nvdec_common::GetWaitbase(std::span input, std::vector return NvResult::Success; } -NvResult nvhost_nvdec_common::MapBuffer(std::span input, std::vector& output) { +NvResult nvhost_nvdec_common::MapBuffer(const std::vector& input, std::vector& output) { IoctlMapBuffer params{}; std::memcpy(¶ms, input.data(), sizeof(IoctlMapBuffer)); std::vector cmd_buffer_handles(params.num_entries); @@ -159,7 +159,7 @@ NvResult nvhost_nvdec_common::MapBuffer(std::span input, std::vector input, std::vector& output) { +NvResult nvhost_nvdec_common::UnmapBuffer(const std::vector& input, std::vector& output) { IoctlMapBuffer params{}; std::memcpy(¶ms, input.data(), sizeof(IoctlMapBuffer)); std::vector cmd_buffer_handles(params.num_entries); @@ -173,7 +173,8 @@ NvResult nvhost_nvdec_common::UnmapBuffer(std::span input, std::vector return NvResult::Success; } -NvResult nvhost_nvdec_common::SetSubmitTimeout(std::span input, std::vector& output) { +NvResult nvhost_nvdec_common::SetSubmitTimeout(const std::vector& input, + std::vector& output) { std::memcpy(&submit_timeout, input.data(), input.size()); LOG_WARNING(Service_NVDRV, "(STUBBED) called"); return NvResult::Success; -- cgit v1.2.3