diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp | 22 | ||||
| -rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.h | 31 |
2 files changed, 53 insertions, 0 deletions
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp index a9538ff43..0abc0de83 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp | |||
| @@ -26,6 +26,10 @@ u32 nvhost_ctrl_gpu::ioctl(Ioctl command, const std::vector<u8>& input, std::vec | |||
| 26 | return ZCullGetInfo(input, output); | 26 | return ZCullGetInfo(input, output); |
| 27 | case IoctlCommand::IocZbcSetTable: | 27 | case IoctlCommand::IocZbcSetTable: |
| 28 | return ZBCSetTable(input, output); | 28 | return ZBCSetTable(input, output); |
| 29 | case IoctlCommand::IocZbcQueryTable: | ||
| 30 | return ZBCQueryTable(input, output); | ||
| 31 | case IoctlCommand::IocFlushL2: | ||
| 32 | return FlushL2(input, output); | ||
| 29 | } | 33 | } |
| 30 | UNIMPLEMENTED_MSG("Unimplemented ioctl"); | 34 | UNIMPLEMENTED_MSG("Unimplemented ioctl"); |
| 31 | return 0; | 35 | return 0; |
| @@ -136,4 +140,22 @@ u32 nvhost_ctrl_gpu::ZBCSetTable(const std::vector<u8>& input, std::vector<u8>& | |||
| 136 | return 0; | 140 | return 0; |
| 137 | } | 141 | } |
| 138 | 142 | ||
| 143 | u32 nvhost_ctrl_gpu::ZBCQueryTable(const std::vector<u8>& input, std::vector<u8>& output) { | ||
| 144 | NGLOG_WARNING(Service_NVDRV, "(STUBBED) called"); | ||
| 145 | IoctlZbcQueryTable params{}; | ||
| 146 | std::memcpy(¶ms, input.data(), input.size()); | ||
| 147 | // TODO : To implement properly | ||
| 148 | std::memcpy(output.data(), ¶ms, output.size()); | ||
| 149 | return 0; | ||
| 150 | } | ||
| 151 | |||
| 152 | u32 nvhost_ctrl_gpu::FlushL2(const std::vector<u8>& input, std::vector<u8>& output) { | ||
| 153 | NGLOG_WARNING(Service_NVDRV, "(STUBBED) called"); | ||
| 154 | IoctlFlushL2 params{}; | ||
| 155 | std::memcpy(¶ms, input.data(), input.size()); | ||
| 156 | // TODO : To implement properly | ||
| 157 | std::memcpy(output.data(), ¶ms, output.size()); | ||
| 158 | return 0; | ||
| 159 | } | ||
| 160 | |||
| 139 | } // namespace Service::Nvidia::Devices | 161 | } // namespace Service::Nvidia::Devices |
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.h b/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.h index 1d5ba2e67..f09113e67 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.h +++ b/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.h | |||
| @@ -26,6 +26,18 @@ private: | |||
| 26 | IocZcullGetCtxSizeCommand = 0x80044701, | 26 | IocZcullGetCtxSizeCommand = 0x80044701, |
| 27 | IocZcullGetInfo = 0x80284702, | 27 | IocZcullGetInfo = 0x80284702, |
| 28 | IocZbcSetTable = 0x402C4703, | 28 | IocZbcSetTable = 0x402C4703, |
| 29 | IocZbcQueryTable = 0xC0344704, | ||
| 30 | IocFlushL2 = 0x40084707, | ||
| 31 | IocInvalICache = 0x4008470D, | ||
| 32 | IocSetMmudebugMode = 0x4008470E, | ||
| 33 | IocSetSmDebugMode = 0x4010470F, | ||
| 34 | IocWaitForPause = 0xC0084710, | ||
| 35 | IocGetTcpExceptionEnStatus = 0x80084711, | ||
| 36 | IocNumVsms = 0x80084712, | ||
| 37 | IocVsmsMapping = 0xC0044713, | ||
| 38 | IocGetErrorChannelUserData = 0xC008471B, | ||
| 39 | IocGetGpuTime = 0xC010471C, | ||
| 40 | IocGetCpuTimeCorrelationInfo = 0xC108471D, | ||
| 29 | }; | 41 | }; |
| 30 | 42 | ||
| 31 | struct IoctlGpuCharacteristics { | 43 | struct IoctlGpuCharacteristics { |
| @@ -127,12 +139,31 @@ private: | |||
| 127 | }; | 139 | }; |
| 128 | static_assert(sizeof(IoctlZbcSetTable) == 44, "IoctlZbcSetTable is incorrect size"); | 140 | static_assert(sizeof(IoctlZbcSetTable) == 44, "IoctlZbcSetTable is incorrect size"); |
| 129 | 141 | ||
| 142 | struct IoctlZbcQueryTable { | ||
| 143 | u32_le color_ds[4]; | ||
| 144 | u32_le color_l2[4]; | ||
| 145 | u32_le depth; | ||
| 146 | u32_le ref_cnt; | ||
| 147 | u32_le format; | ||
| 148 | u32_le type; | ||
| 149 | u32_le index_size; | ||
| 150 | }; | ||
| 151 | static_assert(sizeof(IoctlZbcQueryTable) == 52, "IoctlZbcQueryTable is incorrect size"); | ||
| 152 | |||
| 153 | struct IoctlFlushL2 { | ||
| 154 | u32_le flush; // l2_flush | l2_invalidate << 1 | fb_flush << 2 | ||
| 155 | u32_le reserved; | ||
| 156 | }; | ||
| 157 | static_assert(sizeof(IoctlFlushL2) == 8, "IoctlFlushL2 is incorrect size"); | ||
| 158 | |||
| 130 | u32 GetCharacteristics(const std::vector<u8>& input, std::vector<u8>& output); | 159 | u32 GetCharacteristics(const std::vector<u8>& input, std::vector<u8>& output); |
| 131 | u32 GetTPCMasks(const std::vector<u8>& input, std::vector<u8>& output); | 160 | u32 GetTPCMasks(const std::vector<u8>& input, std::vector<u8>& output); |
| 132 | u32 GetActiveSlotMask(const std::vector<u8>& input, std::vector<u8>& output); | 161 | u32 GetActiveSlotMask(const std::vector<u8>& input, std::vector<u8>& output); |
| 133 | u32 ZCullGetCtxSize(const std::vector<u8>& input, std::vector<u8>& output); | 162 | u32 ZCullGetCtxSize(const std::vector<u8>& input, std::vector<u8>& output); |
| 134 | u32 ZCullGetInfo(const std::vector<u8>& input, std::vector<u8>& output); | 163 | u32 ZCullGetInfo(const std::vector<u8>& input, std::vector<u8>& output); |
| 135 | u32 ZBCSetTable(const std::vector<u8>& input, std::vector<u8>& output); | 164 | u32 ZBCSetTable(const std::vector<u8>& input, std::vector<u8>& output); |
| 165 | u32 ZBCQueryTable(const std::vector<u8>& input, std::vector<u8>& output); | ||
| 166 | u32 FlushL2(const std::vector<u8>& input, std::vector<u8>& output); | ||
| 136 | }; | 167 | }; |
| 137 | 168 | ||
| 138 | } // namespace Service::Nvidia::Devices | 169 | } // namespace Service::Nvidia::Devices |