summaryrefslogtreecommitdiff
path: root/src/video_core/gpu.h
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2019-06-07 12:56:30 -0400
committerGravatar FernandoS272019-07-05 15:49:11 -0400
commit82b829625b89a706dd0d867c529f533fe928710c (patch)
tree1d5e4bfcde8843e377ae51e3f0741b9abaa1a26a /src/video_core/gpu.h
parentnv_services: Correct buffer queue fencing and GPFifo fencing (diff)
downloadyuzu-82b829625b89a706dd0d867c529f533fe928710c.tar.gz
yuzu-82b829625b89a706dd0d867c529f533fe928710c.tar.xz
yuzu-82b829625b89a706dd0d867c529f533fe928710c.zip
video_core: Implement GPU side Syncpoints
Diffstat (limited to 'src/video_core/gpu.h')
-rw-r--r--src/video_core/gpu.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h
index fe6628923..4c97d6c6f 100644
--- a/src/video_core/gpu.h
+++ b/src/video_core/gpu.h
@@ -5,8 +5,11 @@
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>
9#include "common/common_types.h" 11#include "common/common_types.h"
12#include "core/hle/service/nvdrv/nvdata.h"
10#include "core/hle/service/nvflinger/buffer_queue.h" 13#include "core/hle/service/nvflinger/buffer_queue.h"
11#include "video_core/dma_pusher.h" 14#include "video_core/dma_pusher.h"
12 15
@@ -164,6 +167,12 @@ public:
164 /// Returns a reference to the GPU DMA pusher. 167 /// Returns a reference to the GPU DMA pusher.
165 Tegra::DmaPusher& DmaPusher(); 168 Tegra::DmaPusher& DmaPusher();
166 169
170 void IncrementSyncPoint(const u32 syncpoint_id);
171
172 u32 GetSyncpointValue(const u32 syncpoint_id) const;
173
174 void RegisterEvent(const u32 event_id, const u32 sync_point_id, const u32 value);
175
167 /// Returns a const reference to the GPU DMA pusher. 176 /// Returns a const reference to the GPU DMA pusher.
168 const Tegra::DmaPusher& DmaPusher() const; 177 const Tegra::DmaPusher& DmaPusher() const;
169 178
@@ -228,6 +237,11 @@ public:
228 /// Notify rasterizer that any caches of the specified region should be flushed and invalidated 237 /// Notify rasterizer that any caches of the specified region should be flushed and invalidated
229 virtual void FlushAndInvalidateRegion(CacheAddr addr, u64 size) = 0; 238 virtual void FlushAndInvalidateRegion(CacheAddr addr, u64 size) = 0;
230 239
240protected:
241 virtual void TriggerCpuInterrupt(const u32 event_id) const {
242 // Todo implement this
243 }
244
231private: 245private:
232 void ProcessBindMethod(const MethodCall& method_call); 246 void ProcessBindMethod(const MethodCall& method_call);
233 void ProcessSemaphoreTriggerMethod(); 247 void ProcessSemaphoreTriggerMethod();
@@ -262,6 +276,16 @@ private:
262 std::unique_ptr<Engines::MaxwellDMA> maxwell_dma; 276 std::unique_ptr<Engines::MaxwellDMA> maxwell_dma;
263 /// Inline memory engine 277 /// Inline memory engine
264 std::unique_ptr<Engines::KeplerMemory> kepler_memory; 278 std::unique_ptr<Engines::KeplerMemory> kepler_memory;
279
280 std::array<std::atomic<u32>, Service::Nvidia::MaxSyncPoints> syncpoints{};
281
282 struct Event {
283 Event(const u32 event_id, const u32 value) : event_id(event_id), value(value) {}
284 u32 event_id;
285 u32 value;
286 };
287
288 std::array<std::list<Event>, Service::Nvidia::MaxSyncPoints> events;
265}; 289};
266 290
267#define ASSERT_REG_POSITION(field_name, position) \ 291#define ASSERT_REG_POSITION(field_name, position) \