|
|
|
@ -15,7 +15,7 @@
|
|
|
|
|
|
|
|
|
|
namespace Service::Nvidia::Devices {
|
|
|
|
|
|
|
|
|
|
nvhost_ctrl::nvhost_ctrl(Core::System& system, EventsInterface& events_interface)
|
|
|
|
|
nvhost_ctrl::nvhost_ctrl(Core::System& system, EventInterface& events_interface)
|
|
|
|
|
: nvdevice(system), events_interface{events_interface} {}
|
|
|
|
|
nvhost_ctrl::~nvhost_ctrl() = default;
|
|
|
|
|
|
|
|
|
@ -67,12 +67,11 @@ u32 nvhost_ctrl::IocCtrlEventWait(const std::vector<u8>& input, std::vector<u8>&
|
|
|
|
|
if (!gpu.IsAsync()) {
|
|
|
|
|
return NvResult::Success;
|
|
|
|
|
}
|
|
|
|
|
gpu.Guard(true);
|
|
|
|
|
auto lock = gpu.LockSync();
|
|
|
|
|
u32 current_syncpoint_value = gpu.GetSyncpointValue(params.syncpt_id);
|
|
|
|
|
if (current_syncpoint_value >= params.threshold) {
|
|
|
|
|
params.value = current_syncpoint_value;
|
|
|
|
|
std::memcpy(output.data(), ¶ms, sizeof(params));
|
|
|
|
|
gpu.Guard(false);
|
|
|
|
|
return NvResult::Success;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -82,7 +81,6 @@ u32 nvhost_ctrl::IocCtrlEventWait(const std::vector<u8>& input, std::vector<u8>&
|
|
|
|
|
|
|
|
|
|
if (params.timeout == 0) {
|
|
|
|
|
std::memcpy(output.data(), ¶ms, sizeof(params));
|
|
|
|
|
gpu.Guard(false);
|
|
|
|
|
return NvResult::Timeout;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -91,7 +89,6 @@ u32 nvhost_ctrl::IocCtrlEventWait(const std::vector<u8>& input, std::vector<u8>&
|
|
|
|
|
event_id = params.value & 0x00FF;
|
|
|
|
|
if (event_id >= 64) {
|
|
|
|
|
std::memcpy(output.data(), ¶ms, sizeof(params));
|
|
|
|
|
gpu.Guard(false);
|
|
|
|
|
return NvResult::BadParameter;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
@ -119,15 +116,12 @@ u32 nvhost_ctrl::IocCtrlEventWait(const std::vector<u8>& input, std::vector<u8>&
|
|
|
|
|
ctrl.must_delay = true;
|
|
|
|
|
ctrl.timeout = params.timeout;
|
|
|
|
|
ctrl.event_id = event_id;
|
|
|
|
|
gpu.Guard(false);
|
|
|
|
|
return NvResult::Timeout;
|
|
|
|
|
}
|
|
|
|
|
std::memcpy(output.data(), ¶ms, sizeof(params));
|
|
|
|
|
gpu.Guard(false);
|
|
|
|
|
return NvResult::Timeout;
|
|
|
|
|
}
|
|
|
|
|
std::memcpy(output.data(), ¶ms, sizeof(params));
|
|
|
|
|
gpu.Guard(false);
|
|
|
|
|
return NvResult::BadParameter;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|