service/nvflinger: Relocate definitions of Layer and Display to the vi service
These are more closely related to the vi service as opposed to the
intermediary nvflinger.
This also places them in their relevant subfolder, as future changes to
these will likely result in subclassing to represent various displays
and services, as they're done within the service itself on hardware.
The reasoning for prefixing the display and layer source files is to
avoid potential clashing if two files with the same name are compiled
(e.g. if 'display.cpp/.h' or 'layer.cpp/.h' is added to another service
at any point), which MSVC will actually warn against. This prevents that
case from occurring.
This also presently coverts the std::array introduced within
f45c25aaba
back to a std::vector to allow
the forward declaration of the Display type. Forward declaring a type
within a std::vector is allowed since the introduction of N4510
(http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4510.html) by
Zhihao Yuan.
master
parent
4bce08d497
commit
8d5d369b54
@ -0,0 +1,22 @@
|
||||
// Copyright 2019 yuzu emulator team
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include "core/core.h"
|
||||
#include "core/hle/kernel/readable_event.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) : id{id}, name{std::move(name)} {
|
||||
auto& kernel = Core::System::GetInstance().Kernel();
|
||||
vsync_event = Kernel::WritableEvent::CreateEventPair(kernel, Kernel::ResetType::Sticky,
|
||||
fmt::format("Display VSync Event {}", id));
|
||||
}
|
||||
|
||||
Display::~Display() = default;
|
||||
|
||||
} // namespace Service::VI
|
@ -0,0 +1,28 @@
|
||||
// Copyright 2019 yuzu emulator team
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include "core/hle/kernel/writable_event.h"
|
||||
|
||||
namespace Service::VI {
|
||||
|
||||
struct Layer;
|
||||
|
||||
struct Display {
|
||||
Display(u64 id, std::string name);
|
||||
~Display();
|
||||
|
||||
u64 id;
|
||||
std::string name;
|
||||
|
||||
std::vector<Layer> layers;
|
||||
Kernel::EventPair vsync_event;
|
||||
};
|
||||
|
||||
} // namespace Service::VI
|
@ -0,0 +1,14 @@
|
||||
// Copyright 2019 yuzu emulator team
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "core/hle/service/vi/layer/vi_layer.h"
|
||||
|
||||
namespace Service::VI {
|
||||
|
||||
Layer::Layer(u64 id, std::shared_ptr<NVFlinger::BufferQueue> queue)
|
||||
: id{id}, buffer_queue{std::move(queue)} {}
|
||||
|
||||
Layer::~Layer() = default;
|
||||
|
||||
} // namespace Service::VI
|
@ -0,0 +1,25 @@
|
||||
// Copyright 2019 yuzu emulator team
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "common/common_types.h"
|
||||
|
||||
namespace Service::NVFlinger {
|
||||
class BufferQueue;
|
||||
}
|
||||
|
||||
namespace Service::VI {
|
||||
|
||||
struct Layer {
|
||||
Layer(u64 id, std::shared_ptr<NVFlinger::BufferQueue> queue);
|
||||
~Layer();
|
||||
|
||||
u64 id;
|
||||
std::shared_ptr<NVFlinger::BufferQueue> buffer_queue;
|
||||
};
|
||||
|
||||
} // namespace Service::VI
|
Loading…
Reference in New Issue