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.h23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h
index 2d15d1c6f..b8c613b11 100644
--- a/src/video_core/gpu.h
+++ b/src/video_core/gpu.h
@@ -13,6 +13,7 @@
13#include "common/common_types.h" 13#include "common/common_types.h"
14#include "core/hle/service/nvdrv/nvdata.h" 14#include "core/hle/service/nvdrv/nvdata.h"
15#include "core/hle/service/nvflinger/buffer_queue.h" 15#include "core/hle/service/nvflinger/buffer_queue.h"
16#include "video_core/cdma_pusher.h"
16#include "video_core/dma_pusher.h" 17#include "video_core/dma_pusher.h"
17 18
18using CacheAddr = std::uintptr_t; 19using CacheAddr = std::uintptr_t;
@@ -157,7 +158,7 @@ public:
157 method_count(method_count) {} 158 method_count(method_count) {}
158 }; 159 };
159 160
160 explicit GPU(Core::System& system, bool is_async); 161 explicit GPU(Core::System& system, bool is_async, bool use_nvdec);
161 virtual ~GPU(); 162 virtual ~GPU();
162 163
163 /// Binds a renderer to the GPU. 164 /// Binds a renderer to the GPU.
@@ -209,6 +210,15 @@ public:
209 /// Returns a reference to the GPU DMA pusher. 210 /// Returns a reference to the GPU DMA pusher.
210 Tegra::DmaPusher& DmaPusher(); 211 Tegra::DmaPusher& DmaPusher();
211 212
213 /// Returns a const reference to the GPU DMA pusher.
214 const Tegra::DmaPusher& DmaPusher() const;
215
216 /// Returns a reference to the GPU CDMA pusher.
217 Tegra::CDmaPusher& CDmaPusher();
218
219 /// Returns a const reference to the GPU CDMA pusher.
220 const Tegra::CDmaPusher& CDmaPusher() const;
221
212 VideoCore::RendererBase& Renderer() { 222 VideoCore::RendererBase& Renderer() {
213 return *renderer; 223 return *renderer;
214 } 224 }
@@ -249,8 +259,9 @@ public:
249 return is_async; 259 return is_async;
250 } 260 }
251 261
252 /// Returns a const reference to the GPU DMA pusher. 262 bool UseNvdec() const {
253 const Tegra::DmaPusher& DmaPusher() const; 263 return use_nvdec;
264 }
254 265
255 struct Regs { 266 struct Regs {
256 static constexpr size_t NUM_REGS = 0x40; 267 static constexpr size_t NUM_REGS = 0x40;
@@ -311,6 +322,9 @@ public:
311 /// Push GPU command entries to be processed 322 /// Push GPU command entries to be processed
312 virtual void PushGPUEntries(Tegra::CommandList&& entries) = 0; 323 virtual void PushGPUEntries(Tegra::CommandList&& entries) = 0;
313 324
325 /// Push GPU command buffer entries to be processed
326 virtual void PushCommandBuffer(Tegra::ChCommandHeaderList& entries) = 0;
327
314 /// Swap buffers (render frame) 328 /// Swap buffers (render frame)
315 virtual void SwapBuffers(const Tegra::FramebufferConfig* framebuffer) = 0; 329 virtual void SwapBuffers(const Tegra::FramebufferConfig* framebuffer) = 0;
316 330
@@ -349,7 +363,9 @@ protected:
349 Core::System& system; 363 Core::System& system;
350 std::unique_ptr<Tegra::MemoryManager> memory_manager; 364 std::unique_ptr<Tegra::MemoryManager> memory_manager;
351 std::unique_ptr<Tegra::DmaPusher> dma_pusher; 365 std::unique_ptr<Tegra::DmaPusher> dma_pusher;
366 std::unique_ptr<Tegra::CDmaPusher> cdma_pusher;
352 std::unique_ptr<VideoCore::RendererBase> renderer; 367 std::unique_ptr<VideoCore::RendererBase> renderer;
368 const bool use_nvdec;
353 369
354private: 370private:
355 /// Mapping of command subchannels to their bound engine ids 371 /// Mapping of command subchannels to their bound engine ids
@@ -372,6 +388,7 @@ private:
372 std::array<std::list<u32>, Service::Nvidia::MaxSyncPoints> syncpt_interrupts; 388 std::array<std::list<u32>, Service::Nvidia::MaxSyncPoints> syncpt_interrupts;
373 389
374 std::mutex sync_mutex; 390 std::mutex sync_mutex;
391 std::mutex device_mutex;
375 392
376 std::condition_variable sync_cv; 393 std::condition_variable sync_cv;
377 394