vdr-plugin-softhddevice-drm-gles 1.6.2
cDrmDevice Class Reference

DRM Device. More...

#include <drmdevice.h>

Public Member Functions

 cDrmDevice (cVideoRender *, const char *)
 Create a drm device.
 
 ~cDrmDevice (void)
 
int Init (void)
 Initiate the drm device.
 
int Fd (void)
 
void Close (void)
 Close the drm file handle.
 
uint32_t ConnectorId (void)
 
uint64_t DisplayWidth (void)
 
uint64_t DisplayHeight (void)
 
uint32_t CrtcId (void)
 
int UseZpos (void)
 
uint64_t ZposOverlay (void)
 
uint64_t ZposPrimary (void)
 
cDrmPlaneOsdPlane (void)
 
cDrmPlaneVideoPlane (void)
 
cDrmPlanePipPlane (void)
 
bool HasPipPlane (void)
 
EGLSurface EglSurface (void)
 
EGLDisplay EglDisplay (void)
 
EGLContext EglContext (void)
 
int GlInitiated (void)
 
struct gbm_surfaceGbmSurface (void)
 
cDrmBufferGetBufFromBo (struct gbm_bo *)
 Get a drm buffer from a gbm buffer object.
 
void SaveCrtc (void)
 Save information of a CRTC.
 
void RestoreCrtc (void)
 Restore information of a CRTC.
 
int HandleEvent (void)
 Poll for a drm event.
 
void InitEvent (void)
 Init the event context.
 
bool CanHandleHdr (void)
 
drmModeAtomicReqPtr ModeAtomicAlloc (void)
 
int ModeAtomicCommit (drmModeAtomicReqPtr req, uint32_t flags, void *user_data)
 
void ModeAtomicFree (drmModeAtomicReqPtr req)
 
int SetConnectorCrtcId (drmModeAtomicReqPtr)
 
int SetConnectorHdrOutputMetadata (drmModeAtomicReqPtr, uint32_t)
 
int SetConnectorColorspace (drmModeAtomicReqPtr, uint32_t)
 
int SetVideoPlaneColorEncoding (drmModeAtomicReqPtr, uint32_t)
 
int SetVideoPlaneColorRange (drmModeAtomicReqPtr, uint32_t)
 
int GetVideoPlaneColorRange (uint64_t *)
 
int SetCrtcModeId (drmModeAtomicReqPtr, uint32_t)
 
int SetCrtcActive (drmModeAtomicReqPtr, uint32_t)
 
int CreateModeBlob (uint32_t *)
 
int DestroyModeBlob (uint32_t)
 
int CreateHdrBlob (struct hdr_output_metadata *, size_t, uint32_t *)
 
int SetConnectorHdrBlobProperty (uint32_t)
 
int DestroyHdrBlob (uint32_t)
 

Private Member Functions

int CreatePropertyBlob (uint32_t *)
 Wrapper to create a property blob.
 
int GetPropertyValue (uint32_t, uint32_t, const char *, uint64_t *)
 Get a drm property value.
 
uint32_t GetPropertyID (uint32_t, uint32_t, const char *)
 Get a property ID.
 
int SetPropertyRequest (drmModeAtomicReqPtr, uint32_t, uint32_t, const char *, uint64_t)
 Add a drm property to an atomic modeset request.
 
int32_t FindCrtcForConnector (const drmModeRes *, const drmModeConnector *)
 Find the CRTC_ID for the given connector.
 
int InitEGL (void)
 Init EGL context.
 
EGLConfig GetEGLConfig (void)
 Get a suitable EGLConfig.
 
int InitGbm (int, int, uint32_t, uint64_t)
 Init gbm device and surface.
 

Private Attributes

cVideoRenderm_pRender
 pointer to cVideoRender object
 
int m_fdDrm = -1
 drm file descriptor
 
uint32_t m_connectorId
 connector id
 
drmModeModeInfo m_drmModeInfo
 mode info
 
uint32_t m_crtcId
 current crtc ID
 
uint32_t m_crtcIndex
 current crtc index
 
uint32_t m_hdrMetadata = 0
 property id of HDR_OUTPUT_METADATA
 
drmModeCrtcm_drmModeCrtcSaved
 saved CRTC infos
 
drmEventContext m_drmEventCtx
 drm event context
 
int m_userReqDisplayWidth = 0
 user requested display width
 
int m_userReqDisplayHeight
 user requested display height
 
uint32_t m_userReqDisplayRefreshRate
 user requested display refresh rate
 
bool m_useZpos = false
 is set, if drm hardware can use zpos
 
uint64_t m_zposOverlay = 0
 zpos of overlay plane
 
uint64_t m_zposPrimary = 0
 zpos of primary plane
 
cDrmPlane m_videoPlane
 the video drm plane
 
cDrmPlane m_osdPlane
 the osd drm plane
 
uint64_t m_zposPip = 0
 zpos of pip plane
 
cDrmPlane m_pipPlane
 the pip drm plane
 
struct gbm_devicem_pGbmDevice
 pointer to the gbm device
 
struct gbm_surfacem_pGbmSurface
 pointer to the gbm surface
 
EGLSurface m_eglSurface
 EGL surface.
 
EGLDisplay m_eglDisplay
 EGL display.
 
EGLContext m_eglContext
 EGL context.
 
bool m_glInitiated
 true, if OpenGL/ES context is initiated
 

Detailed Description

DRM Device.

Definition at line 41 of file drmdevice.h.

Member Function Documentation

◆ CanHandleHdr()

bool cDrmDevice::CanHandleHdr ( void  )
inline

Definition at line 80 of file drmdevice.h.

References m_hdrMetadata.

Referenced by cVideoRender::CanHandleHdr().

◆ ConnectorId()

uint32_t cDrmDevice::ConnectorId ( void  )
inline

Definition at line 51 of file drmdevice.h.

References m_connectorId.

Referenced by cVideoRender::SetColorSpace().

◆ CrtcId()

uint32_t cDrmDevice::CrtcId ( void  )
inline

◆ DisplayHeight()

uint64_t cDrmDevice::DisplayHeight ( void  )
inline

◆ DisplayWidth()

uint64_t cDrmDevice::DisplayWidth ( void  )
inline

◆ EglContext()

EGLContext cDrmDevice::EglContext ( void  )
inline

Definition at line 69 of file drmdevice.h.

References m_eglContext.

Referenced by cVideoRender::EglContext().

◆ EglDisplay()

EGLDisplay cDrmDevice::EglDisplay ( void  )
inline

Definition at line 68 of file drmdevice.h.

References m_eglDisplay.

Referenced by cVideoRender::EglDisplay(), cVideoRender::OsdClear(), and cVideoRender::OsdDrawARGB().

◆ EglSurface()

EGLSurface cDrmDevice::EglSurface ( void  )
inline

Definition at line 67 of file drmdevice.h.

References m_eglSurface.

Referenced by cVideoRender::EglSurface(), cVideoRender::OsdClear(), and cVideoRender::OsdDrawARGB().

◆ Fd()

int cDrmDevice::Fd ( void  )
inline

Definition at line 47 of file drmdevice.h.

References m_fdDrm.

Referenced by cVideoRender::Init(), and cVideoRender::PushFrame().

◆ GbmSurface()

struct gbm_surface * cDrmDevice::GbmSurface ( void  )
inline

Definition at line 71 of file drmdevice.h.

References m_pGbmSurface.

Referenced by cVideoRender::OsdClear(), and cVideoRender::OsdDrawARGB().

◆ GlInitiated()

int cDrmDevice::GlInitiated ( void  )
inline

Definition at line 70 of file drmdevice.h.

References m_glInitiated.

Referenced by cVideoRender::GlInitiated().

◆ HasPipPlane()

bool cDrmDevice::HasPipPlane ( void  )
inline

Definition at line 64 of file drmdevice.h.

References cDrmPlane::GetId(), and m_pipPlane.

Referenced by cVideoRender::Init().

◆ ModeAtomicAlloc()

drmModeAtomicReqPtr cDrmDevice::ModeAtomicAlloc ( void  )
inline

◆ ModeAtomicCommit()

int cDrmDevice::ModeAtomicCommit ( drmModeAtomicReqPtr  req,
uint32_t  flags,
void user_data 
)
inline

◆ ModeAtomicFree()

void cDrmDevice::ModeAtomicFree ( drmModeAtomicReqPtr  req)
inline

◆ OsdPlane()

cDrmPlane * cDrmDevice::OsdPlane ( void  )
inline

◆ PipPlane()

cDrmPlane * cDrmDevice::PipPlane ( void  )
inline

Definition at line 63 of file drmdevice.h.

References m_pipPlane.

Referenced by cVideoRender::CommitBuffer(), and cVideoRender::SetPipBuffer().

◆ UseZpos()

int cDrmDevice::UseZpos ( void  )
inline

Definition at line 57 of file drmdevice.h.

References m_useZpos.

Referenced by cVideoRender::Init(), and cVideoRender::SetOsdBuffer().

◆ VideoPlane()

◆ ZposOverlay()

uint64_t cDrmDevice::ZposOverlay ( void  )
inline

Definition at line 58 of file drmdevice.h.

References m_zposOverlay.

Referenced by cVideoRender::Init(), and cVideoRender::SetOsdBuffer().

◆ ZposPrimary()

uint64_t cDrmDevice::ZposPrimary ( void  )
inline

Definition at line 59 of file drmdevice.h.

References m_zposPrimary.

Referenced by cVideoRender::Init(), and cVideoRender::SetOsdBuffer().

Member Data Documentation

◆ m_connectorId

uint32_t cDrmDevice::m_connectorId
private

◆ m_crtcId

uint32_t cDrmDevice::m_crtcId
private

current crtc ID

Definition at line 106 of file drmdevice.h.

Referenced by CrtcId(), Init(), SaveCrtc(), SetConnectorCrtcId(), SetCrtcActive(), and SetCrtcModeId().

◆ m_crtcIndex

uint32_t cDrmDevice::m_crtcIndex
private

current crtc index

Definition at line 107 of file drmdevice.h.

Referenced by Init().

◆ m_drmEventCtx

drmEventContext cDrmDevice::m_drmEventCtx
private

drm event context

Definition at line 110 of file drmdevice.h.

Referenced by HandleEvent(), and InitEvent().

◆ m_drmModeCrtcSaved

drmModeCrtc* cDrmDevice::m_drmModeCrtcSaved
private

saved CRTC infos

Definition at line 109 of file drmdevice.h.

Referenced by RestoreCrtc(), and SaveCrtc().

◆ m_drmModeInfo

drmModeModeInfo cDrmDevice::m_drmModeInfo
private

mode info

Definition at line 105 of file drmdevice.h.

Referenced by CreateModeBlob(), CreatePropertyBlob(), DisplayHeight(), DisplayWidth(), and Init().

◆ m_eglContext

EGLContext cDrmDevice::m_eglContext
private

EGL context.

Definition at line 136 of file drmdevice.h.

Referenced by EglContext(), and InitEGL().

◆ m_eglDisplay

EGLDisplay cDrmDevice::m_eglDisplay
private

EGL display.

Definition at line 135 of file drmdevice.h.

Referenced by EglDisplay(), GetEGLConfig(), and InitEGL().

◆ m_eglSurface

EGLSurface cDrmDevice::m_eglSurface
private

EGL surface.

Definition at line 134 of file drmdevice.h.

Referenced by EglSurface(), and InitEGL().

◆ m_fdDrm

◆ m_glInitiated

bool cDrmDevice::m_glInitiated
private

true, if OpenGL/ES context is initiated

Definition at line 137 of file drmdevice.h.

Referenced by GlInitiated(), and InitEGL().

◆ m_hdrMetadata

uint32_t cDrmDevice::m_hdrMetadata = 0
private

property id of HDR_OUTPUT_METADATA

Definition at line 108 of file drmdevice.h.

Referenced by CanHandleHdr(), Init(), and SetConnectorHdrBlobProperty().

◆ m_osdPlane

cDrmPlane cDrmDevice::m_osdPlane
private

the osd drm plane

Definition at line 120 of file drmdevice.h.

Referenced by Init(), and OsdPlane().

◆ m_pGbmDevice

struct gbm_device* cDrmDevice::m_pGbmDevice
private

pointer to the gbm device

Definition at line 131 of file drmdevice.h.

Referenced by InitEGL(), and InitGbm().

◆ m_pGbmSurface

struct gbm_surface* cDrmDevice::m_pGbmSurface
private

pointer to the gbm surface

Definition at line 132 of file drmdevice.h.

Referenced by GbmSurface(), InitEGL(), and InitGbm().

◆ m_pipPlane

cDrmPlane cDrmDevice::m_pipPlane
private

the pip drm plane

Definition at line 122 of file drmdevice.h.

Referenced by HasPipPlane(), Init(), and PipPlane().

◆ m_pRender

cVideoRender* cDrmDevice::m_pRender
private

pointer to cVideoRender object

Definition at line 101 of file drmdevice.h.

Referenced by Init().

◆ m_userReqDisplayHeight

int cDrmDevice::m_userReqDisplayHeight
private

user requested display height

Definition at line 113 of file drmdevice.h.

Referenced by cDrmDevice(), and Init().

◆ m_userReqDisplayRefreshRate

uint32_t cDrmDevice::m_userReqDisplayRefreshRate
private

user requested display refresh rate

Definition at line 114 of file drmdevice.h.

Referenced by cDrmDevice(), and Init().

◆ m_userReqDisplayWidth

int cDrmDevice::m_userReqDisplayWidth = 0
private

user requested display width

Definition at line 112 of file drmdevice.h.

Referenced by cDrmDevice(), and Init().

◆ m_useZpos

bool cDrmDevice::m_useZpos = false
private

is set, if drm hardware can use zpos

Definition at line 116 of file drmdevice.h.

Referenced by Init(), and UseZpos().

◆ m_videoPlane

cDrmPlane cDrmDevice::m_videoPlane
private

the video drm plane

Definition at line 119 of file drmdevice.h.

Referenced by GetVideoPlaneColorRange(), Init(), SetVideoPlaneColorEncoding(), SetVideoPlaneColorRange(), and VideoPlane().

◆ m_zposOverlay

uint64_t cDrmDevice::m_zposOverlay = 0
private

zpos of overlay plane

Definition at line 117 of file drmdevice.h.

Referenced by Init(), and ZposOverlay().

◆ m_zposPip

uint64_t cDrmDevice::m_zposPip = 0
private

zpos of pip plane

Definition at line 121 of file drmdevice.h.

Referenced by Init().

◆ m_zposPrimary

uint64_t cDrmDevice::m_zposPrimary = 0
private

zpos of primary plane

Definition at line 118 of file drmdevice.h.

Referenced by Init(), and ZposPrimary().


The documentation for this class was generated from the following files: