Stub NVGPU_GPU_IOCTL_ZBC_SET_TABLE nvdrv ioctl

This was missed in the original implementation and caused crashes in some games.
This commit is contained in:
Billy Laws 2022-06-01 16:59:14 +01:00
parent c639fdcf06
commit c4bd9c47e4
2 changed files with 14 additions and 0 deletions

View File

@ -20,6 +20,10 @@ namespace skyline::service::nvdrv::device::nvhost {
return PosixResult::Success;
}
PosixResult CtrlGpu::ZbcSetTable(In<ZbcColorValue> colorDs, In<ZbcColorValue> colorL2, In<u32> depth, In<u32> format, In<u32> type) {
return PosixResult::Success;
}
PosixResult CtrlGpu::GetCharacteristics(InOut<u64> size, In<u64> userAddress, Out<GpuCharacteristics> characteristics) {
characteristics = {};
size = sizeof(GpuCharacteristics);
@ -70,6 +74,8 @@ namespace skyline::service::nvdrv::device::nvhost {
ZCullGetCtxSize, ARGS(Out<u32>))
IOCTL_CASE_ARGS(OUT, SIZE(0x28), MAGIC(CtrlGpuMagic), FUNC(0x2),
ZCullGetInfo, ARGS(Out<ZCullInfo>))
IOCTL_CASE_ARGS(IN, SIZE(0x2C), MAGIC(CtrlGpuMagic), FUNC(0x3),
ZbcSetTable, ARGS(In<ZbcColorValue>, In<ZbcColorValue>, In<u32>, In<u32>, In<u32>))
IOCTL_CASE_ARGS(INOUT, SIZE(0xB0), MAGIC(CtrlGpuMagic), FUNC(0x5),
GetCharacteristics, ARGS(InOut<u64>, In<u64>, Out<GpuCharacteristics>))
IOCTL_CASE_ARGS(INOUT, SIZE(0x18), MAGIC(CtrlGpuMagic), FUNC(0x6),

View File

@ -73,6 +73,8 @@ namespace skyline::service::nvdrv::device::nvhost {
u32 subregionCount{0x10};
};
using ZbcColorValue = std::array<u32, 4>;
CtrlGpu(const DeviceState &state, Driver &driver, Core &core, const SessionContext &ctx);
/**
@ -87,6 +89,12 @@ namespace skyline::service::nvdrv::device::nvhost {
*/
PosixResult ZCullGetInfo(Out<ZCullInfo> info);
/**
* @brief Sets the zero bandwidth clear parameters
* @url https://switchbrew.org/wiki/NV_services#NVGPU_GPU_IOCTL_ZBC_SET_TABLE
*/
PosixResult ZbcSetTable(In<ZbcColorValue> colorDs, In<ZbcColorValue> colorL2, In<u32> depth, In<u32> format, In<u32> type);
/**
* @brief Returns a struct with certain GPU characteristics
* @url https://switchbrew.org/wiki/NV_services#NVGPU_GPU_IOCTL_GET_CHARACTERISTICS