diff options
| author | 2019-06-17 15:27:42 -0400 | |
|---|---|---|
| committer | 2019-07-05 15:49:29 -0400 | |
| commit | 0335a25d1fcca5328ef79b3c62edb679df63ffba (patch) | |
| tree | 0eec4de7bba608839dfad8ee0501caa1d21cc009 /src | |
| parent | NVServices: Correct CtrlEventWaitSync to block the ipc until timeout. (diff) | |
| download | yuzu-0335a25d1fcca5328ef79b3c62edb679df63ffba.tar.gz yuzu-0335a25d1fcca5328ef79b3c62edb679df63ffba.tar.xz yuzu-0335a25d1fcca5328ef79b3c62edb679df63ffba.zip | |
NVServices: Make NVEvents Automatic according to documentation.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp | 7 | ||||
| -rw-r--r-- | src/core/hle/service/nvdrv/nvdrv.cpp | 4 | ||||
| -rw-r--r-- | src/video_core/gpu.cpp | 7 | ||||
| -rw-r--r-- | src/video_core/gpu.h | 2 |
4 files changed, 13 insertions, 7 deletions
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp b/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp index e46e6b94c..ffa6e75c7 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp | |||
| @@ -142,7 +142,6 @@ u32 nvhost_ctrl::IocCtrlEventRegister(const std::vector<u8>& input, std::vector< | |||
| 142 | return NvResult::BadParameter; | 142 | return NvResult::BadParameter; |
| 143 | } | 143 | } |
| 144 | events_interface.RegisterEvent(event_id); | 144 | events_interface.RegisterEvent(event_id); |
| 145 | events_interface.events[event_id].writable->Signal(); | ||
| 146 | return NvResult::Success; | 145 | return NvResult::Success; |
| 147 | } | 146 | } |
| 148 | 147 | ||
| @@ -171,7 +170,11 @@ u32 nvhost_ctrl::IocCtrlEventSignal(const std::vector<u8>& input, std::vector<u8 | |||
| 171 | return NvResult::BadParameter; | 170 | return NvResult::BadParameter; |
| 172 | } | 171 | } |
| 173 | if (events_interface.status[event_id] == EventState::Waiting) { | 172 | if (events_interface.status[event_id] == EventState::Waiting) { |
| 174 | events_interface.LiberateEvent(event_id); | 173 | auto& gpu = system.GPU(); |
| 174 | if (gpu.CancelSyncptInterrupt(events_interface.assigned_syncpt[event_id], | ||
| 175 | events_interface.assigned_value[event_id])) { | ||
| 176 | events_interface.LiberateEvent(event_id); | ||
| 177 | } | ||
| 175 | } | 178 | } |
| 176 | return NvResult::Success; | 179 | return NvResult::Success; |
| 177 | } | 180 | } |
diff --git a/src/core/hle/service/nvdrv/nvdrv.cpp b/src/core/hle/service/nvdrv/nvdrv.cpp index 598a1123b..8958e21e3 100644 --- a/src/core/hle/service/nvdrv/nvdrv.cpp +++ b/src/core/hle/service/nvdrv/nvdrv.cpp | |||
| @@ -40,8 +40,8 @@ Module::Module(Core::System& system) { | |||
| 40 | auto& kernel = system.Kernel(); | 40 | auto& kernel = system.Kernel(); |
| 41 | for (u32 i = 0; i < MaxNvEvents; i++) { | 41 | for (u32 i = 0; i < MaxNvEvents; i++) { |
| 42 | std::string event_label = fmt::format("NVDRV::NvEvent_{}", i); | 42 | std::string event_label = fmt::format("NVDRV::NvEvent_{}", i); |
| 43 | events_interface.events[i] = | 43 | events_interface.events[i] = Kernel::WritableEvent::CreateEventPair( |
| 44 | Kernel::WritableEvent::CreateEventPair(kernel, Kernel::ResetType::Manual, event_label); | 44 | kernel, Kernel::ResetType::Automatic, event_label); |
| 45 | events_interface.status[i] = EventState::Free; | 45 | events_interface.status[i] = EventState::Free; |
| 46 | events_interface.registered[i] = false; | 46 | events_interface.registered[i] = false; |
| 47 | } | 47 | } |
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp index efea23bf2..cdb2f804e 100644 --- a/src/video_core/gpu.cpp +++ b/src/video_core/gpu.cpp | |||
| @@ -97,15 +97,18 @@ void GPU::RegisterSyncptInterrupt(const u32 syncpoint_id, const u32 value) { | |||
| 97 | syncpt_interrupts[syncpoint_id].emplace_back(value); | 97 | syncpt_interrupts[syncpoint_id].emplace_back(value); |
| 98 | } | 98 | } |
| 99 | 99 | ||
| 100 | void GPU::CancelSyncptInterrupt(const u32 syncpoint_id, const u32 value) { | 100 | bool GPU::CancelSyncptInterrupt(const u32 syncpoint_id, const u32 value) { |
| 101 | sync_mutex.lock(); | ||
| 101 | auto it = syncpt_interrupts[syncpoint_id].begin(); | 102 | auto it = syncpt_interrupts[syncpoint_id].begin(); |
| 102 | while (it != syncpt_interrupts[syncpoint_id].end()) { | 103 | while (it != syncpt_interrupts[syncpoint_id].end()) { |
| 103 | if (value == *it) { | 104 | if (value == *it) { |
| 104 | it = syncpt_interrupts[syncpoint_id].erase(it); | 105 | it = syncpt_interrupts[syncpoint_id].erase(it); |
| 105 | return; | 106 | return true; |
| 106 | } | 107 | } |
| 107 | it++; | 108 | it++; |
| 108 | } | 109 | } |
| 110 | return false; | ||
| 111 | sync_mutex.unlock(); | ||
| 109 | } | 112 | } |
| 110 | 113 | ||
| 111 | u32 RenderTargetBytesPerPixel(RenderTargetFormat format) { | 114 | u32 RenderTargetBytesPerPixel(RenderTargetFormat format) { |
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h index 9bd618941..94afc91f8 100644 --- a/src/video_core/gpu.h +++ b/src/video_core/gpu.h | |||
| @@ -174,7 +174,7 @@ public: | |||
| 174 | 174 | ||
| 175 | void RegisterSyncptInterrupt(const u32 syncpoint_id, const u32 value); | 175 | void RegisterSyncptInterrupt(const u32 syncpoint_id, const u32 value); |
| 176 | 176 | ||
| 177 | void CancelSyncptInterrupt(const u32 syncpoint_id, const u32 value); | 177 | bool CancelSyncptInterrupt(const u32 syncpoint_id, const u32 value); |
| 178 | 178 | ||
| 179 | void Guard(bool guard_set) { | 179 | void Guard(bool guard_set) { |
| 180 | if (guard_set) { | 180 | if (guard_set) { |