|
vdr-plugin-softhddevice-drm-gles 1.6.4-d0291bb
|
DRM Device. More...
#include <drmdevice.h>
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 | |
| cVideoRender * | m_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 | |
| drmModeCrtc * | m_drmModeCrtcSaved |
| saved CRTC infos | |
| drmEventContext | m_drmEventCtx |
| drm event context | |
| const char * | m_userDrmDevice = nullptr |
| user requested drm device | |
| 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_device * | m_pGbmDevice |
| pointer to the gbm device | |
| struct gbm_surface * | m_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 | |
DRM Device.
Definition at line 43 of file drmdevice.h.
| cDrmDevice::cDrmDevice | ( | cVideoRender * | render, |
| const char * | resolution, | ||
| const char * | device | ||
| ) |
Create a drm device.
| render | pointer to cVideoRender object |
| resolution | display resolution string set by user |
Definition at line 47 of file drmdevice.cpp.
References m_userReqDisplayHeight, m_userReqDisplayRefreshRate, and m_userReqDisplayWidth.
| cDrmDevice::~cDrmDevice | ( | void | ) |
Definition at line 55 of file drmdevice.cpp.
Definition at line 82 of file drmdevice.h.
References m_hdrMetadata.
Referenced by cVideoRender::CanHandleHdr().
Close the drm file handle.
Definition at line 949 of file drmdevice.cpp.
References L_DRM, LOGDEBUG2, and m_fdDrm.
Referenced by cVideoRender::Exit().
Definition at line 53 of file drmdevice.h.
References m_connectorId.
Referenced by cVideoRender::SetColorSpace().
| int cDrmDevice::CreateHdrBlob | ( | struct hdr_output_metadata * | data, |
| size_t | size, | ||
| uint32_t * | blobID | ||
| ) |
Definition at line 1203 of file drmdevice.cpp.
References L_DRM, LOGDEBUG2, and m_fdDrm.
Referenced by cVideoRender::SetHdrBlob().
Definition at line 1193 of file drmdevice.cpp.
References m_drmModeInfo, and m_fdDrm.
Referenced by cVideoRender::Init(), cVideoRender::RestoreColorSpace(), and cVideoRender::SetColorSpace().
Wrapper to create a property blob.
Creates a property blob for the drm mode which was found during Init()
| [out] | modeID | id of the blob |
| 0 | on success |
| -errno | on error |
Definition at line 971 of file drmdevice.cpp.
References m_drmModeInfo, and m_fdDrm.
Definition at line 58 of file drmdevice.h.
References m_crtcId.
Referenced by cVideoRender::Init(), cVideoRender::SetOsdBuffer(), cVideoRender::SetPipBuffer(), and cVideoRender::SetVideoBuffer().
Definition at line 1222 of file drmdevice.cpp.
References m_fdDrm.
Referenced by cVideoRender::SetHdrBlob().
Definition at line 1198 of file drmdevice.cpp.
References m_fdDrm.
Referenced by cVideoRender::RestoreColorSpace(), and cVideoRender::SetColorSpace().
Definition at line 56 of file drmdevice.h.
References m_drmModeInfo.
Referenced by cVideoRender::Init(), cVideoRender::SetPipBuffer(), and cVideoRender::SetVideoBuffer().
Definition at line 55 of file drmdevice.h.
References m_drmModeInfo.
Referenced by cVideoRender::Init(), cVideoRender::SetPipBuffer(), and cVideoRender::SetVideoBuffer().
|
inline |
Definition at line 71 of file drmdevice.h.
References m_eglContext.
Referenced by cVideoRender::EglContext().
|
inline |
Definition at line 70 of file drmdevice.h.
References m_eglDisplay.
Referenced by cVideoRender::EglDisplay(), cVideoRender::OsdClear(), and cVideoRender::OsdDrawARGB().
|
inline |
Definition at line 69 of file drmdevice.h.
References m_eglSurface.
Referenced by cVideoRender::EglSurface(), cVideoRender::OsdClear(), and cVideoRender::OsdDrawARGB().
Definition at line 49 of file drmdevice.h.
References m_fdDrm.
Referenced by cVideoRender::Init(), and cVideoRender::PushFrame().
|
private |
Find the CRTC_ID for the given connector.
| resources | drm resources |
| connector | drm connector |
Definition at line 926 of file drmdevice.cpp.
References FindCrtcForEncoder(), and m_fdDrm.
Referenced by Init().
|
inline |
Definition at line 73 of file drmdevice.h.
References m_pGbmSurface.
Referenced by cVideoRender::OsdClear(), and cVideoRender::OsdDrawARGB().
| cDrmBuffer * cDrmDevice::GetBufFromBo | ( | struct gbm_bo * | bo | ) |
Get a drm buffer from a gbm buffer object.
| bo | gbm buffer object |
Definition at line 813 of file drmdevice.cpp.
References drm_fb_destroy_callback(), L_DRM, LOGDEBUG2, LOGFATAL, and m_fdDrm.
Referenced by cVideoRender::OsdClear(), and cVideoRender::OsdDrawARGB().
|
private |
Get a drm property value.
| objectID | drm object ID | |
| objectType | drm object type | |
| propName | drm property name | |
| [out] | value | value for the requested property |
| 0 | value was found |
| -1 | value was not found |
Definition at line 1029 of file drmdevice.cpp.
References L_DRM, LOGDEBUG2, and m_fdDrm.
Referenced by GetVideoPlaneColorRange(), and Init().
Definition at line 1178 of file drmdevice.cpp.
References cDrmPlane::GetId(), GetPropertyValue(), and m_videoPlane.
Referenced by cVideoRender::SetHdrBlob().
Definition at line 72 of file drmdevice.h.
References m_glInitiated.
Referenced by cVideoRender::GlInitiated().
Poll for a drm event.
| 0 | if successful |
| -1 | on error |
Definition at line 1136 of file drmdevice.cpp.
References m_drmEventCtx, and m_fdDrm.
Referenced by cVideoRender::DrmHandleEvent(), and cVideoRender::PageFlip().
Definition at line 66 of file drmdevice.h.
References cDrmPlane::GetId(), and m_pipPlane.
Referenced by cVideoRender::Init().
Initiate the drm device.
| 0 | on success |
| -errno | on error |
Definition at line 219 of file drmdevice.cpp.
References cDrmPlane::FillProperties(), FindCrtcForConnector(), FindDrmConnector(), FindDrmDevice(), cDrmPlane::GetId(), GetPropertyID(), GetPropertyValue(), cDrmPlane::GetType(), cDrmPlane::GetZpos(), cDrmPlane::HasZpos(), InitEGL(), InitGbm(), L_DRM, LOGDEBUG2, LOGERROR, LOGFATAL, LOGINFO, LOGWARNING, m_connectorId, m_crtcId, m_crtcIndex, m_drmModeInfo, m_fdDrm, m_hdrMetadata, m_osdPlane, m_pipPlane, m_pRender, m_userDrmDevice, m_userReqDisplayHeight, m_userReqDisplayRefreshRate, m_userReqDisplayWidth, m_useZpos, m_videoPlane, m_zposOverlay, m_zposPip, m_zposPrimary, cVideoRender::OglOsdDisabled(), OpenDrmDevice(), plane, cDrmPlane::SetId(), cVideoRender::SetScreenSize(), cDrmPlane::SetType(), and cDrmPlane::SetZpos().
Referenced by cVideoRender::Init().
Init EGL context.
| 0 | on success |
| -1 | on error |
Definition at line 719 of file drmdevice.cpp.
References context_attribute_list, EGL_CHECK, get_platform_display, get_platform_surface, GetEGLConfig(), L_OPENGL, LOGDEBUG2, LOGERROR, LOGINFO, m_eglContext, m_eglDisplay, m_eglSurface, m_glInitiated, m_pGbmDevice, and m_pGbmSurface.
Referenced by Init().
Init the event context.
Definition at line 1144 of file drmdevice.cpp.
References m_drmEventCtx.
Referenced by cVideoRender::Init().
Init gbm device and surface.
| w | gbm surface width |
| h | gbm surface height |
| format | gbm pixel format |
| modifier | gbm buffer modifier |
| 0 | on success |
| -1 | on error |
Definition at line 632 of file drmdevice.cpp.
References LOGERROR, m_fdDrm, m_pGbmDevice, and m_pGbmSurface.
Referenced by Init().
|
inline |
Definition at line 85 of file drmdevice.h.
Referenced by cVideoRender::CommitBuffer(), cVideoRender::Init(), cVideoRender::RestoreColorSpace(), and cVideoRender::SetColorSpace().
|
inline |
Definition at line 86 of file drmdevice.h.
References m_fdDrm.
Referenced by cVideoRender::CommitBuffer(), cVideoRender::Init(), cVideoRender::RestoreColorSpace(), and cVideoRender::SetColorSpace().
|
inline |
Definition at line 87 of file drmdevice.h.
Referenced by cVideoRender::CommitBuffer(), cVideoRender::Init(), cVideoRender::RestoreColorSpace(), and cVideoRender::SetColorSpace().
Definition at line 63 of file drmdevice.h.
References m_osdPlane.
Referenced by cVideoRender::CommitBuffer(), cVideoRender::Exit(), cVideoRender::Init(), and cVideoRender::SetOsdBuffer().
Definition at line 65 of file drmdevice.h.
References m_pipPlane.
Referenced by cVideoRender::CommitBuffer(), and cVideoRender::SetPipBuffer().
Restore information of a CRTC.
Definition at line 1121 of file drmdevice.cpp.
References m_connectorId, m_drmModeCrtcSaved, and m_fdDrm.
Referenced by cVideoRender::Exit().
Save information of a CRTC.
Definition at line 1113 of file drmdevice.cpp.
References m_crtcId, m_drmModeCrtcSaved, and m_fdDrm.
Referenced by cVideoRender::Init().
| int cDrmDevice::SetConnectorColorspace | ( | drmModeAtomicReqPtr | modeReq, |
| uint32_t | id | ||
| ) |
Definition at line 1163 of file drmdevice.cpp.
References m_connectorId, and SetPropertyRequest().
Referenced by cVideoRender::RestoreColorSpace(), and cVideoRender::SetColorSpace().
| int cDrmDevice::SetConnectorCrtcId | ( | drmModeAtomicReqPtr | modeReq | ) |
Definition at line 1153 of file drmdevice.cpp.
References m_connectorId, m_crtcId, and SetPropertyRequest().
Referenced by cVideoRender::Init(), cVideoRender::RestoreColorSpace(), and cVideoRender::SetColorSpace().
Definition at line 1212 of file drmdevice.cpp.
References L_DRM, LOGDEBUG2, m_connectorId, m_fdDrm, and m_hdrMetadata.
Referenced by cVideoRender::SetHdrBlob().
| int cDrmDevice::SetConnectorHdrOutputMetadata | ( | drmModeAtomicReqPtr | modeReq, |
| uint32_t | id | ||
| ) |
Definition at line 1158 of file drmdevice.cpp.
References m_connectorId, and SetPropertyRequest().
Referenced by cVideoRender::RestoreColorSpace().
| int cDrmDevice::SetCrtcActive | ( | drmModeAtomicReqPtr | modeReq, |
| uint32_t | id | ||
| ) |
Definition at line 1188 of file drmdevice.cpp.
References m_crtcId, and SetPropertyRequest().
Referenced by cVideoRender::Init(), cVideoRender::RestoreColorSpace(), and cVideoRender::SetColorSpace().
| int cDrmDevice::SetCrtcModeId | ( | drmModeAtomicReqPtr | modeReq, |
| uint32_t | id | ||
| ) |
Definition at line 1183 of file drmdevice.cpp.
References m_crtcId, and SetPropertyRequest().
Referenced by cVideoRender::Init(), cVideoRender::RestoreColorSpace(), and cVideoRender::SetColorSpace().
|
private |
Add a drm property to an atomic modeset request.
| ModeReq | atomic request object |
| objectID | drm object id |
| objectType | drm object type |
| propName | name of the drm property to be set |
| value | the value, the drm property should get |
Definition at line 987 of file drmdevice.cpp.
References L_DRM, LOGDEBUG2, and m_fdDrm.
Referenced by SetConnectorColorspace(), SetConnectorCrtcId(), SetConnectorHdrOutputMetadata(), SetCrtcActive(), SetCrtcModeId(), SetVideoPlaneColorEncoding(), and SetVideoPlaneColorRange().
| int cDrmDevice::SetVideoPlaneColorEncoding | ( | drmModeAtomicReqPtr | modeReq, |
| uint32_t | id | ||
| ) |
Definition at line 1168 of file drmdevice.cpp.
References cDrmPlane::GetId(), m_videoPlane, and SetPropertyRequest().
Referenced by cVideoRender::RestoreColorSpace(), and cVideoRender::SetColorSpace().
| int cDrmDevice::SetVideoPlaneColorRange | ( | drmModeAtomicReqPtr | modeReq, |
| uint32_t | id | ||
| ) |
Definition at line 1173 of file drmdevice.cpp.
References cDrmPlane::GetId(), m_videoPlane, and SetPropertyRequest().
Referenced by cVideoRender::RestoreColorSpace(), and cVideoRender::SetColorSpace().
Definition at line 59 of file drmdevice.h.
References m_useZpos.
Referenced by cVideoRender::Init(), and cVideoRender::SetOsdBuffer().
Definition at line 64 of file drmdevice.h.
References m_videoPlane.
Referenced by cVideoRender::CommitBuffer(), cVideoRender::Exit(), cVideoRender::Init(), cVideoRender::SetColorSpace(), cVideoRender::SetOsdBuffer(), and cVideoRender::SetVideoBuffer().
Definition at line 60 of file drmdevice.h.
References m_zposOverlay.
Referenced by cVideoRender::Init(), and cVideoRender::SetOsdBuffer().
Definition at line 61 of file drmdevice.h.
References m_zposPrimary.
Referenced by cVideoRender::Init(), and cVideoRender::SetOsdBuffer().
|
private |
connector id
Definition at line 106 of file drmdevice.h.
Referenced by ConnectorId(), Init(), RestoreCrtc(), SetConnectorColorspace(), SetConnectorCrtcId(), SetConnectorHdrBlobProperty(), and SetConnectorHdrOutputMetadata().
|
private |
current crtc ID
Definition at line 108 of file drmdevice.h.
Referenced by CrtcId(), Init(), SaveCrtc(), SetConnectorCrtcId(), SetCrtcActive(), and SetCrtcModeId().
|
private |
|
private |
drm event context
Definition at line 112 of file drmdevice.h.
Referenced by HandleEvent(), and InitEvent().
|
private |
saved CRTC infos
Definition at line 111 of file drmdevice.h.
Referenced by RestoreCrtc(), and SaveCrtc().
|
private |
mode info
Definition at line 107 of file drmdevice.h.
Referenced by CreateModeBlob(), CreatePropertyBlob(), DisplayHeight(), DisplayWidth(), and Init().
|
private |
|
private |
EGL display.
Definition at line 138 of file drmdevice.h.
Referenced by EglDisplay(), GetEGLConfig(), and InitEGL().
|
private |
|
private |
drm file descriptor
Definition at line 105 of file drmdevice.h.
Referenced by Close(), CreateHdrBlob(), CreateModeBlob(), CreatePropertyBlob(), DestroyHdrBlob(), DestroyModeBlob(), Fd(), FindCrtcForConnector(), GetBufFromBo(), GetPropertyID(), GetPropertyValue(), HandleEvent(), Init(), InitGbm(), ModeAtomicCommit(), RestoreCrtc(), SaveCrtc(), SetConnectorHdrBlobProperty(), and SetPropertyRequest().
|
private |
true, if OpenGL/ES context is initiated
Definition at line 140 of file drmdevice.h.
Referenced by GlInitiated(), and InitEGL().
|
private |
property id of HDR_OUTPUT_METADATA
Definition at line 110 of file drmdevice.h.
Referenced by CanHandleHdr(), Init(), and SetConnectorHdrBlobProperty().
|
private |
|
private |
pointer to the gbm device
Definition at line 134 of file drmdevice.h.
|
private |
pointer to the gbm surface
Definition at line 135 of file drmdevice.h.
Referenced by GbmSurface(), InitEGL(), and InitGbm().
|
private |
the pip drm plane
Definition at line 125 of file drmdevice.h.
Referenced by HasPipPlane(), Init(), and PipPlane().
|
private |
|
private |
user requested display height
Definition at line 116 of file drmdevice.h.
Referenced by cDrmDevice(), and Init().
|
private |
user requested display refresh rate
Definition at line 117 of file drmdevice.h.
Referenced by cDrmDevice(), and Init().
|
private |
user requested display width
Definition at line 115 of file drmdevice.h.
Referenced by cDrmDevice(), and Init().
is set, if drm hardware can use zpos
Definition at line 119 of file drmdevice.h.
|
private |
the video drm plane
Definition at line 122 of file drmdevice.h.
Referenced by GetVideoPlaneColorRange(), Init(), SetVideoPlaneColorEncoding(), SetVideoPlaneColorRange(), and VideoPlane().
|
private |
zpos of overlay plane
Definition at line 120 of file drmdevice.h.
Referenced by Init(), and ZposOverlay().
|
private |
|
private |
zpos of primary plane
Definition at line 121 of file drmdevice.h.
Referenced by Init(), and ZposPrimary().