summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm2
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2017-09-05 12:08:02 -0500
committerDerek Foreman <derekf@osg.samsung.com>2017-09-05 12:12:30 -0500
commit1848f9a8e60903424e0ad9ded7630dc092a44984 (patch)
tree188bfe334d85716d24c9424928428b103404ed21 /src/lib/ecore_drm2
parente1738c4f1eec731715cb60906ee6caa443f9165f (diff)
ecore_drm2: Better handling of blank time checks
On some systems we'll successfully complete the vblank ioctl but get a reply of 0. When that happens we can't use that time for ticking as it will break all of the entire world. Fixes immediate screen blank on rpi3. @ref T5977
Diffstat (limited to 'src/lib/ecore_drm2')
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_outputs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/ecore_drm2/ecore_drm2_outputs.c b/src/lib/ecore_drm2/ecore_drm2_outputs.c
index 1f52953ffb..e64f8f03c9 100644
--- a/src/lib/ecore_drm2/ecore_drm2_outputs.c
+++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c
@@ -1596,6 +1596,7 @@ ecore_drm2_output_blanktime_get(Ecore_Drm2_Output *output, int sequence, long *s
1596{ 1596{
1597 drmVBlank v; 1597 drmVBlank v;
1598 int ret; 1598 int ret;
1599 Eina_Bool success;
1599 1600
1600 EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE); 1601 EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE);
1601 EINA_SAFETY_ON_NULL_RETURN_VAL(sec, EINA_FALSE); 1602 EINA_SAFETY_ON_NULL_RETURN_VAL(sec, EINA_FALSE);
@@ -1605,14 +1606,13 @@ ecore_drm2_output_blanktime_get(Ecore_Drm2_Output *output, int sequence, long *s
1605 v.request.type = DRM_VBLANK_RELATIVE; 1606 v.request.type = DRM_VBLANK_RELATIVE;
1606 v.request.sequence = sequence; 1607 v.request.sequence = sequence;
1607 ret = sym_drmWaitVBlank(output->fd, &v); 1608 ret = sym_drmWaitVBlank(output->fd, &v);
1608 if (ret) 1609 success = (ret == 0) && (v.reply.tval_sec > 0 || v.reply.tval_usec > 0);
1610 if (!success)
1609 { 1611 {
1610 ret = _blanktime_fallback(output, sequence, sec, usec); 1612 ret = _blanktime_fallback(output, sequence, sec, usec);
1611 if (ret) return EINA_FALSE; 1613 if (ret) return EINA_FALSE;
1612 return EINA_TRUE; 1614 return EINA_TRUE;
1613 } 1615 }
1614 if (v.reply.tval_sec < 0) return EINA_FALSE;
1615 if (v.reply.tval_usec < 0) return EINA_FALSE;
1616 1616
1617 *sec = v.reply.tval_sec; 1617 *sec = v.reply.tval_sec;
1618 *usec = v.reply.tval_usec; 1618 *usec = v.reply.tval_usec;