summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm2
diff options
context:
space:
mode:
authorChristopher Michael <cp.michael@samsung.com>2019-05-22 07:35:45 -0400
committerChristopher Michael <cp.michael@samsung.com>2019-05-22 07:44:00 -0400
commitead88ff2ad67d5cef94b7095baba65a730659d07 (patch)
tree0cd22db9650ae3b18832274cf6bbde7d87dd2fd6 /src/lib/ecore_drm2
parent3081d9b8ea5c411fe0dd75b08a65d556103e1409 (diff)
ecore-drm2: Add API to check if vblank is supported
This patch adds a small API that we can use to check if the current video driver supports the usage of drmWaitVBlank. This check is required for certain drivers (like vbox) which do not support drmWaitVBlank and thus are causing our animators in ecore_evas to freeze. We can now use this API from within Ecore_Evas to disable vsync'd animators and fall back to timer based ones. @feature
Diffstat (limited to 'src/lib/ecore_drm2')
-rw-r--r--src/lib/ecore_drm2/Ecore_Drm2.h11
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_device.c17
2 files changed, 28 insertions, 0 deletions
diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h
index 843cfa6a2d..5c43258177 100644
--- a/src/lib/ecore_drm2/Ecore_Drm2.h
+++ b/src/lib/ecore_drm2/Ecore_Drm2.h
@@ -1196,6 +1196,17 @@ EAPI Eina_Bool ecore_drm2_output_pending_get(Ecore_Drm2_Output *output);
1196 */ 1196 */
1197EAPI Eina_Bool ecore_drm2_output_background_color_set(Ecore_Drm2_Output *output, uint64_t r, uint64_t g, uint64_t b, uint64_t a); 1197EAPI Eina_Bool ecore_drm2_output_background_color_set(Ecore_Drm2_Output *output, uint64_t r, uint64_t g, uint64_t b, uint64_t a);
1198 1198
1199/**
1200 * Check if vblank is supported by the current video driver
1201 *
1202 * @param dev
1203 *
1204 * @return EINA_TRUE if vblank is supported, EINA_FALSE otherwise
1205 *
1206 * @ingroup Ecore_Drm2_Device_Group
1207 * @since 1.23 */
1208EAPI Eina_Bool ecore_drm2_vblank_supported(Ecore_Drm2_Device *dev);
1209
1199# endif 1210# endif
1200 1211
1201#endif 1212#endif
diff --git a/src/lib/ecore_drm2/ecore_drm2_device.c b/src/lib/ecore_drm2/ecore_drm2_device.c
index b95a5a7d9e..c86df1a271 100644
--- a/src/lib/ecore_drm2/ecore_drm2_device.c
+++ b/src/lib/ecore_drm2/ecore_drm2_device.c
@@ -891,6 +891,23 @@ ecore_drm2_device_fd_get(Ecore_Drm2_Device *device)
891 return device->fd; 891 return device->fd;
892} 892}
893 893
894EAPI Eina_Bool
895ecore_drm2_vblank_supported(Ecore_Drm2_Device *dev)
896{
897 drmVBlank tmp;
898 int ret = 0;
899
900 EINA_SAFETY_ON_NULL_RETURN_VAL(dev, EINA_FALSE);
901
902 memset(&tmp, 0, sizeof(drmVBlank));
903 tmp.request.type = DRM_VBLANK_RELATIVE;
904
905 ret = sym_drmWaitVBlank(dev->fd, &tmp);
906
907 if (ret != 0) return EINA_FALSE;
908 return EINA_TRUE;
909}
910
894/* prevent crashing with old apps compiled against these functions */ 911/* prevent crashing with old apps compiled against these functions */
895EAPI void ecore_drm2_device_keyboard_cached_context_set(){}; 912EAPI void ecore_drm2_device_keyboard_cached_context_set(){};
896EAPI void ecore_drm2_device_keyboard_cached_keymap_set(){}; 913EAPI void ecore_drm2_device_keyboard_cached_keymap_set(){};