From fc4d692c503ca11a9339f0464520caf88d8474de Mon Sep 17 00:00:00 2001 From: Chloe Marcec Date: Tue, 10 Nov 2020 15:56:41 +1100 Subject: Addressed issues --- src/core/hle/service/nvdrv/devices/nvdevice.h | 25 ++++++++++++++++++++++ .../hle/service/nvdrv/devices/nvhost_as_gpu.cpp | 7 ++++++ .../service/nvdrv/devices/nvhost_nvdec_common.h | 25 ++++++++++++++++++++++ .../hle/service/nvdrv/devices/nvhost_nvjpg.cpp | 3 ++- src/core/hle/service/nvdrv/devices/nvhost_vic.cpp | 7 ++++++ src/core/hle/service/nvdrv/devices/nvmap.cpp | 5 +++++ 6 files changed, 71 insertions(+), 1 deletion(-) (limited to 'src/core/hle/service/nvdrv/devices') diff --git a/src/core/hle/service/nvdrv/devices/nvdevice.h b/src/core/hle/service/nvdrv/devices/nvdevice.h index b86805d26..5681599ba 100644 --- a/src/core/hle/service/nvdrv/devices/nvdevice.h +++ b/src/core/hle/service/nvdrv/devices/nvdevice.h @@ -24,10 +24,35 @@ public: explicit nvdevice(Core::System& system) : system{system} {} virtual ~nvdevice() = default; + /** + * Handles an ioctl1 request. + * @param command The ioctl command id. + * @param input A buffer containing the input data for the ioctl. + * @param output A buffer where the output data will be written to. + * @returns The result code of the ioctl. + */ virtual NvResult Ioctl1(Ioctl command, const std::vector& input, std::vector& output) = 0; + + /** + * Handles an ioctl2 request. + * @param command The ioctl command id. + * @param input A buffer containing the input data for the ioctl. + * @param inline_input A buffer containing the input data for the ioctl which has been inlined. + * @param output A buffer where the output data will be written to. + * @returns The result code of the ioctl. + */ virtual NvResult Ioctl2(Ioctl command, const std::vector& input, const std::vector& inline_input, std::vector& output) = 0; + + /** + * Handles an ioctl3 request. + * @param command The ioctl command id. + * @param input A buffer containing the input data for the ioctl. + * @param output A buffer where the output data will be written to. + * @param inline_output A buffer where the inlined output data will be written to. + * @returns The result code of the ioctl. + */ virtual NvResult Ioctl3(Ioctl command, const std::vector& input, std::vector& output, std::vector& inline_output) = 0; 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 725cb7b55..6b062e10e 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp @@ -42,6 +42,8 @@ NvResult nvhost_as_gpu::Ioctl1(Ioctl command, const std::vector& input, return InitalizeEx(input, output); case 0x14: return Remap(input, output); + default: + break; } break; default: @@ -65,7 +67,12 @@ NvResult nvhost_as_gpu::Ioctl3(Ioctl command, const std::vector& input, std: switch (command.cmd) { case 0x8: return GetVARegions(input, output, inline_output); + default: + break; } + break; + default: + break; } UNIMPLEMENTED_MSG("Unimplemented ioctl={:08X}", command.raw); return NvResult::NotImplemented; diff --git a/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.h b/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.h index e07d4d280..86ba3a4d1 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.h +++ b/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.h @@ -18,10 +18,35 @@ public: explicit nvhost_nvdec_common(Core::System& system, std::shared_ptr nvmap_dev); ~nvhost_nvdec_common() override; + /** + * Handles an ioctl1 request. + * @param command The ioctl command id. + * @param input A buffer containing the input data for the ioctl. + * @param output A buffer where the output data will be written to. + * @returns The result code of the ioctl. + */ virtual NvResult Ioctl1(Ioctl command, const std::vector& input, std::vector& output) = 0; + + /** + * Handles an ioctl2 request. + * @param command The ioctl command id. + * @param input A buffer containing the input data for the ioctl. + * @param inline_input A buffer containing the input data for the ioctl which has been inlined. + * @param output A buffer where the output data will be written to. + * @returns The result code of the ioctl. + */ virtual NvResult Ioctl2(Ioctl command, const std::vector& input, const std::vector& inline_input, std::vector& output) = 0; + + /** + * Handles an ioctl3 request. + * @param command The ioctl command id. + * @param input A buffer containing the input data for the ioctl. + * @param output A buffer where the output data will be written to. + * @param inline_output A buffer where the inlined output data will be written to. + * @returns The result code of the ioctl. + */ virtual NvResult Ioctl3(Ioctl command, const std::vector& input, std::vector& output, std::vector& inline_output) = 0; diff --git a/src/core/hle/service/nvdrv/devices/nvhost_nvjpg.cpp b/src/core/hle/service/nvdrv/devices/nvhost_nvjpg.cpp index 5bd2958cd..2d06955c0 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_nvjpg.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_nvjpg.cpp @@ -15,7 +15,6 @@ nvhost_nvjpg::~nvhost_nvjpg() = default; NvResult nvhost_nvjpg::Ioctl1(Ioctl command, const std::vector& input, std::vector& output) { - switch (command.group) { case 'H': switch (command.cmd) { @@ -25,6 +24,8 @@ NvResult nvhost_nvjpg::Ioctl1(Ioctl command, const std::vector& input, break; } break; + default: + break; } UNIMPLEMENTED_MSG("Unimplemented ioctl={:08X}", command.raw); diff --git a/src/core/hle/service/nvdrv/devices/nvhost_vic.cpp b/src/core/hle/service/nvdrv/devices/nvhost_vic.cpp index 347638490..805fe86ae 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_vic.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_vic.cpp @@ -29,13 +29,20 @@ NvResult nvhost_vic::Ioctl1(Ioctl command, const std::vector& input, std::ve return MapBuffer(input, output); case 0xa: return UnmapBuffer(input, output); + default: + break; } + break; case 'H': switch (command.cmd) { case 0x1: return SetNVMAPfd(input); + default: + break; } break; + default: + break; } UNIMPLEMENTED_MSG("Unimplemented ioctl={:08X}", command.raw); diff --git a/src/core/hle/service/nvdrv/devices/nvmap.cpp b/src/core/hle/service/nvdrv/devices/nvmap.cpp index c3d324788..4015a2740 100644 --- a/src/core/hle/service/nvdrv/devices/nvmap.cpp +++ b/src/core/hle/service/nvdrv/devices/nvmap.cpp @@ -35,7 +35,12 @@ NvResult nvmap::Ioctl1(Ioctl command, const std::vector& input, std::vector< return IocParam(input, output); case 0xe: return IocGetId(input, output); + default: + break; } + break; + default: + break; } UNIMPLEMENTED_MSG("Unimplemented ioctl={:08X}", command.raw); -- cgit v1.2.3