summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2016-03-11 13:48:44 -0600
committerChris Michael <cpmichael@osg.samsung.com>2016-03-14 15:00:11 -0400
commitb5425dc51a56992f3941ede35a3ff52d63021087 (patch)
treef2e5da25ff4a2b93ca6004960cfb267f90231b8d /src/lib/ecore_drm
parentda37a41fd1cb861df56862a2e0d88e8ff4b2cb59 (diff)
ecore_drm: Disable custom tick if we can't wait for vblank
If we fail to schedule a VBlank event, then we should disable custom ticks and fallback to timer-based animators. This patch fixes some issues with Intel Atom based setups where rendering would fail when using custom animators. @fix
Diffstat (limited to 'src/lib/ecore_drm')
-rw-r--r--src/lib/ecore_drm/ecore_drm_device.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/lib/ecore_drm/ecore_drm_device.c b/src/lib/ecore_drm/ecore_drm_device.c
index 2ea9f42..62f54ec 100644
--- a/src/lib/ecore_drm/ecore_drm_device.c
+++ b/src/lib/ecore_drm/ecore_drm_device.c
@@ -36,6 +36,8 @@
36static Eina_List *drm_devices; 36static Eina_List *drm_devices;
37static int ticking = 0; 37static int ticking = 0;
38 38
39static void _ecore_drm_tick_source_set(Ecore_Drm_Device *dev);
40
39static void 41static void
40_ecore_drm_tick_schedule(Ecore_Drm_Device *dev) 42_ecore_drm_tick_schedule(Ecore_Drm_Device *dev)
41{ 43{
@@ -46,7 +48,11 @@ _ecore_drm_tick_schedule(Ecore_Drm_Device *dev)
46 vbl.request.type = (DRM_VBLANK_RELATIVE | DRM_VBLANK_EVENT); 48 vbl.request.type = (DRM_VBLANK_RELATIVE | DRM_VBLANK_EVENT);
47 vbl.request.sequence = 1; 49 vbl.request.sequence = 1;
48 vbl.request.signal = (unsigned long)dev; 50 vbl.request.signal = (unsigned long)dev;
49 drmWaitVBlank(dev->drm.fd, &vbl); 51 if (drmWaitVBlank(dev->drm.fd, &vbl) < 0)
52 {
53 WRN("Vblank failed, disabling custom ticks");
54 _ecore_drm_tick_source_set(NULL);
55 }
50} 56}
51 57
52static void 58static void
@@ -65,6 +71,13 @@ _ecore_drm_tick_end(void *data EINA_UNUSED)
65static void 71static void
66_ecore_drm_tick_source_set(Ecore_Drm_Device *dev) 72_ecore_drm_tick_source_set(Ecore_Drm_Device *dev)
67{ 73{
74 if (!dev)
75 {
76 ecore_animator_custom_source_tick_begin_callback_set(NULL, NULL);
77 ecore_animator_custom_source_tick_end_callback_set(NULL, NULL);
78 ecore_animator_source_set(ECORE_ANIMATOR_SOURCE_TIMER);
79 return;
80 }
68 ecore_animator_custom_source_tick_begin_callback_set 81 ecore_animator_custom_source_tick_begin_callback_set
69 (_ecore_drm_tick_begin, dev); 82 (_ecore_drm_tick_begin, dev);
70 ecore_animator_custom_source_tick_end_callback_set 83 ecore_animator_custom_source_tick_end_callback_set