diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-06-12 13:52:49 +0200 |
---|---|---|
committer | FernandoS27 <fsahmkow27@gmail.com> | 2019-07-05 21:49:26 +0200 |
commit | 7d1b974bcaf72c32910dcf4ff2d435f91cf40609 (patch) | |
tree | 64c69a14a9135b0027dea0d7e832e52710d7d8a8 /src/video_core | |
parent | nvflinger: Make the force 30 fps still force 30 fps (diff) | |
download | yuzu-7d1b974bcaf72c32910dcf4ff2d435f91cf40609.tar yuzu-7d1b974bcaf72c32910dcf4ff2d435f91cf40609.tar.gz yuzu-7d1b974bcaf72c32910dcf4ff2d435f91cf40609.tar.bz2 yuzu-7d1b974bcaf72c32910dcf4ff2d435f91cf40609.tar.lz yuzu-7d1b974bcaf72c32910dcf4ff2d435f91cf40609.tar.xz yuzu-7d1b974bcaf72c32910dcf4ff2d435f91cf40609.tar.zst yuzu-7d1b974bcaf72c32910dcf4ff2d435f91cf40609.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/gpu.cpp | 30 | ||||
-rw-r--r-- | src/video_core/gpu.h | 14 | ||||
-rw-r--r-- | src/video_core/gpu_asynch.cpp | 4 | ||||
-rw-r--r-- | src/video_core/gpu_asynch.h | 2 | ||||
-rw-r--r-- | src/video_core/gpu_synch.h | 2 |
5 files changed, 23 insertions, 29 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 { void GPU::IncrementSyncPoint(const u32 syncpoint_id) { syncpoints[syncpoint_id]++; sync_mutex.lock(); - if (!events[syncpoint_id].empty()) { + if (!syncpt_interrupts[syncpoint_id].empty()) { u32 value = syncpoints[syncpoint_id].load(); - auto it = events[syncpoint_id].begin(); - while (it != events[syncpoint_id].end()) { - if (value >= it->value) { - TriggerCpuInterrupt(it->event_id); - it = events[syncpoint_id].erase(it); + auto it = syncpt_interrupts[syncpoint_id].begin(); + while (it != syncpt_interrupts[syncpoint_id].end()) { + if (value >= *it) { + TriggerCpuInterrupt(syncpoint_id, *it); + it = syncpt_interrupts[syncpoint_id].erase(it); continue; } it++; @@ -89,19 +89,19 @@ u32 GPU::GetSyncpointValue(const u32 syncpoint_id) const { return syncpoints[syncpoint_id].load(); } -void GPU::RegisterEvent(const u32 event_id, const u32 syncpoint_id, const u32 value) { - for (auto& ev : events[syncpoint_id]) { - if (ev.event_id == event_id && ev.value == value) +void GPU::RegisterSyncptInterrupt(const u32 syncpoint_id, const u32 value) { + for (u32 in_value : syncpt_interrupts[syncpoint_id]) { + if (in_value == value) return; } - events[syncpoint_id].emplace_back(event_id, value); + syncpt_interrupts[syncpoint_id].emplace_back(value); } -void GPU::CancelEvent(const u32 event_id, const u32 syncpoint_id, const u32 value) { - auto it = events[syncpoint_id].begin(); - while (it != events[syncpoint_id].end()) { - if (value == it->value) { - it = events[syncpoint_id].erase(it); +void GPU::CancelSyncptInterrupt(const u32 syncpoint_id, const u32 value) { + auto it = syncpt_interrupts[syncpoint_id].begin(); + while (it != syncpt_interrupts[syncpoint_id].end()) { + if (value == *it) { + it = syncpt_interrupts[syncpoint_id].erase(it); return; } it++; diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h index 18ac3237e..9bd618941 100644 --- a/src/video_core/gpu.h +++ b/src/video_core/gpu.h @@ -172,9 +172,9 @@ public: u32 GetSyncpointValue(const u32 syncpoint_id) const; - void RegisterEvent(const u32 event_id, const u32 syncpoint_id, const u32 value); + void RegisterSyncptInterrupt(const u32 syncpoint_id, const u32 value); - void CancelEvent(const u32 event_id, const u32 syncpoint_id, const u32 value); + void CancelSyncptInterrupt(const u32 syncpoint_id, const u32 value); void Guard(bool guard_set) { if (guard_set) { @@ -253,7 +253,7 @@ public: virtual void FlushAndInvalidateRegion(CacheAddr addr, u64 size) = 0; protected: - virtual void TriggerCpuInterrupt(const u32 event_id) const = 0; + virtual void TriggerCpuInterrupt(const u32 syncpoint_id, const u32 value) const = 0; private: void ProcessBindMethod(const MethodCall& method_call); @@ -293,13 +293,7 @@ private: std::array<std::atomic<u32>, Service::Nvidia::MaxSyncPoints> syncpoints{}; - struct Event { - Event(const u32 event_id, const u32 value) : event_id(event_id), value(value) {} - u32 event_id; - u32 value; - }; - - std::array<std::list<Event>, Service::Nvidia::MaxSyncPoints> events; + std::array<std::list<u32>, Service::Nvidia::MaxSyncPoints> syncpt_interrupts; std::mutex sync_mutex; diff --git a/src/video_core/gpu_asynch.cpp b/src/video_core/gpu_asynch.cpp index 6b6f0f6ec..ea67be831 100644 --- a/src/video_core/gpu_asynch.cpp +++ b/src/video_core/gpu_asynch.cpp @@ -40,9 +40,9 @@ void GPUAsynch::FlushAndInvalidateRegion(CacheAddr addr, u64 size) { gpu_thread.FlushAndInvalidateRegion(addr, size); } -void GPUAsynch::TriggerCpuInterrupt(const u32 event_id) const { +void GPUAsynch::TriggerCpuInterrupt(const u32 syncpoint_id, const u32 value) const { auto& interrupt_manager = system.InterruptManager(); - interrupt_manager.InterruptGPU(event_id); + interrupt_manager.GPUInterruptSyncpt(syncpoint_id, value); } } // namespace VideoCommon diff --git a/src/video_core/gpu_asynch.h b/src/video_core/gpu_asynch.h index d49e9b96e..5f1b2fb7d 100644 --- a/src/video_core/gpu_asynch.h +++ b/src/video_core/gpu_asynch.h @@ -28,7 +28,7 @@ public: void FlushAndInvalidateRegion(CacheAddr addr, u64 size) override; protected: - void TriggerCpuInterrupt(const u32 event_id) const override; + void TriggerCpuInterrupt(const u32 syncpoint_id, const u32 value) const override; private: GPUThread::ThreadManager gpu_thread; diff --git a/src/video_core/gpu_synch.h b/src/video_core/gpu_synch.h index 09bda854a..58d258503 100644 --- a/src/video_core/gpu_synch.h +++ b/src/video_core/gpu_synch.h @@ -27,7 +27,7 @@ public: void FlushAndInvalidateRegion(CacheAddr addr, u64 size) override; protected: - void TriggerCpuInterrupt(const u32 event_id) const override {} + void TriggerCpuInterrupt(const u32 syncpoint_id, const u32 value) const override {} }; } // namespace VideoCommon |