summaryrefslogtreecommitdiff
path: root/src/video_core/gpu.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/gpu.h')
-rw-r--r--src/video_core/gpu.h34
1 files changed, 33 insertions, 1 deletions
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h
index 0055e5326..87c96f46b 100644
--- a/src/video_core/gpu.h
+++ b/src/video_core/gpu.h
@@ -5,8 +5,12 @@
5#pragma once 5#pragma once
6 6
7#include <array> 7#include <array>
8#include <atomic>
9#include <list>
8#include <memory> 10#include <memory>
11#include <mutex>
9#include "common/common_types.h" 12#include "common/common_types.h"
13#include "core/hle/service/nvdrv/nvdata.h"
10#include "core/hle/service/nvflinger/buffer_queue.h" 14#include "core/hle/service/nvflinger/buffer_queue.h"
11#include "video_core/dma_pusher.h" 15#include "video_core/dma_pusher.h"
12 16
@@ -127,7 +131,7 @@ class MemoryManager;
127 131
128class GPU { 132class GPU {
129public: 133public:
130 explicit GPU(Core::System& system, VideoCore::RendererBase& renderer); 134 explicit GPU(Core::System& system, VideoCore::RendererBase& renderer, bool is_async);
131 135
132 virtual ~GPU(); 136 virtual ~GPU();
133 137
@@ -170,6 +174,22 @@ public:
170 /// Returns a reference to the GPU DMA pusher. 174 /// Returns a reference to the GPU DMA pusher.
171 Tegra::DmaPusher& DmaPusher(); 175 Tegra::DmaPusher& DmaPusher();
172 176
177 void IncrementSyncPoint(u32 syncpoint_id);
178
179 u32 GetSyncpointValue(u32 syncpoint_id) const;
180
181 void RegisterSyncptInterrupt(u32 syncpoint_id, u32 value);
182
183 bool CancelSyncptInterrupt(u32 syncpoint_id, u32 value);
184
185 std::unique_lock<std::mutex> LockSync() {
186 return std::unique_lock{sync_mutex};
187 }
188
189 bool IsAsync() const {
190 return is_async;
191 }
192
173 /// Returns a const reference to the GPU DMA pusher. 193 /// Returns a const reference to the GPU DMA pusher.
174 const Tegra::DmaPusher& DmaPusher() const; 194 const Tegra::DmaPusher& DmaPusher() const;
175 195
@@ -239,6 +259,9 @@ public:
239 /// Notify rasterizer that any caches of the specified region should be flushed and invalidated 259 /// Notify rasterizer that any caches of the specified region should be flushed and invalidated
240 virtual void FlushAndInvalidateRegion(CacheAddr addr, u64 size) = 0; 260 virtual void FlushAndInvalidateRegion(CacheAddr addr, u64 size) = 0;
241 261
262protected:
263 virtual void TriggerCpuInterrupt(u32 syncpoint_id, u32 value) const = 0;
264
242private: 265private:
243 void ProcessBindMethod(const MethodCall& method_call); 266 void ProcessBindMethod(const MethodCall& method_call);
244 void ProcessSemaphoreTriggerMethod(); 267 void ProcessSemaphoreTriggerMethod();
@@ -257,6 +280,7 @@ private:
257protected: 280protected:
258 std::unique_ptr<Tegra::DmaPusher> dma_pusher; 281 std::unique_ptr<Tegra::DmaPusher> dma_pusher;
259 VideoCore::RendererBase& renderer; 282 VideoCore::RendererBase& renderer;
283 Core::System& system;
260 284
261private: 285private:
262 std::unique_ptr<Tegra::MemoryManager> memory_manager; 286 std::unique_ptr<Tegra::MemoryManager> memory_manager;
@@ -273,6 +297,14 @@ private:
273 std::unique_ptr<Engines::MaxwellDMA> maxwell_dma; 297 std::unique_ptr<Engines::MaxwellDMA> maxwell_dma;
274 /// Inline memory engine 298 /// Inline memory engine
275 std::unique_ptr<Engines::KeplerMemory> kepler_memory; 299 std::unique_ptr<Engines::KeplerMemory> kepler_memory;
300
301 std::array<std::atomic<u32>, Service::Nvidia::MaxSyncPoints> syncpoints{};
302
303 std::array<std::list<u32>, Service::Nvidia::MaxSyncPoints> syncpt_interrupts;
304
305 std::mutex sync_mutex;
306
307 const bool is_async;
276}; 308};
277 309
278#define ASSERT_REG_POSITION(field_name, position) \ 310#define ASSERT_REG_POSITION(field_name, position) \