early-access version 1659
This commit is contained in:
@@ -17,10 +17,10 @@
|
||||
|
||||
namespace Service::VI {
|
||||
|
||||
Display::Display(u64 id, std::string name, Core::System& system)
|
||||
: 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(u64 id, std::string name, Core::System& system) : id{id}, name{std::move(name)} {
|
||||
auto& kernel = system.Kernel();
|
||||
vsync_event = Kernel::KEvent::Create(kernel, fmt::format("Display VSync Event {}", id));
|
||||
vsync_event->Initialize();
|
||||
}
|
||||
|
||||
Display::~Display() = default;
|
||||
@@ -33,12 +33,12 @@ const Layer& Display::GetLayer(std::size_t index) const {
|
||||
return *layers.at(index);
|
||||
}
|
||||
|
||||
Kernel::KReadableEvent& Display::GetVSyncEvent() {
|
||||
return vsync_event.GetReadableEvent();
|
||||
std::shared_ptr<Kernel::KReadableEvent> Display::GetVSyncEvent() const {
|
||||
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) {
|
||||
|
@@ -8,7 +8,6 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "common/common_funcs.h"
|
||||
#include "common/common_types.h"
|
||||
|
||||
namespace Kernel {
|
||||
@@ -25,9 +24,6 @@ class Layer;
|
||||
|
||||
/// Represents a single display type
|
||||
class Display {
|
||||
YUZU_NON_COPYABLE(Display);
|
||||
YUZU_NON_MOVEABLE(Display);
|
||||
|
||||
public:
|
||||
/// Constructs a display with a given unique ID and name.
|
||||
///
|
||||
@@ -37,6 +33,12 @@ public:
|
||||
Display(u64 id, std::string name, Core::System& system);
|
||||
~Display();
|
||||
|
||||
Display(const Display&) = delete;
|
||||
Display& operator=(const Display&) = delete;
|
||||
|
||||
Display(Display&&) = default;
|
||||
Display& operator=(Display&&) = default;
|
||||
|
||||
/// Gets the unique ID assigned to this display.
|
||||
u64 GetID() const {
|
||||
return id;
|
||||
@@ -59,7 +61,7 @@ public:
|
||||
const Layer& GetLayer(std::size_t index) const;
|
||||
|
||||
/// Gets the readable vsync event.
|
||||
Kernel::KReadableEvent& GetVSyncEvent();
|
||||
std::shared_ptr<Kernel::KReadableEvent> GetVSyncEvent() const;
|
||||
|
||||
/// Signals the internal vsync event.
|
||||
void SignalVSyncEvent();
|
||||
@@ -100,7 +102,7 @@ private:
|
||||
std::string name;
|
||||
|
||||
std::vector<std::shared_ptr<Layer>> layers;
|
||||
Kernel::KEvent vsync_event;
|
||||
std::shared_ptr<Kernel::KEvent> vsync_event;
|
||||
};
|
||||
|
||||
} // namespace Service::VI
|
||||
|
@@ -669,10 +669,12 @@ private:
|
||||
|
||||
LOG_WARNING(Service_VI, "(STUBBED) called id={}, unknown={:08X}", id, unknown);
|
||||
|
||||
const auto& buffer_queue = *nv_flinger.FindBufferQueue(id);
|
||||
|
||||
// TODO(Subv): Find out what this actually is.
|
||||
IPC::ResponseBuilder rb{ctx, 2, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushCopyObjects(nv_flinger.FindBufferQueue(id)->GetBufferWaitEvent());
|
||||
rb.PushCopyObjects(buffer_queue.GetBufferWaitEvent());
|
||||
}
|
||||
|
||||
NVFlinger::NVFlinger& nv_flinger;
|
||||
|
Reference in New Issue
Block a user