summaryrefslogtreecommitdiff
path: root/src/video_core/gpu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/gpu.cpp')
-rw-r--r--src/video_core/gpu.cpp48
1 files changed, 0 insertions, 48 deletions
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp
index e05c9a357..a1d19b1c8 100644
--- a/src/video_core/gpu.cpp
+++ b/src/video_core/gpu.cpp
@@ -14,7 +14,6 @@
14#include "core/core.h" 14#include "core/core.h"
15#include "core/core_timing.h" 15#include "core/core_timing.h"
16#include "core/frontend/emu_window.h" 16#include "core/frontend/emu_window.h"
17#include "core/hardware_interrupt_manager.h"
18#include "core/hle/service/nvdrv/nvdata.h" 17#include "core/hle/service/nvdrv/nvdata.h"
19#include "core/perf_stats.h" 18#include "core/perf_stats.h"
20#include "video_core/cdma_pusher.h" 19#include "video_core/cdma_pusher.h"
@@ -36,8 +35,6 @@
36 35
37namespace Tegra { 36namespace Tegra {
38 37
39MICROPROFILE_DEFINE(GPU_wait, "GPU", "Wait for the GPU", MP_RGB(128, 128, 192));
40
41struct GPU::Impl { 38struct GPU::Impl {
42 explicit Impl(GPU& gpu_, Core::System& system_, bool is_async_, bool use_nvdec_) 39 explicit Impl(GPU& gpu_, Core::System& system_, bool is_async_, bool use_nvdec_)
43 : gpu{gpu_}, system{system_}, host1x{system.Host1x()}, use_nvdec{use_nvdec_}, 40 : gpu{gpu_}, system{system_}, host1x{system.Host1x()}, use_nvdec{use_nvdec_},
@@ -197,30 +194,6 @@ struct GPU::Impl {
197 return *shader_notify; 194 return *shader_notify;
198 } 195 }
199 196
200 /// Allows the CPU/NvFlinger to wait on the GPU before presenting a frame.
201 void WaitFence(u32 syncpoint_id, u32 value) {
202 if (syncpoint_id == UINT32_MAX) {
203 return;
204 }
205 MICROPROFILE_SCOPE(GPU_wait);
206 host1x.GetSyncpointManager().WaitHost(syncpoint_id, value);
207 }
208
209 void IncrementSyncPoint(u32 syncpoint_id) {
210 host1x.GetSyncpointManager().IncrementHost(syncpoint_id);
211 }
212
213 [[nodiscard]] u32 GetSyncpointValue(u32 syncpoint_id) const {
214 return host1x.GetSyncpointManager().GetHostSyncpointValue(syncpoint_id);
215 }
216
217 void RegisterSyncptInterrupt(u32 syncpoint_id, u32 value) {
218 auto& syncpoint_manager = host1x.GetSyncpointManager();
219 syncpoint_manager.RegisterHostAction(syncpoint_id, value, [this, syncpoint_id, value]() {
220 TriggerCpuInterrupt(syncpoint_id, value);
221 });
222 }
223
224 [[nodiscard]] u64 GetTicks() const { 197 [[nodiscard]] u64 GetTicks() const {
225 // This values were reversed engineered by fincs from NVN 198 // This values were reversed engineered by fincs from NVN
226 // The gpu clock is reported in units of 385/625 nanoseconds 199 // The gpu clock is reported in units of 385/625 nanoseconds
@@ -322,11 +295,6 @@ struct GPU::Impl {
322 gpu_thread.FlushAndInvalidateRegion(addr, size); 295 gpu_thread.FlushAndInvalidateRegion(addr, size);
323 } 296 }
324 297
325 void TriggerCpuInterrupt(u32 syncpoint_id, u32 value) const {
326 auto& interrupt_manager = system.InterruptManager();
327 interrupt_manager.GPUInterruptSyncpt(syncpoint_id, value);
328 }
329
330 void RequestSwapBuffers(const Tegra::FramebufferConfig* framebuffer, 298 void RequestSwapBuffers(const Tegra::FramebufferConfig* framebuffer,
331 Service::Nvidia::NvFence* fences, size_t num_fences) { 299 Service::Nvidia::NvFence* fences, size_t num_fences) {
332 size_t current_request_counter{}; 300 size_t current_request_counter{};
@@ -524,22 +492,6 @@ void GPU::RequestSwapBuffers(const Tegra::FramebufferConfig* framebuffer,
524 impl->RequestSwapBuffers(framebuffer, fences, num_fences); 492 impl->RequestSwapBuffers(framebuffer, fences, num_fences);
525} 493}
526 494
527void GPU::WaitFence(u32 syncpoint_id, u32 value) {
528 impl->WaitFence(syncpoint_id, value);
529}
530
531void GPU::IncrementSyncPoint(u32 syncpoint_id) {
532 impl->IncrementSyncPoint(syncpoint_id);
533}
534
535u32 GPU::GetSyncpointValue(u32 syncpoint_id) const {
536 return impl->GetSyncpointValue(syncpoint_id);
537}
538
539void GPU::RegisterSyncptInterrupt(u32 syncpoint_id, u32 value) {
540 impl->RegisterSyncptInterrupt(syncpoint_id, value);
541}
542
543u64 GPU::GetTicks() const { 495u64 GPU::GetTicks() const {
544 return impl->GetTicks(); 496 return impl->GetTicks();
545} 497}