From ead88ff2ad67d5cef94b7095baba65a730659d07 Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Wed, 22 May 2019 07:35:45 -0400 Subject: 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 --- src/lib/ecore_drm2/ecore_drm2_device.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/lib/ecore_drm2/ecore_drm2_device.c') 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) return device->fd; } +EAPI Eina_Bool +ecore_drm2_vblank_supported(Ecore_Drm2_Device *dev) +{ + drmVBlank tmp; + int ret = 0; + + EINA_SAFETY_ON_NULL_RETURN_VAL(dev, EINA_FALSE); + + memset(&tmp, 0, sizeof(drmVBlank)); + tmp.request.type = DRM_VBLANK_RELATIVE; + + ret = sym_drmWaitVBlank(dev->fd, &tmp); + + if (ret != 0) return EINA_FALSE; + return EINA_TRUE; +} + /* prevent crashing with old apps compiled against these functions */ EAPI void ecore_drm2_device_keyboard_cached_context_set(){}; EAPI void ecore_drm2_device_keyboard_cached_keymap_set(){}; -- cgit v1.2.1