From e6a87428ae71140d04ba36fa77252b0cb3c70db6 Mon Sep 17 00:00:00 2001 From: mailwl Date: Thu, 24 May 2018 09:00:15 +0300 Subject: [PATCH] Stub NVGPU_IOCTL_CHANNEL_SET_TIMEOUT Used in Nintendo Labo ToyCon 1&2 --- src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp | 9 +++++++++ src/core/hle/service/nvdrv/devices/nvhost_gpu.h | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp index 03126aeee..79aab87f9 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp @@ -34,6 +34,8 @@ u32 nvhost_gpu::ioctl(Ioctl command, const std::vector& input, std::vector& input, std::vector& outpu return 0; } +u32 nvhost_gpu::ChannelSetTimeout(const std::vector& input, std::vector& output) { + IoctlChannelSetTimeout params{}; + std::memcpy(¶ms, input.data(), sizeof(IoctlChannelSetTimeout)); + NGLOG_INFO(Service_NVDRV, "called, timeout=0x{:X}", params.timeout); + return 0; +} + } // namespace Service::Nvidia::Devices diff --git a/src/core/hle/service/nvdrv/devices/nvhost_gpu.h b/src/core/hle/service/nvdrv/devices/nvhost_gpu.h index beb1c4970..2ecf818f3 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_gpu.h +++ b/src/core/hle/service/nvdrv/devices/nvhost_gpu.h @@ -34,6 +34,7 @@ private: IocAllocGPFIFOEx2Command = 0xC020481A, IocAllocObjCtxCommand = 0xC0104809, IocChannelGetWaitbaseCommand = 0xC0080003, + IocChannelSetTimeoutCommand = 0x40044803, }; enum class CtxObjects : u32_le { @@ -50,6 +51,11 @@ private: }; static_assert(sizeof(IoctlSetNvmapFD) == 4, "IoctlSetNvmapFD is incorrect size"); + struct IoctlChannelSetTimeout { + u32_le timeout; + }; + static_assert(sizeof(IoctlChannelSetTimeout) == 4, "IoctlChannelSetTimeout is incorrect size"); + struct IoctlClientData { u64_le data; }; @@ -141,6 +147,7 @@ private: u32 AllocateObjectContext(const std::vector& input, std::vector& output); u32 SubmitGPFIFO(const std::vector& input, std::vector& output); u32 GetWaitbase(const std::vector& input, std::vector& output); + u32 ChannelSetTimeout(const std::vector& input, std::vector& output); std::shared_ptr nvmap_dev; };