|
|
@ -12,18 +12,21 @@
|
|
|
|
#include "core/hle/kernel/k_event.h"
|
|
|
|
#include "core/hle/kernel/k_event.h"
|
|
|
|
#include "core/hle/kernel/k_readable_event.h"
|
|
|
|
#include "core/hle/kernel/k_readable_event.h"
|
|
|
|
#include "core/hle/kernel/k_writable_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/display/vi_display.h"
|
|
|
|
#include "core/hle/service/vi/layer/vi_layer.h"
|
|
|
|
#include "core/hle/service/vi/layer/vi_layer.h"
|
|
|
|
|
|
|
|
|
|
|
|
namespace Service::VI {
|
|
|
|
namespace Service::VI {
|
|
|
|
|
|
|
|
|
|
|
|
Display::Display(u64 id, std::string name_, Core::System& system)
|
|
|
|
Display::Display(u64 id, std::string name_, KernelHelpers::ServiceContext& service_context_,
|
|
|
|
: display_id{id}, name{std::move(name_)}, vsync_event{system.Kernel()} {
|
|
|
|
Core::System& system_)
|
|
|
|
Kernel::KAutoObject::Create(std::addressof(vsync_event));
|
|
|
|
: display_id{id}, name{std::move(name_)}, service_context{service_context_} {
|
|
|
|
vsync_event.Initialize(fmt::format("Display VSync Event {}", id));
|
|
|
|
vsync_event = service_context.CreateEvent(fmt::format("Display VSync Event {}", id));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Display::~Display() = default;
|
|
|
|
Display::~Display() {
|
|
|
|
|
|
|
|
service_context.CloseEvent(vsync_event);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Layer& Display::GetLayer(std::size_t index) {
|
|
|
|
Layer& Display::GetLayer(std::size_t index) {
|
|
|
|
return *layers.at(index);
|
|
|
|
return *layers.at(index);
|
|
|
@ -34,11 +37,11 @@ const Layer& Display::GetLayer(std::size_t index) const {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Kernel::KReadableEvent& Display::GetVSyncEvent() {
|
|
|
|
Kernel::KReadableEvent& Display::GetVSyncEvent() {
|
|
|
|
return vsync_event.GetReadableEvent();
|
|
|
|
return vsync_event->GetReadableEvent();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Display::SignalVSyncEvent() {
|
|
|
|
void Display::SignalVSyncEvent() {
|
|
|
|
vsync_event.GetWritableEvent().Signal();
|
|
|
|
vsync_event->GetWritableEvent().Signal();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Display::CreateLayer(u64 layer_id, NVFlinger::BufferQueue& buffer_queue) {
|
|
|
|
void Display::CreateLayer(u64 layer_id, NVFlinger::BufferQueue& buffer_queue) {
|
|
|
|