summaryrefslogtreecommitdiff
path: root/src/video_core/gpu.cpp
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2019-06-12 07:52:49 -0400
committerGravatar FernandoS272019-07-05 15:49:26 -0400
commit7d1b974bcaf72c32910dcf4ff2d435f91cf40609 (patch)
tree64c69a14a9135b0027dea0d7e832e52710d7d8a8 /src/video_core/gpu.cpp
parentnvflinger: Make the force 30 fps still force 30 fps (diff)
downloadyuzu-7d1b974bcaf72c32910dcf4ff2d435f91cf40609.tar.gz
yuzu-7d1b974bcaf72c32910dcf4ff2d435f91cf40609.tar.xz
yuzu-7d1b974bcaf72c32910dcf4ff2d435f91cf40609.zip
GPU: Correct Interrupts to interrupt on syncpt/value instead of event, mirroring hardware
Diffstat (limited to 'src/video_core/gpu.cpp')
-rw-r--r--src/video_core/gpu.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp
index 086db0e69..efea23bf2 100644
--- a/src/video_core/gpu.cpp
+++ b/src/video_core/gpu.cpp
@@ -70,13 +70,13 @@ const DmaPusher& GPU::DmaPusher() const {
70void GPU::IncrementSyncPoint(const u32 syncpoint_id) { 70void GPU::IncrementSyncPoint(const u32 syncpoint_id) {
71 syncpoints[syncpoint_id]++; 71 syncpoints[syncpoint_id]++;
72 sync_mutex.lock(); 72 sync_mutex.lock();
73 if (!events[syncpoint_id].empty()) { 73 if (!syncpt_interrupts[syncpoint_id].empty()) {
74 u32 value = syncpoints[syncpoint_id].load(); 74 u32 value = syncpoints[syncpoint_id].load();
75 auto it = events[syncpoint_id].begin(); 75 auto it = syncpt_interrupts[syncpoint_id].begin();
76 while (it != events[syncpoint_id].end()) { 76 while (it != syncpt_interrupts[syncpoint_id].end()) {
77 if (value >= it->value) { 77 if (value >= *it) {
78 TriggerCpuInterrupt(it->event_id); 78 TriggerCpuInterrupt(syncpoint_id, *it);
79 it = events[syncpoint_id].erase(it); 79 it = syncpt_interrupts[syncpoint_id].erase(it);
80 continue; 80 continue;
81 } 81 }
82 it++; 82 it++;
@@ -89,19 +89,19 @@ u32 GPU::GetSyncpointValue(const u32 syncpoint_id) const {
89 return syncpoints[syncpoint_id].load(); 89 return syncpoints[syncpoint_id].load();
90} 90}
91 91
92void GPU::RegisterEvent(const u32 event_id, const u32 syncpoint_id, const u32 value) { 92void GPU::RegisterSyncptInterrupt(const u32 syncpoint_id, const u32 value) {
93 for (auto& ev : events[syncpoint_id]) { 93 for (u32 in_value : syncpt_interrupts[syncpoint_id]) {
94 if (ev.event_id == event_id && ev.value == value) 94 if (in_value == value)
95 return; 95 return;
96 } 96 }
97 events[syncpoint_id].emplace_back(event_id, value); 97 syncpt_interrupts[syncpoint_id].emplace_back(value);
98} 98}
99 99
100void GPU::CancelEvent(const u32 event_id, const u32 syncpoint_id, const u32 value) { 100void GPU::CancelSyncptInterrupt(const u32 syncpoint_id, const u32 value) {
101 auto it = events[syncpoint_id].begin(); 101 auto it = syncpt_interrupts[syncpoint_id].begin();
102 while (it != events[syncpoint_id].end()) { 102 while (it != syncpt_interrupts[syncpoint_id].end()) {
103 if (value == it->value) { 103 if (value == *it) {
104 it = events[syncpoint_id].erase(it); 104 it = syncpt_interrupts[syncpoint_id].erase(it);
105 return; 105 return;
106 } 106 }
107 it++; 107 it++;