vdr-plugin-softhddevice-drm-gles 1.6.2
DRM Module

DRM Display Interface. More...

Classes

struct  format_plane_info
 
struct  format_info
 
class  cDrmBuffer
 DRM Buffer. More...
 
class  cDrmBufferPool
 DRM Buffer Pool. More...
 
class  cDrmDevice
 DRM Device. More...
 
struct  vector
 
struct  colorspace
 
class  cHdrMetadata
 HDR Metadata. More...
 
class  cDrmPlane
 DRM Plane. More...
 

Macros

#define ARRAY_SIZE(arr)   (sizeof(arr) / sizeof((arr)[0]))
 
#define MAX_DRM_DEVICES   64
 
#define ARRAY_LENGTH(a)   (sizeof(a) / sizeof(a)[0])
 

Enumerations

enum  hdrMetadataEotf { EOTF_TRADITIONAL_GAMMA_SDR , EOTF_TRADITIONAL_GAMMA_HDR , EOTF_ST2084 , EOTF_HLG }
 
enum  metadataId { METADATA_TYPE1 }
 

Functions

const struct format_infoFindFormat (uint32_t format)
 Find infos for the given pixel format.
 
static int get_resources (int fd, drmModeRes **resources)
 
static int TestCaps (int fd)
 Test drm capabilities.
 
static int FindDrmDevice (drmModeRes **resources)
 Find and open a suitable device with the wanted capabilities.
 
static drmModeConnectorFindDrmConnector (int fd, drmModeRes *resources)
 Find a suitable connector, preferably a connected one.
 
static void drm_fb_destroy_callback (struct gbm_bo *bo, void *data)
 Callback function to destroy a drm buffer which stays in the gbm_bo's user data.
 
 __attribute__ ((weak)) union gbm_bo_handle gbm_bo_get_handle_for_plane(struct gbm_bo *bo
 
static int32_t FindCrtcForEncoder (const drmModeRes *resources, const drmModeEncoder *encoder)
 Find the CRTC_ID for the given encoder.
 
static uint16_t EncodeXYY (float xyy)
 
static struct colorspacecolorspace_lookup (const char *name)
 
 cDrmBuffer::cDrmBuffer (void)
 Create a new drm buffer.
 
 cDrmBuffer::cDrmBuffer (cDrmBuffer *src)
 Create a new drm buffer.
 
 cDrmBuffer::cDrmBuffer (int, uint32_t, uint32_t, uint32_t, struct gbm_bo *)
 Create a new drm buffer.
 
void cDrmBuffer::Destroy (void)
 Clear and destroy the buffer object and its parameters.
 
void cDrmBuffer::Setup (int, uint32_t, uint32_t, uint32_t, AVDRMFrameDescriptor *, bool)
 Setup the buffer.
 
void cDrmBuffer::FillBlack (void)
 Color the buffer black.
 
void cDrmBuffer::PresentationFinished (void)
 The presentation of this buffer has finished.
 
cDrmBuffercDrmBufferPool::FindByDmaBufHandle (int)
 Find a drm buffer from the buffer pool by a given prime handle.
 
cDrmBuffercDrmBufferPool::FindUninitilized (void)
 Find a clean drm buffer from the buffer pool.
 
cDrmBuffercDrmBufferPool::FindNoPresentationPending (void)
 Find a dirty drm buffer from the buffer pool which presentation has finished.
 
void cDrmBufferPool::DestroyAllExcept (cDrmBuffer *)
 Destroy all drm buffers except the given one.
 
 cDrmDevice::cDrmDevice (cVideoRender *, const char *)
 Create a drm device.
 
 cDrmDevice::~cDrmDevice (void)
 
int cDrmDevice::Init (void)
 Initiate the drm device.
 
int cDrmDevice::InitGbm (int, int, uint32_t, uint64_t)
 Init gbm device and surface.
 
EGLConfig cDrmDevice::GetEGLConfig (void)
 Get a suitable EGLConfig.
 
int cDrmDevice::InitEGL (void)
 Init EGL context.
 
cDrmBuffercDrmDevice::GetBufFromBo (struct gbm_bo *)
 Get a drm buffer from a gbm buffer object.
 
int32_t cDrmDevice::FindCrtcForConnector (const drmModeRes *, const drmModeConnector *)
 Find the CRTC_ID for the given connector.
 
void cDrmDevice::Close (void)
 Close the drm file handle.
 
int cDrmDevice::CreatePropertyBlob (uint32_t *)
 Wrapper to create a property blob.
 
int cDrmDevice::SetPropertyRequest (drmModeAtomicReqPtr, uint32_t, uint32_t, const char *, uint64_t)
 Add a drm property to an atomic modeset request.
 
int cDrmDevice::GetPropertyValue (uint32_t, uint32_t, const char *, uint64_t *)
 Get a drm property value.
 
uint32_t cDrmDevice::GetPropertyID (uint32_t, uint32_t, const char *)
 Get a property ID.
 
void cDrmDevice::SaveCrtc (void)
 Save information of a CRTC.
 
void cDrmDevice::RestoreCrtc (void)
 Restore information of a CRTC.
 
int cDrmDevice::HandleEvent (void)
 Poll for a drm event.
 
void cDrmDevice::InitEvent (void)
 Init the event context.
 
int cDrmDevice::SetConnectorCrtcId (drmModeAtomicReqPtr)
 
int cDrmDevice::SetConnectorHdrOutputMetadata (drmModeAtomicReqPtr, uint32_t)
 
int cDrmDevice::SetConnectorColorspace (drmModeAtomicReqPtr, uint32_t)
 
int cDrmDevice::SetVideoPlaneColorEncoding (drmModeAtomicReqPtr, uint32_t)
 
int cDrmDevice::SetVideoPlaneColorRange (drmModeAtomicReqPtr, uint32_t)
 
int cDrmDevice::GetVideoPlaneColorRange (uint64_t *)
 
int cDrmDevice::SetCrtcModeId (drmModeAtomicReqPtr, uint32_t)
 
int cDrmDevice::SetCrtcActive (drmModeAtomicReqPtr, uint32_t)
 
int cDrmDevice::CreateModeBlob (uint32_t *)
 
int cDrmDevice::DestroyModeBlob (uint32_t)
 
int cDrmDevice::CreateHdrBlob (struct hdr_output_metadata *, size_t, uint32_t *)
 
int cDrmDevice::SetConnectorHdrBlobProperty (uint32_t)
 
int cDrmDevice::DestroyHdrBlob (uint32_t)
 
int cHdrMetadata::Build (struct hdr_output_metadata *, int, int, AVFrameSideData *, AVFrameSideData *)
 Build an HDR static metadata blob.
 
void cDrmPlane::FillProperties (int)
 Fill the plane properties.
 
void cDrmPlane::FreeProperties (void)
 Free the previously filled plane properties.
 
void cDrmPlane::SetParams (uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t)
 Caches the modesetting parameters of a plane.
 
int cDrmPlane::SetPropertyRequest (drmModeAtomicReqPtr, const char *, uint64_t)
 Add the properties to the mode setting request.
 
void cDrmPlane::SetPlaneZpos (drmModeAtomicReqPtr)
 Set the plane zpos property.
 
void cDrmPlane::SetPlane (drmModeAtomicReqPtr)
 Set all plane properties (except zpos)
 
void cDrmPlane::ClearPlane (drmModeAtomicReqPtr)
 Clear plane from drm.
 
int cDrmPlane::HasZpos (int)
 Check, if the plane is able to set the zpos property.
 
void cDrmPlane::DumpParameters (const char *)
 Dump the cached plane parameter modesetting values.
 

Variables

static const struct format_info format_info_array []
 Holds the infos of a pixel format.
 
PFNEGLGETPLATFORMDISPLAYEXTPROC get_platform_display = NULL
 
PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC get_platform_surface = NULL
 
static const EGLint context_attribute_list []
 
int plane
 
static struct colorspace bt709
 BT709 Color Space.
 
static struct colorspace bt2020
 BT2020 Color Space.
 
static struct colorspace bt470bg
 BT470bg Color Space.
 
static struct colorspace *const colorspaces []
 

Detailed Description

DRM Display Interface.

Macro Definition Documentation

◆ ARRAY_LENGTH

#define ARRAY_LENGTH (   a)    (sizeof(a) / sizeof(a)[0])

Definition at line 85 of file drmhdr.h.

◆ ARRAY_SIZE

#define ARRAY_SIZE (   arr)    (sizeof(arr) / sizeof((arr)[0]))

Definition at line 237 of file drmbuffer.cpp.

◆ MAX_DRM_DEVICES

#define MAX_DRM_DEVICES   64

Definition at line 107 of file drmdevice.cpp.

Enumeration Type Documentation

◆ hdrMetadataEotf

Enumerator
EOTF_TRADITIONAL_GAMMA_SDR 
EOTF_TRADITIONAL_GAMMA_HDR 
EOTF_ST2084 
EOTF_HLG 

Definition at line 32 of file drmhdr.cpp.

◆ metadataId

Enumerator
METADATA_TYPE1 

Definition at line 39 of file drmhdr.cpp.

Function Documentation

◆ __attribute__()

__attribute__ ( (weak )

◆ Build()

int cHdrMetadata::Build ( struct hdr_output_metadata data,
int  colorPrimaries,
int  colorTrc,
AVFrameSideData sd1,
AVFrameSideData sd2 
)

Build an HDR static metadata blob.

Parameters
[out]datablob data
[in]colorPrimariescolor primaries
[in]colorTrctransfer characteristics
[in]sd1mastering display metadata from ffmpeg frame's sidedata
[in]sd2content light metadata from ffmpeg frame's sidedata
Return values
0on success
-1on error

Definition at line 60 of file drmhdr.cpp.

References cVideoRender::CanHandleHdr(), colorspace_lookup(), EncodeXYY(), EOTF_HLG, EOTF_ST2084, EOTF_TRADITIONAL_GAMMA_SDR, vector::f, L_DRM, LOGDEBUG2, cHdrMetadata::m_clMetadata, cHdrMetadata::m_colorPrimaries, cHdrMetadata::m_colorTrc, cHdrMetadata::m_hdr10, cHdrMetadata::m_mdMetadata, cHdrMetadata::m_pRender, and METADATA_TYPE1.

Referenced by cVideoRender::SetVideoBuffer().

◆ cDrmBuffer() [1/3]

cDrmBuffer::cDrmBuffer ( cDrmBuffer src)

◆ cDrmBuffer() [2/3]

cDrmBuffer::cDrmBuffer ( int  fdDrm,
uint32_t  width,
uint32_t  height,
uint32_t  pixFmt,
struct gbm_bo bo 
)

Create a new drm buffer.

from a gbm buffer object

Parameters
fdDrmdrm file descriptor
widthbuffer width
heightbuffer height
pixFmtbuffer pixel format
bopointer to gbm buffer object

Definition at line 140 of file drmbuffer.cpp.

References cDrmBuffer::m_dirty, cDrmBuffer::m_numPlanes, cDrmBuffer::m_offset, cDrmBuffer::m_pitch, cDrmBuffer::m_planePrimeHandle, cDrmBuffer::m_pPlane, and cDrmBuffer::m_size.

◆ cDrmBuffer() [3/3]

cDrmBuffer::cDrmBuffer ( void  )

Create a new drm buffer.

as an empty buffer

Definition at line 48 of file drmbuffer.cpp.

References cDrmBuffer::m_dirty, cDrmBuffer::m_dmaBufHandle, cDrmBuffer::m_numPlanes, and cDrmBuffer::m_pPlane.

◆ cDrmDevice()

cDrmDevice::cDrmDevice ( cVideoRender render,
const char resolution 
)

Create a drm device.

Parameters
renderpointer to cVideoRender object
resolutiondisplay resolution string set by user

Definition at line 54 of file drmdevice.cpp.

References cDrmDevice::m_userReqDisplayHeight, cDrmDevice::m_userReqDisplayRefreshRate, and cDrmDevice::m_userReqDisplayWidth.

◆ ClearPlane()

void cDrmPlane::ClearPlane ( drmModeAtomicReqPtr  ModeReq)

Clear plane from drm.

Parameters
ModeReqpointer to the atomic mode request

Definition at line 170 of file drmplane.cpp.

References cDrmPlane::SetPropertyRequest().

◆ Close()

void cDrmDevice::Close ( void  )

Close the drm file handle.

Definition at line 906 of file drmdevice.cpp.

References L_DRM, LOGDEBUG2, and cDrmDevice::m_fdDrm.

Referenced by cVideoRender::Exit().

◆ colorspace_lookup()

static struct colorspace * colorspace_lookup ( const char name)
inlinestatic

Definition at line 86 of file drmhdr.h.

References ARRAY_LENGTH, colorspaces, and colorspace::name.

Referenced by cHdrMetadata::Build().

◆ CreateHdrBlob()

int cDrmDevice::CreateHdrBlob ( struct hdr_output_metadata data,
size_t  size,
uint32_t blobID 
)

Definition at line 1160 of file drmdevice.cpp.

References L_DRM, LOGDEBUG2, and cDrmDevice::m_fdDrm.

Referenced by cVideoRender::SetHdrBlob().

◆ CreateModeBlob()

int cDrmDevice::CreateModeBlob ( uint32_t modeID)

◆ CreatePropertyBlob()

int cDrmDevice::CreatePropertyBlob ( uint32_t modeID)
private

Wrapper to create a property blob.

Creates a property blob for the drm mode which was found during Init()

Parameters
[out]modeIDid of the blob
Return values
0on success
-errnoon error
Todo:
According to drm logs, this blob must be destroyed by calling drmModeDestroyPropertyBlob which is probably missing

Definition at line 928 of file drmdevice.cpp.

References cDrmDevice::m_drmModeInfo, and cDrmDevice::m_fdDrm.

◆ Destroy()

◆ DestroyAllExcept()

void cDrmBufferPool::DestroyAllExcept ( cDrmBuffer exceptBuf)

Destroy all drm buffers except the given one.

Parameters
exceptBufthe buffer, which should be kept alive if nullptr is given, all buffers are destroyed

Definition at line 473 of file drmbuffer.cpp.

References cPool< cDrmBuffer >::buffer.

Referenced by cVideoRender::ClearDecoderToDisplayQueue(), and cVideoRender::ClearPipDecoderToDisplayQueue().

◆ DestroyHdrBlob()

int cDrmDevice::DestroyHdrBlob ( uint32_t  blobID)

Definition at line 1179 of file drmdevice.cpp.

References cDrmDevice::m_fdDrm.

Referenced by cVideoRender::SetHdrBlob().

◆ DestroyModeBlob()

int cDrmDevice::DestroyModeBlob ( uint32_t  modeID)

Definition at line 1155 of file drmdevice.cpp.

References cDrmDevice::m_fdDrm.

Referenced by cVideoRender::RestoreColorSpace(), and cVideoRender::SetColorSpace().

◆ drm_fb_destroy_callback()

static void drm_fb_destroy_callback ( struct gbm_bo bo,
void data 
)
static

Callback function to destroy a drm buffer which stays in the gbm_bo's user data.

Definition at line 736 of file drmdevice.cpp.

Referenced by cDrmDevice::GetBufFromBo().

◆ DumpParameters()

◆ EncodeXYY()

static uint16_t EncodeXYY ( float  xyy)
inlinestatic

Definition at line 43 of file drmhdr.cpp.

Referenced by cHdrMetadata::Build().

◆ FillBlack()

void cDrmBuffer::FillBlack ( void  )

Color the buffer black.

Definition at line 398 of file drmbuffer.cpp.

References cDrmBuffer::m_height, cDrmBuffer::m_pPlane, and cDrmBuffer::m_width.

Referenced by cVideoRender::Init().

◆ FillProperties()

void cDrmPlane::FillProperties ( int  fd)

Fill the plane properties.

This "caches" the properties within the class

Parameters
fddrm file descriptor

Definition at line 39 of file drmplane.cpp.

References cDrmPlane::GetId(), LOGERROR, cDrmPlane::m_props, cDrmPlane::m_propsInfo, and cDrmPlane::SetProps().

Referenced by cDrmDevice::Init().

◆ FindByDmaBufHandle()

cDrmBuffer * cDrmBufferPool::FindByDmaBufHandle ( int  primeFd)

Find a drm buffer from the buffer pool by a given prime handle.

Definition at line 428 of file drmbuffer.cpp.

References cPool< cDrmBuffer >::buffer.

◆ FindCrtcForConnector()

int32_t cDrmDevice::FindCrtcForConnector ( const drmModeRes resources,
const drmModeConnector connector 
)
private

Find the CRTC_ID for the given connector.

Parameters
resourcesdrm resources
connectordrm connector
Returns
CRTC_ID

Definition at line 883 of file drmdevice.cpp.

References FindCrtcForEncoder(), and cDrmDevice::m_fdDrm.

Referenced by cDrmDevice::Init().

◆ FindCrtcForEncoder()

static int32_t FindCrtcForEncoder ( const drmModeRes resources,
const drmModeEncoder encoder 
)
static

Find the CRTC_ID for the given encoder.

Parameters
resourcesdrm resources
encoderdrm encoder
Returns
CRTC_ID

Definition at line 860 of file drmdevice.cpp.

Referenced by cDrmDevice::FindCrtcForConnector().

◆ FindDrmConnector()

static drmModeConnector * FindDrmConnector ( int  fd,
drmModeRes resources 
)
static

Find a suitable connector, preferably a connected one.

Definition at line 157 of file drmdevice.cpp.

Referenced by cDrmDevice::Init().

◆ FindDrmDevice()

static int FindDrmDevice ( drmModeRes **  resources)
static

Find and open a suitable device with the wanted capabilities.

Returns
the file descriptor of the opened device

Definition at line 113 of file drmdevice.cpp.

References get_resources(), LOGERROR, MAX_DRM_DEVICES, and TestCaps().

Referenced by cDrmDevice::Init().

◆ FindFormat()

const struct format_info * FindFormat ( uint32_t  format)

Find infos for the given pixel format.

Parameters
formatpixel format
Returns
the infos of the format as a struct

Definition at line 246 of file drmbuffer.cpp.

References ARRAY_SIZE, format_info::format, and format_info_array.

Referenced by cDrmBuffer::Setup().

◆ FindNoPresentationPending()

cDrmBuffer * cDrmBufferPool::FindNoPresentationPending ( void  )

Find a dirty drm buffer from the buffer pool which presentation has finished.

Definition at line 457 of file drmbuffer.cpp.

References cPool< cDrmBuffer >::buffer.

◆ FindUninitilized()

cDrmBuffer * cDrmBufferPool::FindUninitilized ( void  )

Find a clean drm buffer from the buffer pool.

Definition at line 441 of file drmbuffer.cpp.

References cPool< cDrmBuffer >::buffer.

◆ FreeProperties()

void cDrmPlane::FreeProperties ( void  )

Free the previously filled plane properties.

Definition at line 58 of file drmplane.cpp.

References cDrmPlane::GetProps(), cDrmPlane::GetPropsInfo(), cDrmPlane::m_props, and cDrmPlane::m_propsInfo.

◆ get_resources()

static int get_resources ( int  fd,
drmModeRes **  resources 
)
static

Definition at line 66 of file drmdevice.cpp.

References LOGERROR.

Referenced by FindDrmDevice().

◆ GetBufFromBo()

cDrmBuffer * cDrmDevice::GetBufFromBo ( struct gbm_bo bo)

Get a drm buffer from a gbm buffer object.

Parameters
bogbm buffer object
Returns
a drm buffer corresponding to the gbm buffer object

Definition at line 772 of file drmdevice.cpp.

References drm_fb_destroy_callback(), L_DRM, LOGDEBUG2, LOGFATAL, and cDrmDevice::m_fdDrm.

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

◆ GetEGLConfig()

EGLConfig cDrmDevice::GetEGLConfig ( void  )
private

Get a suitable EGLConfig.

Definition at line 625 of file drmdevice.cpp.

References EGL_CHECK, L_OPENGL, LOGDEBUG2, LOGFATAL, and cDrmDevice::m_eglDisplay.

Referenced by cDrmDevice::InitEGL().

◆ GetPropertyID()

uint32_t cDrmDevice::GetPropertyID ( uint32_t  objectID,
uint32_t  objectType,
const char propName 
)
private

Get a property ID.

Parameters
objectIDdrm object ID
objectTypedrm object type
propNamedrm property name
Returns
the value if found, 0 otherwise

Definition at line 1031 of file drmdevice.cpp.

References L_DRM, LOGDEBUG2, and cDrmDevice::m_fdDrm.

Referenced by cDrmDevice::Init().

◆ GetPropertyValue()

int cDrmDevice::GetPropertyValue ( uint32_t  objectID,
uint32_t  objectType,
const char propName,
uint64_t value 
)
private

Get a drm property value.

Parameters
objectIDdrm object ID
objectTypedrm object type
propNamedrm property name
[out]valuevalue for the requested property
Return values
0value was found
-1value was not found

Definition at line 986 of file drmdevice.cpp.

References L_DRM, LOGDEBUG2, and cDrmDevice::m_fdDrm.

Referenced by cDrmDevice::GetVideoPlaneColorRange(), and cDrmDevice::Init().

◆ GetVideoPlaneColorRange()

int cDrmDevice::GetVideoPlaneColorRange ( uint64_t value)

◆ HandleEvent()

int cDrmDevice::HandleEvent ( void  )

Poll for a drm event.

Return values
0if successful
-1on error

Definition at line 1093 of file drmdevice.cpp.

References cDrmDevice::m_drmEventCtx, and cDrmDevice::m_fdDrm.

Referenced by cVideoRender::DrmHandleEvent(), and cVideoRender::PageFlip().

◆ HasZpos()

int cDrmPlane::HasZpos ( int  fdDrm)

Check, if the plane is able to set the zpos property.

Parameters
fdDrmdrm file descriptor
Return values
1plane can use zpos
0plane can't use zpos

Definition at line 184 of file drmplane.cpp.

References L_DRM, LOGDEBUG2, LOGERROR, and cDrmPlane::SetPlaneZpos().

Referenced by cDrmDevice::Init().

◆ Init()

◆ InitEGL()

◆ InitEvent()

void cDrmDevice::InitEvent ( void  )

Init the event context.

Definition at line 1101 of file drmdevice.cpp.

References cDrmDevice::m_drmEventCtx.

Referenced by cVideoRender::Init().

◆ InitGbm()

int cDrmDevice::InitGbm ( int  w,
int  h,
uint32_t  format,
uint64_t  modifier 
)
private

Init gbm device and surface.

Parameters
wgbm surface width
hgbm surface height
formatgbm pixel format
modifiergbm buffer modifier
Return values
0on success
-1on error

Definition at line 596 of file drmdevice.cpp.

References LOGERROR, cDrmDevice::m_fdDrm, cDrmDevice::m_pGbmDevice, and cDrmDevice::m_pGbmSurface.

Referenced by cDrmDevice::Init().

◆ PresentationFinished()

void cDrmBuffer::PresentationFinished ( void  )

The presentation of this buffer has finished.

Destroys the buffer, if it not needed anymore (m_destroyAfterUse == true)

Definition at line 412 of file drmbuffer.cpp.

References cDrmBuffer::Destroy(), cDrmBuffer::frame, cDrmBuffer::m_destroyAfterUse, and cDrmBuffer::m_presentationPending.

Referenced by cVideoRender::DisplayFrame().

◆ RestoreCrtc()

void cDrmDevice::RestoreCrtc ( void  )

Restore information of a CRTC.

Definition at line 1078 of file drmdevice.cpp.

References cDrmDevice::m_connectorId, cDrmDevice::m_drmModeCrtcSaved, and cDrmDevice::m_fdDrm.

Referenced by cVideoRender::Exit().

◆ SaveCrtc()

void cDrmDevice::SaveCrtc ( void  )

Save information of a CRTC.

Definition at line 1070 of file drmdevice.cpp.

References cDrmDevice::m_crtcId, cDrmDevice::m_drmModeCrtcSaved, and cDrmDevice::m_fdDrm.

Referenced by cVideoRender::Init().

◆ SetConnectorColorspace()

int cDrmDevice::SetConnectorColorspace ( drmModeAtomicReqPtr  modeReq,
uint32_t  id 
)

◆ SetConnectorCrtcId()

◆ SetConnectorHdrBlobProperty()

int cDrmDevice::SetConnectorHdrBlobProperty ( uint32_t  blobID)

◆ SetConnectorHdrOutputMetadata()

int cDrmDevice::SetConnectorHdrOutputMetadata ( drmModeAtomicReqPtr  modeReq,
uint32_t  id 
)

◆ SetCrtcActive()

int cDrmDevice::SetCrtcActive ( drmModeAtomicReqPtr  modeReq,
uint32_t  id 
)

◆ SetCrtcModeId()

int cDrmDevice::SetCrtcModeId ( drmModeAtomicReqPtr  modeReq,
uint32_t  id 
)

◆ SetParams()

void cDrmPlane::SetParams ( uint64_t  crtcId,
uint64_t  fbId,
uint64_t  crtcX,
uint64_t  crtcY,
uint64_t  crtcW,
uint64_t  crtcH,
uint64_t  srcX,
uint64_t  srcY,
uint64_t  srcW,
uint64_t  srcH 
)

Caches the modesetting parameters of a plane.

These values are used for drm modesetting

Parameters
crtcIdMode object ID of the crtc
fbIdMode object ID of the drm framebuffer
crtcXX offset of the destination rect
crtcYY offset of the destination rect
crtcWwidth of the destination rect
crtcHheight of the destination rect
srcXX offset of the source rect
srcYY offset of the source rect
srcWwidth of the source rect
srccHheight of the source rect

Definition at line 91 of file drmplane.cpp.

References cDrmPlane::m_crtcH, cDrmPlane::m_crtcId, cDrmPlane::m_crtcW, cDrmPlane::m_crtcX, cDrmPlane::m_crtcY, cDrmPlane::m_fbId, cDrmPlane::m_srcH, cDrmPlane::m_srcW, cDrmPlane::m_srcX, and cDrmPlane::m_srcY.

◆ SetPlane()

void cDrmPlane::SetPlane ( drmModeAtomicReqPtr  ModeReq)

◆ SetPlaneZpos()

void cDrmPlane::SetPlaneZpos ( drmModeAtomicReqPtr  ModeReq)

Set the plane zpos property.

Parameters
ModeReqpointer to the atomic mode request

Definition at line 139 of file drmplane.cpp.

References cDrmPlane::GetZpos(), and cDrmPlane::SetPropertyRequest().

Referenced by cDrmPlane::HasZpos().

◆ SetPropertyRequest() [1/2]

int cDrmPlane::SetPropertyRequest ( drmModeAtomicReqPtr  ModeReq,
const char propName,
uint64_t  value 
)
private

Add the properties to the mode setting request.

Parameters
ModeReqpointer to the atomic mode request
propNamename of the property to set
valueproperty value

Definition at line 114 of file drmplane.cpp.

References cDrmPlane::GetCountProps(), cDrmPlane::GetId(), cDrmPlane::GetPropsInfoName(), cDrmPlane::GetPropsInfoPropId(), and LOGDEBUG.

Referenced by cDrmPlane::ClearPlane(), cDrmPlane::SetPlane(), and cDrmPlane::SetPlaneZpos().

◆ SetPropertyRequest() [2/2]

int cDrmDevice::SetPropertyRequest ( drmModeAtomicReqPtr  ModeReq,
uint32_t  objectID,
uint32_t  objectType,
const char propName,
uint64_t  value 
)
private

Add a drm property to an atomic modeset request.

Parameters
ModeReqatomic request object
objectIDdrm object id
objectTypedrm object type
propNamename of the drm property to be set
valuethe value, the drm property should get
Returns
negative value on errors, otherwise the number of properties in the atomic request

Definition at line 944 of file drmdevice.cpp.

References L_DRM, LOGDEBUG2, and cDrmDevice::m_fdDrm.

Referenced by cDrmDevice::SetConnectorColorspace(), cDrmDevice::SetConnectorCrtcId(), cDrmDevice::SetConnectorHdrOutputMetadata(), cDrmDevice::SetCrtcActive(), cDrmDevice::SetCrtcModeId(), cDrmDevice::SetVideoPlaneColorEncoding(), and cDrmDevice::SetVideoPlaneColorRange().

◆ Setup()

void cDrmBuffer::Setup ( int  drmDeviceFd,
uint32_t  width,
uint32_t  height,
uint32_t  pixFmt,
AVDRMFrameDescriptor primedata,
bool  closeHandleOnDestroy 
)

◆ SetVideoPlaneColorEncoding()

int cDrmDevice::SetVideoPlaneColorEncoding ( drmModeAtomicReqPtr  modeReq,
uint32_t  id 
)

◆ SetVideoPlaneColorRange()

int cDrmDevice::SetVideoPlaneColorRange ( drmModeAtomicReqPtr  modeReq,
uint32_t  id 
)

◆ TestCaps()

static int TestCaps ( int  fd)
static

Test drm capabilities.

Return values
0if all needed caps match
1on mismatch

Definition at line 82 of file drmdevice.cpp.

Referenced by FindDrmDevice().

◆ ~cDrmDevice()

cDrmDevice::~cDrmDevice ( void  )

Definition at line 61 of file drmdevice.cpp.

References L_DRM, and LOGDEBUG2.

Variable Documentation

◆ bt2020

struct colorspace bt2020
static
Initial value:
= {
.r = {{ 0.708f, 0.292f, }},
.g = {{ 0.170f, 0.797f, }},
.b = {{ 0.131f, 0.046f, }},
.whitepoint = {{ 0.3127f, 0.3290f, }},
.name = "BT.2020",
.whitepoint_name = "D65",
}

BT2020 Color Space.

Definition at line 59 of file drmhdr.h.

◆ bt470bg

struct colorspace bt470bg
static
Initial value:
= {
.r = {{ 0.640f, 0.330f, }},
.g = {{ 0.290f, 0.600f, }},
.b = {{ 0.150f, 0.060f, }},
.whitepoint = {{ 0.3127f, 0.3290f, }},
.name = "BT.470 B/G",
.whitepoint_name = "D65",
}

BT470bg Color Space.

Definition at line 72 of file drmhdr.h.

◆ bt709

struct colorspace bt709
static
Initial value:
= {
.r = {{ 0.640f, 0.330f, }},
.g = {{ 0.300f, 0.600f, }},
.b = {{ 0.150f, 0.060f, }},
.whitepoint = {{ 0.3127f, 0.3290f, }},
.name = "BT.709",
.whitepoint_name = "D65",
}

BT709 Color Space.

Definition at line 47 of file drmhdr.h.

◆ colorspaces

struct colorspace* const colorspaces[]
static
Initial value:
= {
}
static struct colorspace bt470bg
BT470bg Color Space.
Definition drmhdr.h:72
static struct colorspace bt2020
BT2020 Color Space.
Definition drmhdr.h:59
static struct colorspace bt709
BT709 Color Space.
Definition drmhdr.h:47

Definition at line 81 of file drmhdr.h.

Referenced by colorspace_lookup().

◆ context_attribute_list

const EGLint context_attribute_list[]
static
Initial value:

Definition at line 616 of file drmdevice.cpp.

Referenced by cDrmDevice::InitEGL().

◆ format_info_array

const struct format_info format_info_array[]
static
Initial value:
= {
{ DRM_FORMAT_NV12, "NV12", 2, { { 8, 1, 1 }, { 16, 2, 2 } }, },
{ DRM_FORMAT_YUV420, "YU12", 3, { { 8, 1, 1 }, { 8, 2, 2 }, {8, 2, 2 } }, },
{ DRM_FORMAT_ARGB8888, "AR24", 1, { { 32, 1, 1 } }, },
}

Holds the infos of a pixel format.

Each entry describes a format in the following matter: { uint32_t format, const char *fourcc, uint8_t num_planes, struct format_plane_info planes[4] }

The format_plane_info is: { uint8_t bitspp, uint8_t xsub, uint8_t ysub, }

Definition at line 231 of file drmbuffer.cpp.

Referenced by FindFormat().

◆ get_platform_display

PFNEGLGETPLATFORMDISPLAYEXTPROC get_platform_display = NULL

Definition at line 613 of file drmdevice.cpp.

Referenced by cDrmDevice::InitEGL().

◆ get_platform_surface

Definition at line 614 of file drmdevice.cpp.

Referenced by cDrmDevice::InitEGL().

◆ plane