ecore-drm2: Add API function to return default depth
Rather than hard-coding depth & bpp in the evas drm engines, we can use this function to return the default depth & bpp. @feature
This commit is contained in:
parent
5f654404d0
commit
f3c4692221
|
@ -411,6 +411,16 @@ EAPI Eina_Bool ecore_drm2_device_vt_set(Ecore_Drm2_Device *device, int vt);
|
||||||
*/
|
*/
|
||||||
EAPI Eina_Bool ecore_drm2_device_prefer_shadow(Ecore_Drm2_Device *device);
|
EAPI Eina_Bool ecore_drm2_device_prefer_shadow(Ecore_Drm2_Device *device);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the default depth & bpp from a given device
|
||||||
|
*
|
||||||
|
* @param device
|
||||||
|
*
|
||||||
|
* @ingroup Ecore_Drm2_Device_Group
|
||||||
|
* @since 1.25
|
||||||
|
*/
|
||||||
|
EAPI void ecore_drm2_device_preferred_depth_get(Ecore_Drm2_Device *device, int *depth, int *bpp);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @defgroup Ecore_Drm2_Output_Group Drm output functions
|
* @defgroup Ecore_Drm2_Output_Group Drm output functions
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
#include "ecore_drm2_private.h"
|
#include "ecore_drm2_private.h"
|
||||||
|
|
||||||
|
#ifndef DRM_CAP_DUMB_PREFERRED_DEPTH
|
||||||
|
# define DRM_CAP_DUMB_PREFERRED_DEPTH 0x3
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef DRM_CAP_DUMB_PREFER_SHADOW
|
#ifndef DRM_CAP_DUMB_PREFER_SHADOW
|
||||||
# define DRM_CAP_DUMB_PREFER_SHADOW 0x4
|
# define DRM_CAP_DUMB_PREFER_SHADOW 0x4
|
||||||
#endif
|
#endif
|
||||||
|
@ -883,6 +887,22 @@ ecore_drm2_device_prefer_shadow(Ecore_Drm2_Device *device)
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
ecore_drm2_device_preferred_depth_get(Ecore_Drm2_Device *device, int *depth, int *bpp)
|
||||||
|
{
|
||||||
|
uint64_t caps;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN(device);
|
||||||
|
|
||||||
|
ret = sym_drmGetCap(device->fd, DRM_CAP_DUMB_PREFERRED_DEPTH, &caps);
|
||||||
|
if (ret == 0)
|
||||||
|
{
|
||||||
|
if (depth) *depth = caps;
|
||||||
|
if (bpp) *bpp = caps;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
EAPI int
|
EAPI int
|
||||||
ecore_drm2_device_fd_get(Ecore_Drm2_Device *device)
|
ecore_drm2_device_fd_get(Ecore_Drm2_Device *device)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue