summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2019-06-08 02:41:06 +0200
committerFernandoS27 <fsahmkow27@gmail.com>2019-07-05 21:49:14 +0200
commit8942047d419f6d2d0c56adad689fbf3bcd4d2961 (patch)
treeaa2dd5b6aeef25c9fd5543a2a4ef267a7152b052 /src/video_core
parentnv_services: Implement NvQueryEvent, NvCtrlEventWait, NvEventRegister, NvEventUnregister (diff)
downloadyuzu-8942047d419f6d2d0c56adad689fbf3bcd4d2961.tar
yuzu-8942047d419f6d2d0c56adad689fbf3bcd4d2961.tar.gz
yuzu-8942047d419f6d2d0c56adad689fbf3bcd4d2961.tar.bz2
yuzu-8942047d419f6d2d0c56adad689fbf3bcd4d2961.tar.lz
yuzu-8942047d419f6d2d0c56adad689fbf3bcd4d2961.tar.xz
yuzu-8942047d419f6d2d0c56adad689fbf3bcd4d2961.tar.zst
yuzu-8942047d419f6d2d0c56adad689fbf3bcd4d2961.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/gpu.cpp7
-rw-r--r--src/video_core/gpu.h5
-rw-r--r--src/video_core/gpu_asynch.cpp7
-rw-r--r--src/video_core/gpu_asynch.h3
-rw-r--r--src/video_core/gpu_synch.h3
5 files changed, 21 insertions, 4 deletions
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp
index 1d12f0493..06eb570ab 100644
--- a/src/video_core/gpu.cpp
+++ b/src/video_core/gpu.cpp
@@ -29,7 +29,8 @@ u32 FramebufferConfig::BytesPerPixel(PixelFormat format) {
UNREACHABLE();
}
-GPU::GPU(Core::System& system, VideoCore::RendererBase& renderer) : renderer{renderer} {
+GPU::GPU(Core::System& system, VideoCore::RendererBase& renderer)
+ : system{system}, renderer{renderer} {
auto& rasterizer{renderer.Rasterizer()};
memory_manager = std::make_unique<Tegra::MemoryManager>(rasterizer);
dma_pusher = std::make_unique<Tegra::DmaPusher>(*this);
@@ -87,6 +88,10 @@ u32 GPU::GetSyncpointValue(const u32 syncpoint_id) const {
}
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)
+ return;
+ }
events[syncpoint_id].emplace_back(event_id, value);
}
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h
index 4c97d6c6f..c3e5311fa 100644
--- a/src/video_core/gpu.h
+++ b/src/video_core/gpu.h
@@ -238,9 +238,7 @@ public:
virtual void FlushAndInvalidateRegion(CacheAddr addr, u64 size) = 0;
protected:
- virtual void TriggerCpuInterrupt(const u32 event_id) const {
- // Todo implement this
- }
+ virtual void TriggerCpuInterrupt(const u32 event_id) const = 0;
private:
void ProcessBindMethod(const MethodCall& method_call);
@@ -260,6 +258,7 @@ private:
protected:
std::unique_ptr<Tegra::DmaPusher> dma_pusher;
VideoCore::RendererBase& renderer;
+ Core::System& system;
private:
std::unique_ptr<Tegra::MemoryManager> memory_manager;
diff --git a/src/video_core/gpu_asynch.cpp b/src/video_core/gpu_asynch.cpp
index d4e2553a9..7060f9a89 100644
--- a/src/video_core/gpu_asynch.cpp
+++ b/src/video_core/gpu_asynch.cpp
@@ -2,6 +2,8 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
+#include "core/core.h"
+#include "core/hardware_interrupt_manager.h"
#include "video_core/gpu_asynch.h"
#include "video_core/gpu_thread.h"
#include "video_core/renderer_base.h"
@@ -38,4 +40,9 @@ void GPUAsynch::FlushAndInvalidateRegion(CacheAddr addr, u64 size) {
gpu_thread.FlushAndInvalidateRegion(addr, size);
}
+void GPUAsynch::TriggerCpuInterrupt(const u32 event_id) const {
+ auto& interrupt_manager = system.InterruptManager();
+ interrupt_manager.InterruptGPU(event_id);
+}
+
} // namespace VideoCommon
diff --git a/src/video_core/gpu_asynch.h b/src/video_core/gpu_asynch.h
index 30be74cba..d49e9b96e 100644
--- a/src/video_core/gpu_asynch.h
+++ b/src/video_core/gpu_asynch.h
@@ -27,6 +27,9 @@ public:
void InvalidateRegion(CacheAddr addr, u64 size) override;
void FlushAndInvalidateRegion(CacheAddr addr, u64 size) override;
+protected:
+ void TriggerCpuInterrupt(const u32 event_id) const override;
+
private:
GPUThread::ThreadManager gpu_thread;
};
diff --git a/src/video_core/gpu_synch.h b/src/video_core/gpu_synch.h
index 3031fcf72..09bda854a 100644
--- a/src/video_core/gpu_synch.h
+++ b/src/video_core/gpu_synch.h
@@ -25,6 +25,9 @@ public:
void FlushRegion(CacheAddr addr, u64 size) override;
void InvalidateRegion(CacheAddr addr, u64 size) override;
void FlushAndInvalidateRegion(CacheAddr addr, u64 size) override;
+
+protected:
+ void TriggerCpuInterrupt(const u32 event_id) const override {}
};
} // namespace VideoCommon