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

DRM Display Interface. More...

Classes

struct  sDrmMode
 Holds possible display configurations. More...
 
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_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

static int get_resources (int fd, drmModeRes **resources)
 
static int OpenDrmDevice (const char *device, drmModeRes **resources)
 Open the given device.
 
static int FindDrmDevice (drmModeRes **resources)
 Find and open a suitable device with the wanted capabilities.
 
static bool Contains (drmModeModeInfo *mode, std::vector< sDrmMode > modes)
 Test, if the given mode is included in the given array.
 
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.
 
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)
 
drmModeConnectorcDrmDevice::FindDrmConnector (int, drmModeRes *, const char *)
 Find a suitable connector, preferably a connected one.
 
EGLConfig cDrmDevice::GetEGLConfig (void)
 Get a suitable EGLConfig.
 

Variables

static const EGLint context_attribute_list []
 
constexpr std::array DrmModeWhitelist
 Whitelist of possible drm modes.
 
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.

Enumeration Type Documentation

◆ hdrMetadataEotf

Enumerator
EOTF_TRADITIONAL_GAMMA_SDR 
EOTF_TRADITIONAL_GAMMA_HDR 
EOTF_ST2084 
EOTF_HLG 

Definition at line 28 of file drmhdr.cpp.

◆ metadataId

Enumerator
METADATA_TYPE1 

Definition at line 36 of file drmhdr.cpp.

Function Documentation

◆ 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().

◆ Contains()

static bool Contains ( drmModeModeInfo mode,
std::vector< sDrmMode modes 
)
static

Test, if the given mode is included in the given array.

Only width, height, refresh rate and the interlaced flag is tested. Other flags and values are ignored.

Parameters
modemode info of the mode
modesmode array to search in
Return values
trueif the mode is included
falseif the mode is not included

Definition at line 301 of file drmdevice.cpp.

References AlmostEqual(), GetRefreshRateHz(), and InterlacedMode().

Referenced by cDrmDevice::Init().

◆ 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 994 of file drmdevice.cpp.

Referenced by cDrmDevice::GetBufFromBo().

◆ EncodeXYY()

static uint16_t EncodeXYY ( float  xyy)
inlinestatic

Definition at line 41 of file drmhdr.cpp.

Referenced by cHdrMetadata::Build().

◆ 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 1120 of file drmdevice.cpp.

Referenced by cDrmDevice::FindCrtcForConnector().

◆ FindDrmConnector()

drmModeConnector * cDrmDevice::FindDrmConnector ( int  fd,
drmModeRes resources,
const char userRequestedConnector 
)
private

Find a suitable connector, preferably a connected one.

Connector selection priority: 1) Try user requested connector (-x HDMI-A-1) 2) Try suitable connected connector 3) Try suitable unconnected connector

Definition at line 216 of file drmdevice.cpp.

References ConnectorName(), and LOGWARNING.

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 153 of file drmdevice.cpp.

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

Referenced by cDrmDevice::Init().

◆ get_resources()

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

Definition at line 80 of file drmdevice.cpp.

References LOGERROR.

Referenced by FindDrmDevice(), and OpenDrmDevice().

◆ GetEGLConfig()

EGLConfig cDrmDevice::GetEGLConfig ( void  )
private

Get a suitable EGLConfig.

Definition at line 881 of file drmdevice.cpp.

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

Referenced by cDrmDevice::InitEGL().

◆ OpenDrmDevice()

static int OpenDrmDevice ( const char device,
drmModeRes **  resources 
)
static

Open the given device.

Parameters
deviceNamename of the device (e.g. "/dev/dri/card0")
Return values
filehandle on success
-1if open failed

Definition at line 131 of file drmdevice.cpp.

References get_resources(), and TestCaps().

Referenced by cDrmDevice::Init().

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 870 of file drmdevice.cpp.

Referenced by cDrmDevice::InitEGL().

◆ DrmModeWhitelist

constexpr std::array DrmModeWhitelist
inlineconstexpr

Whitelist of possible drm modes.

Definition at line 46 of file drmdevice.h.

Referenced by cDrmDevice::Init().