These functions can be used to get the DRM device file descriptor and the information of the hardware surface corresponding to the DC which is created by the Linux DRM engine. By using the information, we can integrate MiniGUI with other graphics libraries, such as Cairo (vector graphics) and Mesa (3D graphics).
More...
|
MG_EXPORT int | drmGetDeviceFD (GHANDLE video) |
|
MG_EXPORT BOOL | drmGetSurfaceInfo (GHANDLE video, HDC hdc, DrmSurfaceInfo *info) |
|
MG_EXPORT HDC | drmCreateDCFromNameEx (GHANDLE video, uint32_t name, uint32_t drm_format, off_t offset, uint32_t width, uint32_t height, uint32_t pitch) |
|
MG_EXPORT HDC | drmCreateDCFromPrimeFdEx (GHANDLE video, int prime_fd, size_t size, uint32_t drm_format, off_t offset, uint32_t width, uint32_t height, uint32_t pitch) |
|
MG_EXPORT HDC | drmCreateDCFromHandleEx (GHANDLE video, uint32_t handle, size_t size, uint32_t drm_format, off_t offset, uint32_t width, uint32_t height, uint32_t pitch) |
|
These functions can be used to get the DRM device file descriptor and the information of the hardware surface corresponding to the DC which is created by the Linux DRM engine. By using the information, we can integrate MiniGUI with other graphics libraries, such as Cairo (vector graphics) and Mesa (3D graphics).
- Note
- Only available when support for Linuxe DRM NEWGAL engine (
_MGGAL_DRM
) is enabled.
Since 4.0.4
◆ DrmSurfaceInfo
THe struct type defines the DRM surface information.
◆ drmCreateDCFromHandleEx()
MG_EXPORT HDC drmCreateDCFromHandleEx |
( |
GHANDLE |
video, |
|
|
uint32_t |
handle, |
|
|
size_t |
size, |
|
|
uint32_t |
drm_format, |
|
|
off_t |
offset, |
|
|
uint32_t |
width, |
|
|
uint32_t |
height, |
|
|
uint32_t |
pitch |
|
) |
| |
This function creates a memory DC with a DRM surface which is created by a foreign graphics component.
- Parameters
-
video | The video handle. |
handle | The handle of the DRM surface. |
size | The size of the DRM surface in bytes. |
drm_format | The DRM pixel format. |
offset | The offset from the buffer start to the real pixel data. |
width | The width of the DRM surface. |
height | The height of the DRM surface. |
pitch | The pitch (row stride) of the DRM surface. |
- Returns
- The handle to the memory DC for success, HDC_INVALID for failure.
◆ drmCreateDCFromNameEx()
MG_EXPORT HDC drmCreateDCFromNameEx |
( |
GHANDLE |
video, |
|
|
uint32_t |
name, |
|
|
uint32_t |
drm_format, |
|
|
off_t |
offset, |
|
|
uint32_t |
width, |
|
|
uint32_t |
height, |
|
|
uint32_t |
pitch |
|
) |
| |
This function creates a memory DC with a DRM surface which is created by a foreign process and identified by a global name handle.
- Parameters
-
video | The video handle. |
name | The name handle of the DRM surface. |
drm_format | The DRM pixel format. |
offset | The offset from the buffer start to the real pixel data. |
width | The width of the DRM surface. |
height | The height of the DRM surface. |
pitch | The pitch (row stride) of the DRM surface. |
- Returns
- The handle to the memory DC for success, HDC_INVALID for failure.
◆ drmCreateDCFromPrimeFdEx()
MG_EXPORT HDC drmCreateDCFromPrimeFdEx |
( |
GHANDLE |
video, |
|
|
int |
prime_fd, |
|
|
size_t |
size, |
|
|
uint32_t |
drm_format, |
|
|
off_t |
offset, |
|
|
uint32_t |
width, |
|
|
uint32_t |
height, |
|
|
uint32_t |
pitch |
|
) |
| |
This function creates a memory DC with a DRM surface which is created by a foreign process and identified by a PRIME file descriptor.
- Parameters
-
video | The video handle. |
prime_fd | The PRIME file descriptor. |
size | The size of the DRM surface in bytes. |
drm_format | The DRM pixel format. |
offset | The offset from the buffer start to the real pixel data. |
width | The width of the DRM surface. |
height | The height of the DRM surface. |
pitch | The pitch (row stride) of the DRM surface. |
- Returns
- The handle to the memory DC for success, HDC_INVALID for failure.
◆ drmGetDeviceFD()
MG_EXPORT int drmGetDeviceFD |
( |
GHANDLE |
video | ) |
|
This function gets the file descriptor opened by the Linux DRM engine.
- Parameters
-
video | The video handle returned by GetVideoHandle. |
- Returns
- The DRM device file descriptor opened by the Linux DRM engine; >= 0 for success and < 0 on error. If surface is not a hardware surface created by the DRM engine, this function returns -1.
◆ drmGetSurfaceInfo()
This function gets the DRM surface information from specified device context.
- Parameters
-
video | The handle to the video. |
hdc | The handle to the device context. |
info | The pointer to a DrmSurfaceInfo structure to hold the surface information. |
- Returns
- TRUE for success, FALSE for failure.