diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-07-04 15:55:50 +0200 |
---|---|---|
committer | FernandoS27 <fsahmkow27@gmail.com> | 2019-07-05 21:49:34 +0200 |
commit | 8c91d5c16614ac42efee7c1858cb338d65861154 (patch) | |
tree | e383ef077df218f84a3aa686fabbac52d46a0a8c /src/core | |
parent | NVServices: Address Feedback (diff) | |
download | yuzu-8c91d5c16614ac42efee7c1858cb338d65861154.tar yuzu-8c91d5c16614ac42efee7c1858cb338d65861154.tar.gz yuzu-8c91d5c16614ac42efee7c1858cb338d65861154.tar.bz2 yuzu-8c91d5c16614ac42efee7c1858cb338d65861154.tar.lz yuzu-8c91d5c16614ac42efee7c1858cb338d65861154.tar.xz yuzu-8c91d5c16614ac42efee7c1858cb338d65861154.tar.zst yuzu-8c91d5c16614ac42efee7c1858cb338d65861154.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp b/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp index 1f178d17d..9a66a5f88 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp @@ -68,12 +68,14 @@ u32 nvhost_ctrl::IocCtrlEventWait(const std::vector<u8>& input, std::vector<u8>& return NvResult::Success; } auto lock = gpu.LockSync(); - u32 current_syncpoint_value = gpu.GetSyncpointValue(params.syncpt_id); - if (current_syncpoint_value >= params.threshold) { + const u32 current_syncpoint_value = gpu.GetSyncpointValue(params.syncpt_id); + const s32 diff = current_syncpoint_value - params.threshold; + if (diff >= 0) { params.value = current_syncpoint_value; std::memcpy(output.data(), ¶ms, sizeof(params)); return NvResult::Success; } + const u32 target_value = current_syncpoint_value - diff; if (!is_async) { params.value = 0; @@ -109,7 +111,7 @@ u32 nvhost_ctrl::IocCtrlEventWait(const std::vector<u8>& input, std::vector<u8>& if (event_id < MaxNvEvents || status == EventState::Free || status == EventState::Registered) { events_interface.SetEventStatus(event_id, EventState::Waiting); events_interface.assigned_syncpt[event_id] = params.syncpt_id; - events_interface.assigned_value[event_id] = params.threshold; + events_interface.assigned_value[event_id] = target_value; if (is_async) { params.value = params.syncpt_id << 4; } else { @@ -117,7 +119,7 @@ u32 nvhost_ctrl::IocCtrlEventWait(const std::vector<u8>& input, std::vector<u8>& } params.value |= event_id; events_interface.events[event_id].writable->Clear(); - gpu.RegisterSyncptInterrupt(params.syncpt_id, params.threshold); + gpu.RegisterSyncptInterrupt(params.syncpt_id, target_value); if (!is_async && ctrl.fresh_call) { ctrl.must_delay = true; ctrl.timeout = params.timeout; @@ -167,7 +169,7 @@ u32 nvhost_ctrl::IocCtrlEventSignal(const std::vector<u8>& input, std::vector<u8 // TODO(Blinkhawk): This is normally called when an NvEvents timeout on WaitSynchronization // It is believed from RE to cancel the GPU Event. However, better research is required u32 event_id = params.user_event_id & 0x00FF; - LOG_DEBUG(Service_NVDRV, " called, user_event_id: {:X}", event_id); + LOG_WARNING(Service_NVDRV, "(STUBBED) called, user_event_id: {:X}", event_id); if (event_id >= MaxNvEvents) { return NvResult::BadParameter; } |