summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm2
diff options
context:
space:
mode:
authorChristopher Michael <devilhorns@comcast.net>2020-05-07 11:28:05 -0400
committerChristopher Michael <devilhorns@comcast.net>2020-05-15 10:45:56 -0400
commitf3c4692221892da6e500deb66ccd6087e8857691 (patch)
treea5a00a96a07194a1bcea11d231bff85fad34c57f /src/lib/ecore_drm2
parent5f654404d01509e684c1a1998ed8bd25dd67dae9 (diff)
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
Diffstat (limited to 'src/lib/ecore_drm2')
-rw-r--r--src/lib/ecore_drm2/Ecore_Drm2.h10
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_device.c20
2 files changed, 30 insertions, 0 deletions
diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h
index 4d10e0d3a6..6e2dd1fafc 100644
--- a/src/lib/ecore_drm2/Ecore_Drm2.h
+++ b/src/lib/ecore_drm2/Ecore_Drm2.h
@@ -412,6 +412,16 @@ EAPI Eina_Bool ecore_drm2_device_vt_set(Ecore_Drm2_Device *device, int vt);
412EAPI Eina_Bool ecore_drm2_device_prefer_shadow(Ecore_Drm2_Device *device); 412EAPI Eina_Bool ecore_drm2_device_prefer_shadow(Ecore_Drm2_Device *device);
413 413
414/** 414/**
415 * Get the default depth & bpp from a given device
416 *
417 * @param device
418 *
419 * @ingroup Ecore_Drm2_Device_Group
420 * @since 1.25
421 */
422EAPI void ecore_drm2_device_preferred_depth_get(Ecore_Drm2_Device *device, int *depth, int *bpp);
423
424/**
415 * @defgroup Ecore_Drm2_Output_Group Drm output functions 425 * @defgroup Ecore_Drm2_Output_Group Drm output functions
416 * 426 *
417 * Functions that deal with setup of outputs 427 * Functions that deal with setup of outputs
diff --git a/src/lib/ecore_drm2/ecore_drm2_device.c b/src/lib/ecore_drm2/ecore_drm2_device.c
index 7602114453..77498d806e 100644
--- a/src/lib/ecore_drm2/ecore_drm2_device.c
+++ b/src/lib/ecore_drm2/ecore_drm2_device.c
@@ -1,5 +1,9 @@
1#include "ecore_drm2_private.h" 1#include "ecore_drm2_private.h"
2 2
3#ifndef DRM_CAP_DUMB_PREFERRED_DEPTH
4# define DRM_CAP_DUMB_PREFERRED_DEPTH 0x3
5#endif
6
3#ifndef DRM_CAP_DUMB_PREFER_SHADOW 7#ifndef DRM_CAP_DUMB_PREFER_SHADOW
4# define DRM_CAP_DUMB_PREFER_SHADOW 0x4 8# define DRM_CAP_DUMB_PREFER_SHADOW 0x4
5#endif 9#endif
@@ -883,6 +887,22 @@ ecore_drm2_device_prefer_shadow(Ecore_Drm2_Device *device)
883 return EINA_FALSE; 887 return EINA_FALSE;
884} 888}
885 889
890EAPI void
891ecore_drm2_device_preferred_depth_get(Ecore_Drm2_Device *device, int *depth, int *bpp)
892{
893 uint64_t caps;
894 int ret;
895
896 EINA_SAFETY_ON_NULL_RETURN(device);
897
898 ret = sym_drmGetCap(device->fd, DRM_CAP_DUMB_PREFERRED_DEPTH, &caps);
899 if (ret == 0)
900 {
901 if (depth) *depth = caps;
902 if (bpp) *bpp = caps;
903 }
904}
905
886EAPI int 906EAPI int
887ecore_drm2_device_fd_get(Ecore_Drm2_Device *device) 907ecore_drm2_device_fd_get(Ecore_Drm2_Device *device)
888{ 908{