mirror of
https://github.com/skyline-emu/skyline.git
synced 2025-02-06 20:42:16 +03:00
Implement NVGPU_GPU_IOCTL_GET_GPU_TIME in nvdrv
This commit is contained in:
parent
5841799420
commit
4aef24ba32
@ -1,6 +1,7 @@
|
|||||||
// SPDX-License-Identifier: MIT OR MPL-2.0
|
// SPDX-License-Identifier: MIT OR MPL-2.0
|
||||||
// Copyright © 2021 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
// Copyright © 2021 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||||
|
|
||||||
|
#include <common/utils.h>
|
||||||
#include <services/nvdrv/devices/deserialisation/deserialisation.h>
|
#include <services/nvdrv/devices/deserialisation/deserialisation.h>
|
||||||
#include "ctrl_gpu.h"
|
#include "ctrl_gpu.h"
|
||||||
|
|
||||||
@ -55,6 +56,11 @@ namespace skyline::service::nvdrv::device::nvhost {
|
|||||||
return PosixResult::Success;
|
return PosixResult::Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PosixResult CtrlGpu::GetGpuTime(Out<u64> time) {
|
||||||
|
time = static_cast<u64>(util::GetTimeNs());
|
||||||
|
return PosixResult::Success;
|
||||||
|
}
|
||||||
|
|
||||||
std::shared_ptr<type::KEvent> CtrlGpu::QueryEvent(u32 eventId) {
|
std::shared_ptr<type::KEvent> CtrlGpu::QueryEvent(u32 eventId) {
|
||||||
switch (eventId) {
|
switch (eventId) {
|
||||||
case 1:
|
case 1:
|
||||||
@ -82,6 +88,8 @@ namespace skyline::service::nvdrv::device::nvhost {
|
|||||||
GetTpcMasks, ARGS(In<u32>, Pad<u32, 3>, Out<u32>))
|
GetTpcMasks, ARGS(In<u32>, Pad<u32, 3>, Out<u32>))
|
||||||
IOCTL_CASE_ARGS(OUT, SIZE(0x8), MAGIC(CtrlGpuMagic), FUNC(0x14),
|
IOCTL_CASE_ARGS(OUT, SIZE(0x8), MAGIC(CtrlGpuMagic), FUNC(0x14),
|
||||||
GetActiveSlotMask, ARGS(Out<u32>, Out<u32>))
|
GetActiveSlotMask, ARGS(Out<u32>, Out<u32>))
|
||||||
|
IOCTL_CASE_ARGS(INOUT, SIZE(0x10), MAGIC(CtrlGpuMagic), FUNC(0x1C),
|
||||||
|
GetGpuTime, ARGS(Out<u64>, Pad<u64>))
|
||||||
}))
|
}))
|
||||||
|
|
||||||
INLINE_IOCTL_HANDLER_FUNC(Ioctl3, CtrlGpu, ({
|
INLINE_IOCTL_HANDLER_FUNC(Ioctl3, CtrlGpu, ({
|
||||||
|
@ -123,6 +123,11 @@ namespace skyline::service::nvdrv::device::nvhost {
|
|||||||
*/
|
*/
|
||||||
PosixResult GetActiveSlotMask(Out<u32> slot, Out<u32> mask);
|
PosixResult GetActiveSlotMask(Out<u32> slot, Out<u32> mask);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @url https://switchbrew.org/wiki/NV_services#NVGPU_GPU_IOCTL_GET_GPU_TIME
|
||||||
|
*/
|
||||||
|
PosixResult GetGpuTime(Out<u64> time);
|
||||||
|
|
||||||
std::shared_ptr<type::KEvent> QueryEvent(u32 eventId) override;
|
std::shared_ptr<type::KEvent> QueryEvent(u32 eventId) override;
|
||||||
|
|
||||||
PosixResult Ioctl(IoctlDescriptor cmd, span<u8> buffer) override;
|
PosixResult Ioctl(IoctlDescriptor cmd, span<u8> buffer) override;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user