early-access version 1660
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)} {
|
||||
auto& kernel = system.Kernel();
|
||||
vsync_event = Kernel::KEvent::Create(kernel, fmt::format("Display VSync Event {}", id));
|
||||
vsync_event->Initialize();
|
||||
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() = default;
|
||||
@@ -33,12 +33,12 @@ const Layer& Display::GetLayer(std::size_t index) const {
|
||||
return *layers.at(index);
|
||||
}
|
||||
|
||||
std::shared_ptr<Kernel::KReadableEvent> Display::GetVSyncEvent() const {
|
||||
return vsync_event->GetReadableEvent();
|
||||
Kernel::KReadableEvent& Display::GetVSyncEvent() {
|
||||
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,6 +8,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "common/common_funcs.h"
|
||||
#include "common/common_types.h"
|
||||
|
||||
namespace Kernel {
|
||||
@@ -24,6 +25,9 @@ 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.
|
||||
///
|
||||
@@ -33,12 +37,6 @@ 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;
|
||||
@@ -61,7 +59,7 @@ public:
|
||||
const Layer& GetLayer(std::size_t index) const;
|
||||
|
||||
/// Gets the readable vsync event.
|
||||
std::shared_ptr<Kernel::KReadableEvent> GetVSyncEvent() const;
|
||||
Kernel::KReadableEvent& GetVSyncEvent();
|
||||
|
||||
/// Signals the internal vsync event.
|
||||
void SignalVSyncEvent();
|
||||
@@ -102,7 +100,7 @@ private:
|
||||
std::string name;
|
||||
|
||||
std::vector<std::shared_ptr<Layer>> layers;
|
||||
std::shared_ptr<Kernel::KEvent> vsync_event;
|
||||
Kernel::KEvent vsync_event;
|
||||
};
|
||||
|
||||
} // namespace Service::VI
|
||||
|
@@ -669,12 +669,10 @@ 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(buffer_queue.GetBufferWaitEvent());
|
||||
rb.PushCopyObjects(nv_flinger.FindBufferQueue(id)->GetBufferWaitEvent());
|
||||
}
|
||||
|
||||
NVFlinger::NVFlinger& nv_flinger;
|
||||
|
Reference in New Issue
Block a user