1.8
Public Member Functions | Protected Attributes | List of all members
KMSOverlay Class Reference

Screen in a KMS dumb buffer inside of an overlay plane. More...

Inheritance diagram for KMSOverlay:
Inheritance graph
[legend]

Public Member Functions

 KMSOverlay ()=delete
 
 KMSOverlay (const Size &size, PixelFormat format, WindowHint hint)
 
virtual void apply ()
 Apply any pending changes to the hardware. More...
 
virtual int gem ()
 Get the associated GEM handle for the overlay plane. More...
 
virtual uint32_t get_plane_format ()
 Get internal DRM plane format. More...
 
virtual void hide ()
 Hide the plane from the display. More...
 
virtual float hscale () const
 Get the horizontal scale value. More...
 
uint32_t index () override
 If the screen implementation manages multiple buffers, this will return the index of the current buffer. More...
 
virtual void pan_pos (const Point &point)
 Set the hardware pan position in the plane buffer. More...
 
virtual void pan_size (const Size &size)
 Set the hardware pan size. More...
 
virtual void position (const DisplayPoint &point)
 Move the hardware plane to the specified position. More...
 
void * raw ()
 Get a raw pointer to the current framebuffer. More...
 
virtual void resize (const Size &size)
 Resize the hardware plane. More...
 
virtual void rotate (uint32_t degrees)
 Rotate the hardware plane. More...
 
plane_data * s () const
 Get a pointer to the internal plane structure. More...
 
virtual void scale (float hscale, float vscale)
 Change the hardware scale of the overlay plane. More...
 
void schedule_flip () override
 Schedule a flip to occur later. More...
 
virtual void show ()
 Show the plane on the display. More...
 
virtual float vscale () const
 Get the vertical scale value. More...
 
- Public Member Functions inherited from Screen
 Screen () noexcept
 
 Screen (const Screen &)=default
 
 Screen (Screen &&) noexcept=default
 
virtual ~Screen () noexcept=default
 
void async_flip (bool async)
 Set if asynchronous buffer flips are used. More...
 
EGT_NODISCARD Rect box () const
 Bounding box for the screen. More...
 
virtual EGT_NODISCARD size_t brightness () const
 Get the current brightness of the screen. More...
 
virtual void brightness (size_t brightness)
 Set the brightness of the screen. More...
 
EGT_NODISCARD shared_cairo_t context () const
 Get the context for the screen. More...
 
virtual void flip (const DamageArray &damage)
 Perform a flip of the buffers. More...
 
EGT_NODISCARD PixelFormat format () const
 Get the format of the screen. More...
 
virtual EGT_NODISCARD bool have_planes () const
 Returns true if the screen supports planes. More...
 
virtual void high_fidelity ()
 Configure high fidelity options. More...
 
virtual EGT_NODISCARD bool is_composer () const
 Returns true if this is a screen used with the Microchip Graphic Composer. More...
 
virtual void low_fidelity ()
 Configure low fidelity options. More...
 
virtual EGT_NODISCARD size_t max_brightness () const
 Get the max brightness of the screen. More...
 
Screenoperator= (const Screen &)=default
 
Screenoperator= (Screen &&) noexcept=default
 
EGT_NODISCARD Size size () const
 Size of the screen. More...
 

Protected Attributes

uint32_t m_index {0}
 Current flip index. More...
 
unique_plane_t m_plane
 Plane instance pointer. More...
 
std::unique_ptr< FlipThread > m_pool
 Internal thread pool for flipping. More...
 
- Protected Attributes inherited from Screen
bool m_async {false}
 Perform flips asynchronously if supported. More...
 
BufferArray m_buffers
 Screen buffer array. More...
 
shared_cairo_t m_cr
 Composition surface context. More...
 
PixelFormat m_format {}
 Format of the screen. More...
 
Size m_size
 Size of the screen. More...
 
shared_cairo_surface_t m_surface
 Composition surface. More...
 

Additional Inherited Members

- Public Types inherited from Screen
using DamageArray = std::vector< Rect >
 Type used for damage arrays. More...
 
- Static Public Member Functions inherited from Screen
static void damage_algorithm (Screen::DamageArray &damage, Rect rect)
 This function implements the algorithm for adding damage rectangles to a list. More...
 
- Protected Types inherited from Screen
using BufferArray = std::vector< ScreenBuffer >
 Type used for an array of ScreenBuffer objects. More...
 
- Protected Member Functions inherited from Screen
virtual void copy_to_buffer (ScreenBuffer &buffer)
 Copy the framebuffer to the current composition buffer. More...
 
void copy_to_buffer_software (ScreenBuffer &buffer)
 Copy the framebuffer to the current composition buffer. More...
 
void init (const Size &size, PixelFormat format=PixelFormat::argb8888)
 
void init (void **ptr, uint32_t count, const Size &size, PixelFormat format=PixelFormat::argb8888)
 

Detailed Description

Screen in a KMS dumb buffer inside of an overlay plane.

This uses libplanes to modeset and configure planes.

Constructor & Destructor Documentation

◆ KMSOverlay() [1/2]

KMSOverlay ( )
delete

◆ KMSOverlay() [2/2]

KMSOverlay ( const Size size,
PixelFormat  format,
WindowHint  hint 
)
Parameters
sizeSize of the scree.
formatRequested format for the screen.
hintHint for the type of plane to create.

Member Function Documentation

◆ apply()

virtual void apply ( )
virtual

Apply any pending changes to the hardware.

◆ gem()

virtual int gem ( )
virtual

Get the associated GEM handle for the overlay plane.

◆ get_plane_format()

virtual uint32_t get_plane_format ( )
virtual

Get internal DRM plane format.

◆ hide()

virtual void hide ( )
virtual

Hide the plane from the display.

◆ hscale()

virtual float hscale ( ) const
virtual

Get the horizontal scale value.

◆ index()

uint32_t index ( )
overridevirtual

If the screen implementation manages multiple buffers, this will return the index of the current buffer.

Reimplemented from Screen.

◆ pan_pos()

virtual void pan_pos ( const Point point)
virtual

Set the hardware pan position in the plane buffer.

◆ pan_size()

virtual void pan_size ( const Size size)
virtual

Set the hardware pan size.

◆ position()

virtual void position ( const DisplayPoint point)
virtual

Move the hardware plane to the specified position.

◆ raw()

void* raw ( )

Get a raw pointer to the current framebuffer.

◆ resize()

virtual void resize ( const Size size)
virtual

Resize the hardware plane.

Warning
This is an expensive operation. This will cause a re-allocation of the plane and all buffers, destroying any existing buffers.

◆ rotate()

virtual void rotate ( uint32_t  degrees)
virtual

Rotate the hardware plane.

◆ s()

plane_data* s ( ) const
inline

Get a pointer to the internal plane structure.

◆ scale()

virtual void scale ( float  hscale,
float  vscale 
)
virtual

Change the hardware scale of the overlay plane.

Parameters
[in]hscaleHorizontal scale, with 1.0 being 100%.
[in]vscaleVertical scale, with 1.0 being 100%.

◆ schedule_flip()

void schedule_flip ( )
overridevirtual

Schedule a flip to occur later.

This is needed if a flip should occur sometime in the future to the hardware.

Implements Screen.

◆ show()

virtual void show ( )
virtual

Show the plane on the display.

◆ vscale()

virtual float vscale ( ) const
virtual

Get the vertical scale value.

Member Data Documentation

◆ m_index

uint32_t m_index {0}
protected

Current flip index.

◆ m_plane

unique_plane_t m_plane
protected

Plane instance pointer.

◆ m_pool

std::unique_ptr<FlipThread> m_pool
protected

Internal thread pool for flipping.