diff options
author | bunnei <bunneidev@gmail.com> | 2021-08-26 05:59:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-26 05:59:28 +0200 |
commit | 0c8594b2251cf600afc3a89ecf1114eb3a25f700 (patch) | |
tree | d6f7d065cd8e2f00c85b9749076ef303a705c864 /src/core/hle/service/vi/display | |
parent | Merge pull request #6919 from ameerj/vk-int8-capability (diff) | |
download | yuzu-0c8594b2251cf600afc3a89ecf1114eb3a25f700.tar yuzu-0c8594b2251cf600afc3a89ecf1114eb3a25f700.tar.gz yuzu-0c8594b2251cf600afc3a89ecf1114eb3a25f700.tar.bz2 yuzu-0c8594b2251cf600afc3a89ecf1114eb3a25f700.tar.lz yuzu-0c8594b2251cf600afc3a89ecf1114eb3a25f700.tar.xz yuzu-0c8594b2251cf600afc3a89ecf1114eb3a25f700.tar.zst yuzu-0c8594b2251cf600afc3a89ecf1114eb3a25f700.zip |
Diffstat (limited to 'src/core/hle/service/vi/display')
-rw-r--r-- | src/core/hle/service/vi/display/vi_display.cpp | 17 | ||||
-rw-r--r-- | src/core/hle/service/vi/display/vi_display.h | 13 |
2 files changed, 10 insertions, 20 deletions
diff --git a/src/core/hle/service/vi/display/vi_display.cpp b/src/core/hle/service/vi/display/vi_display.cpp index b7705c02a..0dd342dbf 100644 --- a/src/core/hle/service/vi/display/vi_display.cpp +++ b/src/core/hle/service/vi/display/vi_display.cpp @@ -12,21 +12,18 @@ #include "core/hle/kernel/k_event.h" #include "core/hle/kernel/k_readable_event.h" #include "core/hle/kernel/k_writable_event.h" -#include "core/hle/service/kernel_helpers.h" #include "core/hle/service/vi/display/vi_display.h" #include "core/hle/service/vi/layer/vi_layer.h" namespace Service::VI { -Display::Display(u64 id, std::string name_, KernelHelpers::ServiceContext& service_context_, - Core::System& system_) - : display_id{id}, name{std::move(name_)}, service_context{service_context_} { - vsync_event = service_context.CreateEvent(fmt::format("Display VSync Event {}", id)); +Display::Display(u64 id, std::string name_, Core::System& system) + : display_id{id}, name{std::move(name_)}, vsync_event{system.Kernel()} { + Kernel::KAutoObject::Create(std::addressof(vsync_event)); + vsync_event.Initialize(fmt::format("Display VSync Event {}", id)); } -Display::~Display() { - service_context.CloseEvent(vsync_event); -} +Display::~Display() = default; Layer& Display::GetLayer(std::size_t index) { return *layers.at(index); @@ -37,11 +34,11 @@ const Layer& Display::GetLayer(std::size_t index) const { } Kernel::KReadableEvent& Display::GetVSyncEvent() { - return vsync_event->GetReadableEvent(); + return vsync_event.GetReadableEvent(); } void Display::SignalVSyncEvent() { - vsync_event->GetWritableEvent().Signal(); + vsync_event.GetWritableEvent().Signal(); } void Display::CreateLayer(u64 layer_id, NVFlinger::BufferQueue& buffer_queue) { diff --git a/src/core/hle/service/vi/display/vi_display.h b/src/core/hle/service/vi/display/vi_display.h index 0979fc421..166f2a4cc 100644 --- a/src/core/hle/service/vi/display/vi_display.h +++ b/src/core/hle/service/vi/display/vi_display.h @@ -18,9 +18,6 @@ class KEvent; namespace Service::NVFlinger { class BufferQueue; } -namespace Service::KernelHelpers { -class ServiceContext; -} // namespace Service::KernelHelpers namespace Service::VI { @@ -34,13 +31,10 @@ class Display { public: /// Constructs a display with a given unique ID and name. /// - /// @param id The unique ID for this display. - /// @param service_context_ The ServiceContext for the owning service. + /// @param id The unique ID for this display. /// @param name_ The name for this display. - /// @param system_ The global system instance. /// - Display(u64 id, std::string name_, KernelHelpers::ServiceContext& service_context_, - Core::System& system_); + Display(u64 id, std::string name_, Core::System& system); ~Display(); /// Gets the unique ID assigned to this display. @@ -104,10 +98,9 @@ public: private: u64 display_id; std::string name; - KernelHelpers::ServiceContext& service_context; std::vector<std::shared_ptr<Layer>> layers; - Kernel::KEvent* vsync_event{}; + Kernel::KEvent vsync_event; }; } // namespace Service::VI |