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 --- src/core/hle/service/nvdrv/nvdrv_interface.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/core/hle/service/nvdrv/nvdrv_interface.cpp') diff --git a/src/core/hle/service/nvdrv/nvdrv_interface.cpp b/src/core/hle/service/nvdrv/nvdrv_interface.cpp index edbdfee43..39a4443a0 100644 --- a/src/core/hle/service/nvdrv/nvdrv_interface.cpp +++ b/src/core/hle/service/nvdrv/nvdrv_interface.cpp @@ -27,7 +27,7 @@ void NVDRV::Open(Kernel::HLERequestContext& ctx) { return; } - const auto& buffer = ctx.ReadBuffer(); + const auto& buffer = ctx.ReadBufferSpan(); const std::string device_name(buffer.begin(), buffer.end()); if (device_name == "/dev/nvhost-prof-gpu") { @@ -64,7 +64,7 @@ void NVDRV::Ioctl1(Kernel::HLERequestContext& ctx) { // Check device std::vector output_buffer(ctx.GetWriteBufferSize(0)); - const auto input_buffer = ctx.ReadBuffer(0); + const auto input_buffer = ctx.ReadBufferSpan(0); const auto nv_result = nvdrv->Ioctl1(fd, command, input_buffer, output_buffer); if (command.is_out != 0) { @@ -88,8 +88,8 @@ void NVDRV::Ioctl2(Kernel::HLERequestContext& ctx) { return; } - const auto input_buffer = ctx.ReadBuffer(0); - const auto input_inlined_buffer = ctx.ReadBuffer(1); + const auto input_buffer = ctx.ReadBufferSpan(0); + const auto input_inlined_buffer = ctx.ReadBufferSpan(1); std::vector output_buffer(ctx.GetWriteBufferSize(0)); const auto nv_result = @@ -115,7 +115,7 @@ void NVDRV::Ioctl3(Kernel::HLERequestContext& ctx) { return; } - const auto input_buffer = ctx.ReadBuffer(0); + const auto input_buffer = ctx.ReadBufferSpan(0); std::vector output_buffer(ctx.GetWriteBufferSize(0)); std::vector output_buffer_inline(ctx.GetWriteBufferSize(1)); -- cgit v1.2.3