ecore_drm2: Add API function to get preferred depth

This commit is contained in:
Christopher Michael 2022-08-23 09:17:15 -04:00
parent 94cdf5d9f2
commit aaa694e551
2 changed files with 17 additions and 0 deletions

View File

@ -40,6 +40,7 @@ EAPI int ecore_drm2_shutdown(void);
EAPI Ecore_Drm2_Device *ecore_drm2_device_open(const char *seat, unsigned int tty);
EAPI void ecore_drm2_device_close(Ecore_Drm2_Device *dev);
EAPI void ecore_drm2_device_cursor_size_get(Ecore_Drm2_Device *dev, int *width, int *height);
EAPI void ecore_drm2_device_preferred_depth_get(Ecore_Drm2_Device *dev, int *depth, int *bpp);
# endif

View File

@ -233,3 +233,19 @@ ecore_drm2_device_cursor_size_get(Ecore_Drm2_Device *dev, int *width, int *heigh
if (ret == 0) *height = caps;
}
}
EAPI void
ecore_drm2_device_preferred_depth_get(Ecore_Drm2_Device *dev, int *depth, int *bpp)
{
uint64_t caps;
int ret = -1;
EINA_SAFETY_ON_NULL_RETURN(dev);
ret = sym_drmGetCap(dev->fd, DRM_CAP_DUMB_PREFERRED_DEPTH, &caps);
if (ret == 0)
{
if (depth) *depth = caps;
if (bpp) *bpp = caps;
}
}