summaryrefslogtreecommitdiff
path: root/src/video_core/control
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2022-09-01 05:45:22 +0200
committerGravatar Fernando Sahmkow2022-10-06 21:00:54 +0200
commitca3db0d7c94a20668781830ff852dbf512598efb (patch)
treeedd20d669000e980169db27a896adc09078ceeaa /src/video_core/control
parentstate_tracker: workaround channel setup for homebrew (diff)
downloadyuzu-ca3db0d7c94a20668781830ff852dbf512598efb.tar.gz
yuzu-ca3db0d7c94a20668781830ff852dbf512598efb.tar.xz
yuzu-ca3db0d7c94a20668781830ff852dbf512598efb.zip
General: address feedback
Diffstat (limited to 'src/video_core/control')
-rw-r--r--src/video_core/control/channel_state.cpp7
-rw-r--r--src/video_core/control/channel_state.h4
-rw-r--r--src/video_core/control/channel_state_cache.h2
-rw-r--r--src/video_core/control/scheduler.cpp6
-rw-r--r--src/video_core/control/scheduler.h2
5 files changed, 10 insertions, 11 deletions
diff --git a/src/video_core/control/channel_state.cpp b/src/video_core/control/channel_state.cpp
index b04922ac0..cdecc3a91 100644
--- a/src/video_core/control/channel_state.cpp
+++ b/src/video_core/control/channel_state.cpp
@@ -14,10 +14,7 @@
14 14
15namespace Tegra::Control { 15namespace Tegra::Control {
16 16
17ChannelState::ChannelState(s32 bind_id_) { 17ChannelState::ChannelState(s32 bind_id_) : bind_id{bind_id_}, initialized{} {}
18 bind_id = bind_id_;
19 initiated = false;
20}
21 18
22void ChannelState::Init(Core::System& system, GPU& gpu) { 19void ChannelState::Init(Core::System& system, GPU& gpu) {
23 ASSERT(memory_manager); 20 ASSERT(memory_manager);
@@ -27,7 +24,7 @@ void ChannelState::Init(Core::System& system, GPU& gpu) {
27 kepler_compute = std::make_unique<Engines::KeplerCompute>(system, *memory_manager); 24 kepler_compute = std::make_unique<Engines::KeplerCompute>(system, *memory_manager);
28 maxwell_dma = std::make_unique<Engines::MaxwellDMA>(system, *memory_manager); 25 maxwell_dma = std::make_unique<Engines::MaxwellDMA>(system, *memory_manager);
29 kepler_memory = std::make_unique<Engines::KeplerMemory>(system, *memory_manager); 26 kepler_memory = std::make_unique<Engines::KeplerMemory>(system, *memory_manager);
30 initiated = true; 27 initialized = true;
31} 28}
32 29
33void ChannelState::BindRasterizer(VideoCore::RasterizerInterface* rasterizer) { 30void ChannelState::BindRasterizer(VideoCore::RasterizerInterface* rasterizer) {
diff --git a/src/video_core/control/channel_state.h b/src/video_core/control/channel_state.h
index 305b21cba..3a7b9872c 100644
--- a/src/video_core/control/channel_state.h
+++ b/src/video_core/control/channel_state.h
@@ -34,7 +34,7 @@ class DmaPusher;
34namespace Control { 34namespace Control {
35 35
36struct ChannelState { 36struct ChannelState {
37 ChannelState(s32 bind_id); 37 explicit ChannelState(s32 bind_id);
38 ChannelState(const ChannelState& state) = delete; 38 ChannelState(const ChannelState& state) = delete;
39 ChannelState& operator=(const ChannelState&) = delete; 39 ChannelState& operator=(const ChannelState&) = delete;
40 ChannelState(ChannelState&& other) noexcept = default; 40 ChannelState(ChannelState&& other) noexcept = default;
@@ -60,7 +60,7 @@ struct ChannelState {
60 60
61 std::unique_ptr<DmaPusher> dma_pusher; 61 std::unique_ptr<DmaPusher> dma_pusher;
62 62
63 bool initiated{}; 63 bool initialized{};
64}; 64};
65 65
66} // namespace Control 66} // namespace Control
diff --git a/src/video_core/control/channel_state_cache.h b/src/video_core/control/channel_state_cache.h
index 5246192a8..584a0c26c 100644
--- a/src/video_core/control/channel_state_cache.h
+++ b/src/video_core/control/channel_state_cache.h
@@ -32,7 +32,7 @@ namespace VideoCommon {
32class ChannelInfo { 32class ChannelInfo {
33public: 33public:
34 ChannelInfo() = delete; 34 ChannelInfo() = delete;
35 ChannelInfo(Tegra::Control::ChannelState& state); 35 explicit ChannelInfo(Tegra::Control::ChannelState& state);
36 ChannelInfo(const ChannelInfo& state) = delete; 36 ChannelInfo(const ChannelInfo& state) = delete;
37 ChannelInfo& operator=(const ChannelInfo&) = delete; 37 ChannelInfo& operator=(const ChannelInfo&) = delete;
38 ChannelInfo(ChannelInfo&& other) = default; 38 ChannelInfo(ChannelInfo&& other) = default;
diff --git a/src/video_core/control/scheduler.cpp b/src/video_core/control/scheduler.cpp
index 733042690..f7cbe204e 100644
--- a/src/video_core/control/scheduler.cpp
+++ b/src/video_core/control/scheduler.cpp
@@ -3,6 +3,7 @@
3 3
4#include <memory> 4#include <memory>
5 5
6#include "common/assert.h"
6#include "video_core/control/channel_state.h" 7#include "video_core/control/channel_state.h"
7#include "video_core/control/scheduler.h" 8#include "video_core/control/scheduler.h"
8#include "video_core/gpu.h" 9#include "video_core/gpu.h"
@@ -13,8 +14,9 @@ Scheduler::Scheduler(GPU& gpu_) : gpu{gpu_} {}
13Scheduler::~Scheduler() = default; 14Scheduler::~Scheduler() = default;
14 15
15void Scheduler::Push(s32 channel, CommandList&& entries) { 16void Scheduler::Push(s32 channel, CommandList&& entries) {
16 std::unique_lock<std::mutex> lk(scheduling_guard); 17 std::unique_lock lk(scheduling_guard);
17 auto it = channels.find(channel); 18 auto it = channels.find(channel);
19 ASSERT(it != channels.end());
18 auto channel_state = it->second; 20 auto channel_state = it->second;
19 gpu.BindChannel(channel_state->bind_id); 21 gpu.BindChannel(channel_state->bind_id);
20 channel_state->dma_pusher->Push(std::move(entries)); 22 channel_state->dma_pusher->Push(std::move(entries));
@@ -23,7 +25,7 @@ void Scheduler::Push(s32 channel, CommandList&& entries) {
23 25
24void Scheduler::DeclareChannel(std::shared_ptr<ChannelState> new_channel) { 26void Scheduler::DeclareChannel(std::shared_ptr<ChannelState> new_channel) {
25 s32 channel = new_channel->bind_id; 27 s32 channel = new_channel->bind_id;
26 std::unique_lock<std::mutex> lk(scheduling_guard); 28 std::unique_lock lk(scheduling_guard);
27 channels.emplace(channel, new_channel); 29 channels.emplace(channel, new_channel);
28} 30}
29 31
diff --git a/src/video_core/control/scheduler.h b/src/video_core/control/scheduler.h
index 305a01e0a..44addf61c 100644
--- a/src/video_core/control/scheduler.h
+++ b/src/video_core/control/scheduler.h
@@ -19,7 +19,7 @@ struct ChannelState;
19 19
20class Scheduler { 20class Scheduler {
21public: 21public:
22 Scheduler(GPU& gpu_); 22 explicit Scheduler(GPU& gpu_);
23 ~Scheduler(); 23 ~Scheduler();
24 24
25 void Push(s32 channel, CommandList&& entries); 25 void Push(s32 channel, CommandList&& entries);