6#ifndef EGT_DETAIL_SCREEN_KMSSCREEN_H
7#define EGT_DETAIL_SCREEN_KMSSCREEN_H
14#include <egt/detail/meta.h>
15#include <egt/detail/screen/kmstype.h>
16#include <egt/geometry.h>
17#include <egt/screen.h>
18#include <egt/window.h>
49 explicit KMSScreen(
bool allocate_primary_plane =
true,
89 static uint32_t max_buffers();
97 void deallocate_overlay(plane_data* plane);
99 EGT_NODISCARD
bool have_planes()
const override {
return true; }
110 struct kms_device* m_device {
nullptr};
120 bool m_gfx2d {
false};
Manages one of more buffers that make up a Screen.
Definition screen.h:34
Screen in a KMS dumb buffer inside of an overlay plane.
Definition kmsoverlay.h:37
Screen in an KMS dumb buffer.
Definition kmsscreen.h:41
~KMSScreen() noexcept override
KMSScreen(bool allocate_primary_plane=true, PixelFormat format=PixelFormat::rgb565)
KMSScreen(KMSScreen &&) noexcept
EGT_NODISCARD size_t brightness() const override
Get the current brightness of the screen.
KMSScreen & operator=(const KMSScreen &)=delete
KMSScreen(const KMSScreen &)=delete
static KMSScreen * instance()
Get a pointer to the KMSScreen instance.
void close()
Close and release the screen.
void brightness(size_t brightness) override
Set the brightness of the screen.
uint32_t index() override
If the screen implementation manages multiple buffers, this will return the index of the current buff...
EGT_NODISCARD size_t max_brightness() const override
Get the max brightness of the screen.
unique_plane_t m_plane
Plane instance pointer.
Definition kmsscreen.h:112
uint32_t count_planes(plane_type type=plane_type::overlay)
Count the number of available hardware planes with a specific type.
plane_data * overlay_plane_create(const Size &size, PixelFormat format, plane_type type)
Allocate an overlay plane.
std::unique_ptr< FlipThread > m_pool
Internal thread pool for flipping.
Definition kmsscreen.h:118
void schedule_flip() override
Schedule a flip to occur later.
plane_type
Available plane types.
Definition kmsscreen.h:59
static std::vector< planeid > m_used
Global array used to keep track of allocated planes.
Definition kmsscreen.h:116
std::unique_ptr< plane_data, detail::plane_t_deleter > unique_plane_t
Unique pointer for a cairo context.
Definition kmstype.h:30
WindowHint
Hint used for configuring Window backends.
Definition widgetflags.h:683
@ overlay
Request an overlay plane.
PixelFormat
Supported pixel formats.
Definition types.h:94
EGT framework namespace.
Definition animation.h:24