MiniGUI API Reference (MiniGUI-Threads)  v5.0.6
A mature and proven cross-platform GUI system for embedded and smart IoT devices
Data Structures | Typedefs | Functions
Functions for Linux DRM integration

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...

Data Structures

struct  _DrmSurfaceInfo
 

Typedefs

typedef struct _DrmSurfaceInfo DrmSurfaceInfo
 

Functions

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)
 

Detailed Description

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

Typedef Documentation

◆ DrmSurfaceInfo

THe struct type defines the DRM surface information.

Function Documentation

◆ 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
videoThe video handle.
handleThe handle of the DRM surface.
sizeThe size of the DRM surface in bytes.
drm_formatThe DRM pixel format.
offsetThe offset from the buffer start to the real pixel data.
widthThe width of the DRM surface.
heightThe height of the DRM surface.
pitchThe 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
videoThe video handle.
nameThe name handle of the DRM surface.
drm_formatThe DRM pixel format.
offsetThe offset from the buffer start to the real pixel data.
widthThe width of the DRM surface.
heightThe height of the DRM surface.
pitchThe 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
videoThe video handle.
prime_fdThe PRIME file descriptor.
sizeThe size of the DRM surface in bytes.
drm_formatThe DRM pixel format.
offsetThe offset from the buffer start to the real pixel data.
widthThe width of the DRM surface.
heightThe height of the DRM surface.
pitchThe 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
videoThe 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()

MG_EXPORT BOOL drmGetSurfaceInfo ( GHANDLE  video,
HDC  hdc,
DrmSurfaceInfo info 
)

This function gets the DRM surface information from specified device context.

Parameters
videoThe handle to the video.
hdcThe handle to the device context.
infoThe pointer to a DrmSurfaceInfo structure to hold the surface information.
Returns
TRUE for success, FALSE for failure.