diff options
| -rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp | 12 | ||||
| -rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_gpu.h | 8 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp index 6d8bca8bb..f1966ac0e 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp | |||
| @@ -44,6 +44,8 @@ u32 nvhost_gpu::ioctl(Ioctl command, const std::vector<u8>& input, const std::ve | |||
| 44 | return GetWaitbase(input, output); | 44 | return GetWaitbase(input, output); |
| 45 | case IoctlCommand::IocChannelSetTimeoutCommand: | 45 | case IoctlCommand::IocChannelSetTimeoutCommand: |
| 46 | return ChannelSetTimeout(input, output); | 46 | return ChannelSetTimeout(input, output); |
| 47 | case IoctlCommand::IocChannelSetTimeslice: | ||
| 48 | return ChannelSetTimeslice(input, output); | ||
| 47 | default: | 49 | default: |
| 48 | break; | 50 | break; |
| 49 | } | 51 | } |
| @@ -228,4 +230,14 @@ u32 nvhost_gpu::ChannelSetTimeout(const std::vector<u8>& input, std::vector<u8>& | |||
| 228 | return 0; | 230 | return 0; |
| 229 | } | 231 | } |
| 230 | 232 | ||
| 233 | u32 nvhost_gpu::ChannelSetTimeslice(const std::vector<u8>& input, std::vector<u8>& output) { | ||
| 234 | IoctlSetTimeslice params{}; | ||
| 235 | std::memcpy(¶ms, input.data(), sizeof(IoctlSetTimeslice)); | ||
| 236 | LOG_INFO(Service_NVDRV, "called, timeslice=0x{:X}", params.timeslice); | ||
| 237 | |||
| 238 | channel_timeslice = params.timeslice; | ||
| 239 | |||
| 240 | return 0; | ||
| 241 | } | ||
| 242 | |||
| 231 | } // namespace Service::Nvidia::Devices | 243 | } // 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 d056dd046..2ac74743f 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_gpu.h +++ b/src/core/hle/service/nvdrv/devices/nvhost_gpu.h | |||
| @@ -48,6 +48,7 @@ private: | |||
| 48 | IocAllocObjCtxCommand = 0xC0104809, | 48 | IocAllocObjCtxCommand = 0xC0104809, |
| 49 | IocChannelGetWaitbaseCommand = 0xC0080003, | 49 | IocChannelGetWaitbaseCommand = 0xC0080003, |
| 50 | IocChannelSetTimeoutCommand = 0x40044803, | 50 | IocChannelSetTimeoutCommand = 0x40044803, |
| 51 | IocChannelSetTimeslice = 0xC004481D, | ||
| 51 | }; | 52 | }; |
| 52 | 53 | ||
| 53 | enum class CtxObjects : u32_le { | 54 | enum class CtxObjects : u32_le { |
| @@ -101,6 +102,11 @@ private: | |||
| 101 | static_assert(sizeof(IoctlChannelSetPriority) == 4, | 102 | static_assert(sizeof(IoctlChannelSetPriority) == 4, |
| 102 | "IoctlChannelSetPriority is incorrect size"); | 103 | "IoctlChannelSetPriority is incorrect size"); |
| 103 | 104 | ||
| 105 | struct IoctlSetTimeslice { | ||
| 106 | u32_le timeslice; | ||
| 107 | }; | ||
| 108 | static_assert(sizeof(IoctlSetTimeslice) == 4, "IoctlSetTimeslice is incorrect size"); | ||
| 109 | |||
| 104 | struct IoctlEventIdControl { | 110 | struct IoctlEventIdControl { |
| 105 | u32_le cmd; // 0=disable, 1=enable, 2=clear | 111 | u32_le cmd; // 0=disable, 1=enable, 2=clear |
| 106 | u32_le id; | 112 | u32_le id; |
| @@ -174,6 +180,7 @@ private: | |||
| 174 | u64_le user_data{}; | 180 | u64_le user_data{}; |
| 175 | IoctlZCullBind zcull_params{}; | 181 | IoctlZCullBind zcull_params{}; |
| 176 | u32_le channel_priority{}; | 182 | u32_le channel_priority{}; |
| 183 | u32_le channel_timeslice{}; | ||
| 177 | 184 | ||
| 178 | u32 SetNVMAPfd(const std::vector<u8>& input, std::vector<u8>& output); | 185 | u32 SetNVMAPfd(const std::vector<u8>& input, std::vector<u8>& output); |
| 179 | u32 SetClientData(const std::vector<u8>& input, std::vector<u8>& output); | 186 | u32 SetClientData(const std::vector<u8>& input, std::vector<u8>& output); |
| @@ -188,6 +195,7 @@ private: | |||
| 188 | const std::vector<u8>& input2, IoctlVersion version); | 195 | const std::vector<u8>& input2, IoctlVersion version); |
| 189 | u32 GetWaitbase(const std::vector<u8>& input, std::vector<u8>& output); | 196 | u32 GetWaitbase(const std::vector<u8>& input, std::vector<u8>& output); |
| 190 | u32 ChannelSetTimeout(const std::vector<u8>& input, std::vector<u8>& output); | 197 | u32 ChannelSetTimeout(const std::vector<u8>& input, std::vector<u8>& output); |
| 198 | u32 ChannelSetTimeslice(const std::vector<u8>& input, std::vector<u8>& output); | ||
| 191 | 199 | ||
| 192 | std::shared_ptr<nvmap> nvmap_dev; | 200 | std::shared_ptr<nvmap> nvmap_dev; |
| 193 | u32 assigned_syncpoints{}; | 201 | u32 assigned_syncpoints{}; |