forked from enlightenment/efl
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
This commit is contained in:
parent
e1738c4f1e
commit
1848f9a8e6
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue