summaryrefslogtreecommitdiffstats
path: root/src/video_core/control
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2022-09-01 05:45:22 +0200
committerFernando Sahmkow <fsahmkow27@gmail.com>2022-10-06 21:00:54 +0200
commitca3db0d7c94a20668781830ff852dbf512598efb (patch)
treeedd20d669000e980169db27a896adc09078ceeaa /src/video_core/control
parentstate_tracker: workaround channel setup for homebrew (diff)
downloadyuzu-ca3db0d7c94a20668781830ff852dbf512598efb.tar
yuzu-ca3db0d7c94a20668781830ff852dbf512598efb.tar.gz
yuzu-ca3db0d7c94a20668781830ff852dbf512598efb.tar.bz2
yuzu-ca3db0d7c94a20668781830ff852dbf512598efb.tar.lz
yuzu-ca3db0d7c94a20668781830ff852dbf512598efb.tar.xz
yuzu-ca3db0d7c94a20668781830ff852dbf512598efb.tar.zst
yuzu-ca3db0d7c94a20668781830ff852dbf512598efb.zip
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 @@
namespace Tegra::Control {
-ChannelState::ChannelState(s32 bind_id_) {
- bind_id = bind_id_;
- initiated = false;
-}
+ChannelState::ChannelState(s32 bind_id_) : bind_id{bind_id_}, initialized{} {}
void ChannelState::Init(Core::System& system, GPU& gpu) {
ASSERT(memory_manager);
@@ -27,7 +24,7 @@ void ChannelState::Init(Core::System& system, GPU& gpu) {
kepler_compute = std::make_unique<Engines::KeplerCompute>(system, *memory_manager);
maxwell_dma = std::make_unique<Engines::MaxwellDMA>(system, *memory_manager);
kepler_memory = std::make_unique<Engines::KeplerMemory>(system, *memory_manager);
- initiated = true;
+ initialized = true;
}
void 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;
namespace Control {
struct ChannelState {
- ChannelState(s32 bind_id);
+ explicit ChannelState(s32 bind_id);
ChannelState(const ChannelState& state) = delete;
ChannelState& operator=(const ChannelState&) = delete;
ChannelState(ChannelState&& other) noexcept = default;
@@ -60,7 +60,7 @@ struct ChannelState {
std::unique_ptr<DmaPusher> dma_pusher;
- bool initiated{};
+ bool initialized{};
};
} // 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 {
class ChannelInfo {
public:
ChannelInfo() = delete;
- ChannelInfo(Tegra::Control::ChannelState& state);
+ explicit ChannelInfo(Tegra::Control::ChannelState& state);
ChannelInfo(const ChannelInfo& state) = delete;
ChannelInfo& operator=(const ChannelInfo&) = delete;
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 @@
#include <memory>
+#include "common/assert.h"
#include "video_core/control/channel_state.h"
#include "video_core/control/scheduler.h"
#include "video_core/gpu.h"
@@ -13,8 +14,9 @@ Scheduler::Scheduler(GPU& gpu_) : gpu{gpu_} {}
Scheduler::~Scheduler() = default;
void Scheduler::Push(s32 channel, CommandList&& entries) {
- std::unique_lock<std::mutex> lk(scheduling_guard);
+ std::unique_lock lk(scheduling_guard);
auto it = channels.find(channel);
+ ASSERT(it != channels.end());
auto channel_state = it->second;
gpu.BindChannel(channel_state->bind_id);
channel_state->dma_pusher->Push(std::move(entries));
@@ -23,7 +25,7 @@ void Scheduler::Push(s32 channel, CommandList&& entries) {
void Scheduler::DeclareChannel(std::shared_ptr<ChannelState> new_channel) {
s32 channel = new_channel->bind_id;
- std::unique_lock<std::mutex> lk(scheduling_guard);
+ std::unique_lock lk(scheduling_guard);
channels.emplace(channel, new_channel);
}
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;
class Scheduler {
public:
- Scheduler(GPU& gpu_);
+ explicit Scheduler(GPU& gpu_);
~Scheduler();
void Push(s32 channel, CommandList&& entries);