From 668e80a9f42fb4ce0e16f6381d05bcbd286b2da1 Mon Sep 17 00:00:00 2001 From: Fernando Sahmkow Date: Sun, 30 Jan 2022 10:31:13 +0100 Subject: VideoCore: Refactor syncing. --- src/video_core/host1x/control.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/video_core/host1x/control.cpp (limited to 'src/video_core/host1x/control.cpp') diff --git a/src/video_core/host1x/control.cpp b/src/video_core/host1x/control.cpp new file mode 100644 index 000000000..b72b01aa3 --- /dev/null +++ b/src/video_core/host1x/control.cpp @@ -0,0 +1,35 @@ +// Copyright 2022 yuzu Emulator Project +// Licensed under GPLv3 or any later version +// Refer to the license.txt file included. + +#include "common/assert.h" +#include "video_core/gpu.h" +#include "video_core/host1x/control.h" +#include "video_core/host1x/host1x.h" + +namespace Tegra::Host1x { + +Control::Control(GPU& gpu_) : gpu(gpu_) {} + +Control::~Control() = default; + +void Control::ProcessMethod(Method method, u32 argument) { + switch (method) { + case Method::LoadSyncptPayload32: + syncpoint_value = argument; + break; + case Method::WaitSyncpt: + case Method::WaitSyncpt32: + Execute(argument); + break; + default: + UNIMPLEMENTED_MSG("Control method 0x{:X}", static_cast(method)); + break; + } +} + +void Control::Execute(u32 data) { + gpu.Host1x().GetSyncpointManager().WaitHost(data, syncpoint_value); +} + +} // namespace Tegra::Host1x -- cgit v1.2.3 From 2931101e6f5aa755566ef40f6e6dc71909fd3e92 Mon Sep 17 00:00:00 2001 From: Fernando Sahmkow Date: Sun, 30 Jan 2022 22:26:01 +0100 Subject: NVDRV: Refactor Host1x --- src/video_core/host1x/control.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/video_core/host1x/control.cpp') diff --git a/src/video_core/host1x/control.cpp b/src/video_core/host1x/control.cpp index b72b01aa3..a81c635ae 100644 --- a/src/video_core/host1x/control.cpp +++ b/src/video_core/host1x/control.cpp @@ -3,13 +3,12 @@ // Refer to the license.txt file included. #include "common/assert.h" -#include "video_core/gpu.h" #include "video_core/host1x/control.h" #include "video_core/host1x/host1x.h" namespace Tegra::Host1x { -Control::Control(GPU& gpu_) : gpu(gpu_) {} +Control::Control(Host1x& host1x_) : host1x(host1x_) {} Control::~Control() = default; @@ -29,7 +28,7 @@ void Control::ProcessMethod(Method method, u32 argument) { } void Control::Execute(u32 data) { - gpu.Host1x().GetSyncpointManager().WaitHost(data, syncpoint_value); + host1x.GetSyncpointManager().WaitHost(data, syncpoint_value); } } // namespace Tegra::Host1x -- cgit v1.2.3 From fedd983f96bcbcc0c39f651db1cca0503d582fd9 Mon Sep 17 00:00:00 2001 From: Morph Date: Wed, 29 Jun 2022 19:27:49 -0400 Subject: general: Format licenses as per SPDX guidelines --- src/video_core/host1x/control.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/video_core/host1x/control.cpp') diff --git a/src/video_core/host1x/control.cpp b/src/video_core/host1x/control.cpp index a81c635ae..dceefdb7f 100644 --- a/src/video_core/host1x/control.cpp +++ b/src/video_core/host1x/control.cpp @@ -1,6 +1,5 @@ -// Copyright 2022 yuzu Emulator Project -// Licensed under GPLv3 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: 2021 yuzu Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later #include "common/assert.h" #include "video_core/host1x/control.h" -- cgit v1.2.3