From 1848f9a8e60903424e0ad9ded7630dc092a44984 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Tue, 5 Sep 2017 12:08:02 -0500 Subject: [PATCH] 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 --- src/lib/ecore_drm2/ecore_drm2_outputs.c | 6 +++--- 1 file 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 { drmVBlank v; int ret; + Eina_Bool success; EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE); 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 v.request.type = DRM_VBLANK_RELATIVE; v.request.sequence = sequence; ret = sym_drmWaitVBlank(output->fd, &v); - if (ret) + success = (ret == 0) && (v.reply.tval_sec > 0 || v.reply.tval_usec > 0); + if (!success) { ret = _blanktime_fallback(output, sequence, sec, usec); if (ret) return EINA_FALSE; return EINA_TRUE; } - if (v.reply.tval_sec < 0) return EINA_FALSE; - if (v.reply.tval_usec < 0) return EINA_FALSE; *sec = v.reply.tval_sec; *usec = v.reply.tval_usec;