summaryrefslogtreecommitdiff
path: root/src/video_core/gpu.h
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2019-06-07 22:13:40 -0400
committerGravatar FernandoS272019-07-05 15:49:16 -0400
commiteef55f493b636bfc57389e9c541ddf2c39f6f826 (patch)
treedb7e0db06edb8dc80b67b111b4fdb06d464a1eb5 /src/video_core/gpu.h
parentnv_services: Stub CtrlEventSignal (diff)
downloadyuzu-eef55f493b636bfc57389e9c541ddf2c39f6f826.tar.gz
yuzu-eef55f493b636bfc57389e9c541ddf2c39f6f826.tar.xz
yuzu-eef55f493b636bfc57389e9c541ddf2c39f6f826.zip
Gpu: Mark areas as protected.
Diffstat (limited to 'src/video_core/gpu.h')
-rw-r--r--src/video_core/gpu.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h
index 4805a5fbc..bc63920f2 100644
--- a/src/video_core/gpu.h
+++ b/src/video_core/gpu.h
@@ -12,6 +12,7 @@
12#include "core/hle/service/nvdrv/nvdata.h" 12#include "core/hle/service/nvdrv/nvdata.h"
13#include "core/hle/service/nvflinger/buffer_queue.h" 13#include "core/hle/service/nvflinger/buffer_queue.h"
14#include "video_core/dma_pusher.h" 14#include "video_core/dma_pusher.h"
15#include "common/spin_lock.h"
15 16
16using CacheAddr = std::uintptr_t; 17using CacheAddr = std::uintptr_t;
17inline CacheAddr ToCacheAddr(const void* host_ptr) { 18inline CacheAddr ToCacheAddr(const void* host_ptr) {
@@ -175,6 +176,14 @@ public:
175 176
176 void CancelEvent(const u32 event_id, const u32 syncpoint_id, const u32 value); 177 void CancelEvent(const u32 event_id, const u32 syncpoint_id, const u32 value);
177 178
179 void Guard(bool guard_set) {
180 if (guard_set) {
181 sync_guard.lock();
182 } else {
183 sync_guard.unlock();
184 }
185 }
186
178 /// Returns a const reference to the GPU DMA pusher. 187 /// Returns a const reference to the GPU DMA pusher.
179 const Tegra::DmaPusher& DmaPusher() const; 188 const Tegra::DmaPusher& DmaPusher() const;
180 189
@@ -287,6 +296,8 @@ private:
287 }; 296 };
288 297
289 std::array<std::list<Event>, Service::Nvidia::MaxSyncPoints> events; 298 std::array<std::list<Event>, Service::Nvidia::MaxSyncPoints> events;
299
300 Common::SpinLock sync_guard{};
290}; 301};
291 302
292#define ASSERT_REG_POSITION(field_name, position) \ 303#define ASSERT_REG_POSITION(field_name, position) \