|
|
|
@ -5,6 +5,8 @@
|
|
|
|
|
#include <cstring>
|
|
|
|
|
#include "common/assert.h"
|
|
|
|
|
#include "common/logging/log.h"
|
|
|
|
|
#include "core/core_timing.h"
|
|
|
|
|
#include "core/core_timing_util.h"
|
|
|
|
|
#include "core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.h"
|
|
|
|
|
|
|
|
|
|
namespace Service::Nvidia::Devices {
|
|
|
|
@ -33,6 +35,8 @@ u32 nvhost_ctrl_gpu::ioctl(Ioctl command, const std::vector<u8>& input, std::vec
|
|
|
|
|
return ZBCQueryTable(input, output);
|
|
|
|
|
case IoctlCommand::IocFlushL2:
|
|
|
|
|
return FlushL2(input, output);
|
|
|
|
|
case IoctlCommand::IocGetGpuTime:
|
|
|
|
|
return GetGpuTime(input, output);
|
|
|
|
|
}
|
|
|
|
|
UNIMPLEMENTED_MSG("Unimplemented ioctl");
|
|
|
|
|
return 0;
|
|
|
|
@ -169,4 +173,13 @@ u32 nvhost_ctrl_gpu::FlushL2(const std::vector<u8>& input, std::vector<u8>& outp
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
u32 nvhost_ctrl_gpu::GetGpuTime(const std::vector<u8>& input, std::vector<u8>& output) {
|
|
|
|
|
LOG_DEBUG(Service_NVDRV, "called");
|
|
|
|
|
IoctlGetGpuTime params{};
|
|
|
|
|
std::memcpy(¶ms, input.data(), input.size());
|
|
|
|
|
params.gpu_time = CoreTiming::cyclesToNs(CoreTiming::GetTicks());
|
|
|
|
|
std::memcpy(output.data(), ¶ms, output.size());
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace Service::Nvidia::Devices
|
|
|
|
|