summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2017-01-18 09:46:39 -0500
committerChris Michael <cp.michael@samsung.com>2017-01-18 09:48:01 -0500
commit639ad420aa9b4f4f95a50c65676a011657277646 (patch)
tree5bfca6eaa17947e0b23b09d7278ffd728878aae7 /src/lib
parent5f8172a58950b0f789822a0820f1e62c05cce572 (diff)
ecore-drm2: Add API to determine if a device prefers shadow buffers
Small patch to add a new API function that can be called to determine if a given drm device prefers the use of shadow buffers. This API will be used later to provide some optimizations on various platforms. NB: Requested by Derek @feature Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/ecore_drm2/Ecore_Drm2.h12
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_device.c20
2 files changed, 32 insertions, 0 deletions
diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h
index 2b87981da5..89263145e9 100644
--- a/src/lib/ecore_drm2/Ecore_Drm2.h
+++ b/src/lib/ecore_drm2/Ecore_Drm2.h
@@ -345,6 +345,18 @@ EAPI void ecore_drm2_device_calibrate(Ecore_Drm2_Device *device, int w, int h);
345EAPI Eina_Bool ecore_drm2_device_vt_set(Ecore_Drm2_Device *device, int vt); 345EAPI Eina_Bool ecore_drm2_device_vt_set(Ecore_Drm2_Device *device, int vt);
346 346
347/** 347/**
348 * Get if a given device prefers the use of shadow buffers
349 *
350 * @param device
351 *
352 * @return EINA_TRUE if preferred, EINA_FALSE otherwise
353 *
354 * @ingroup Ecore_Drm2_Device_Group
355 * @since 1.19
356 */
357EAPI Eina_Bool ecore_drm2_device_prefer_shadow(Ecore_Drm2_Device *device);
358
359/**
348 * @defgroup Ecore_Drm2_Output_Group Drm output functions 360 * @defgroup Ecore_Drm2_Output_Group Drm output functions
349 * 361 *
350 * Functions that deal with setup of outputs 362 * 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 10294af626..a6e6d22cb2 100644
--- a/src/lib/ecore_drm2/ecore_drm2_device.c
+++ b/src/lib/ecore_drm2/ecore_drm2_device.c
@@ -8,6 +8,10 @@
8# define DRM_CAP_CURSOR_HEIGHT 0x9 8# define DRM_CAP_CURSOR_HEIGHT 0x9
9#endif 9#endif
10 10
11#ifndef DRM_CAP_DUMB_PREFER_SHADOW
12# define DRM_CAP_DUMB_PREFER_SHADOW 0x4
13#endif
14
11#ifdef HAVE_ATOMIC_DRM 15#ifdef HAVE_ATOMIC_DRM
12# include <sys/utsname.h> 16# include <sys/utsname.h>
13#endif 17#endif
@@ -816,3 +820,19 @@ ecore_drm2_device_vt_set(Ecore_Drm2_Device *device, int vt)
816 820
817 return elput_manager_vt_set(device->em, vt); 821 return elput_manager_vt_set(device->em, vt);
818} 822}
823
824EAPI Eina_Bool
825ecore_drm2_device_prefer_shadow(Ecore_Drm2_Device *device)
826{
827 uint64_t caps;
828 int ret;
829
830 EINA_SAFETY_ON_NULL_RETURN_VAL(device, EINA_FALSE);
831 EINA_SAFETY_ON_TRUE_RETURN_VAL((device->fd < 0), EINA_FALSE);
832
833 ret = sym_drmGetCap(device->fd, DRM_CAP_DUMB_PREFER_SHADOW, &caps);
834 if ((ret == 0) && (caps == 1))
835 return EINA_TRUE;
836 else
837 return EINA_FALSE;
838}