25#include <xf86drmMode.h>
48 sDrmMode{ 3840, 2160, 60.00,
false },
49 sDrmMode{ 3840, 2160, 59.94,
false },
50 sDrmMode{ 3840, 2160, 50.00,
false },
51 sDrmMode{ 3840, 2160, 30.00,
false },
52 sDrmMode{ 3840, 2160, 29.97,
false },
53 sDrmMode{ 3840, 2160, 25.00,
false },
54 sDrmMode{ 3840, 2160, 24.00,
false },
55 sDrmMode{ 3840, 2160, 23.98,
false },
58 sDrmMode{ 1920, 1080, 60.00,
false },
59 sDrmMode{ 1920, 1080, 59.94,
false },
60 sDrmMode{ 1920, 1080, 50.00,
false },
61 sDrmMode{ 1920, 1080, 30.00,
false },
62 sDrmMode{ 1920, 1080, 29.97,
false },
63 sDrmMode{ 1920, 1080, 25.00,
false },
64 sDrmMode{ 1920, 1080, 24.00,
false },
65 sDrmMode{ 1920, 1080, 23.98,
false },
bool m_glInitiated
true, if OpenGL/ES context is initiated
int SetConnectorHdrOutputMetadata(drmModeAtomicReqPtr, uint32_t)
int m_userReqDisplayHeight
user requested display height
drmModeModeInfo m_drmModeInfo
mode info
const char * m_userDrmConnector
user requested drm connector
int ModeAtomicCommit(drmModeAtomicReqPtr req, uint32_t flags, void *user_data)
int InitGbm(void)
Init gbm device and surface.
cDrmBuffer * GetBufFromBo(struct gbm_bo *)
Get a drm buffer from a gbm buffer object.
EGLDisplay EglDisplay(void)
int GetPropertyValue(uint32_t, uint32_t, const char *, uint64_t *)
Get a drm property value.
void ModeAtomicFree(drmModeAtomicReqPtr req)
int SetConnectorColorspace(drmModeAtomicReqPtr, uint32_t)
int InitEGL(void)
Init EGL context.
int CreateModeBlob(uint32_t *)
int m_userReqOsdWidth
user requested osd width
int CreatePropertyBlob(uint32_t *)
Wrapper to create a property blob.
uint32_t m_hdrMetadata
property id of HDR_OUTPUT_METADATA
drmModeAtomicReqPtr ModeAtomicAlloc(void)
int GetVideoPlaneColorRange(uint64_t *)
cDrmPlane m_videoPlane
the video drm plane
int DestroyHdrBlob(uint32_t)
struct gbm_surface * m_pGbmSurface
pointer to the gbm surface
uint32_t GetPropertyID(uint32_t, uint32_t, const char *)
Get a property ID.
int FindMode(void)
Find a suitable mode from the current connector.
int SetVideoPlaneColorEncoding(drmModeAtomicReqPtr, uint32_t)
EGLSurface EglSurface(void)
EGLContext m_eglContext
EGL context.
int SetPropertyRequest(drmModeAtomicReqPtr, uint32_t, uint32_t, const char *, uint64_t)
Add a drm property to an atomic modeset request.
int SetCrtcModeId(drmModeAtomicReqPtr, uint32_t)
uint64_t DisplayHeight(void)
int32_t FindCrtcForConnector(const drmModeRes *, const drmModeConnector *)
Find the CRTC_ID for the given connector.
EGLSurface m_eglSurface
EGL surface.
int HandleEvent(void)
Poll for a drm event.
bool CanHandleMode(sDrmMode *)
Return true, if the given mode is one of the collected ones.
bool m_userReqDisplayInterlaced
user requested display interlaced mode
double m_userReqDisplayRefreshRate
user requested display refresh rate
int m_userReqDisplayWidth
user requested display width
cSoftHdConfig * m_pConfig
pointer to cSoftHdConfig object
int DestroyModeBlob(uint32_t)
cDrmPlane m_pipPlane
the pip drm plane
uint64_t DisplayWidth(void)
uint64_t ZposPrimary(void)
drmModeCrtc * m_drmModeCrtcSaved
saved CRTC infos
int CreateHdrBlob(struct hdr_output_metadata *, size_t, uint32_t *)
struct gbm_surface * GbmSurface(void)
int m_userReqOsdHeight
user requested osd height
int m_fdDrm
drm file descriptor
uint64_t ZposOverlay(void)
uint64_t m_zposPip
zpos of pip plane
std::string m_connectorName
drm connector name
int SetConnectorHdrBlobProperty(uint32_t)
cDrmPlane * PipPlane(void)
EGLDisplay m_eglDisplay
EGL display.
void SaveCrtc(void)
Save information of a CRTC.
int ReInit(void)
Re-Init the drm device with a new connector mode.
uint32_t m_connectorId
connector id
void RestoreCrtc(void)
Restore information of a CRTC.
void Close(void)
Close the drm file handle.
cDrmPlane * OsdPlane(void)
uint32_t m_crtcId
current crtc ID
int SetConnectorCrtcId(drmModeAtomicReqPtr)
EGLContext EglContext(void)
cDrmPlane * VideoPlane(void)
uint32_t ConnectorId(void)
uint32_t m_crtcIndex
current crtc index
int SetCrtcActive(drmModeAtomicReqPtr, uint32_t)
cVideoRender * m_pRender
pointer to cVideoRender object
int Init(void)
Initiate the drm device.
uint64_t m_zposPrimary
zpos of primary plane
drmEventContext m_drmEventCtx
drm event context
bool m_useZpos
is set, if drm hardware can use zpos
struct gbm_device * m_pGbmDevice
pointer to the gbm device
cDrmPlane m_osdPlane
the osd drm plane
int SetVideoPlaneColorRange(drmModeAtomicReqPtr, uint32_t)
void InitEvent(void)
Init the event context.
const char * m_userDrmDevice
user requested drm device
uint64_t m_zposOverlay
zpos of overlay plane
Plugin Configuration Header File.
constexpr std::array DrmModeWhitelist
Whitelist of possible drm modes.
drmModeConnector * FindDrmConnector(int, drmModeRes *, const char *)
Find a suitable connector, preferably a connected one.
EGLConfig GetEGLConfig(void)
Get a suitable EGLConfig.
Holds possible display configurations.