diff options
author | Derek Foreman <derekf@osg.samsung.com> | 2017-07-12 15:27:52 -0500 |
---|---|---|
committer | Derek Foreman <derekf@osg.samsung.com> | 2017-07-13 18:07:42 -0500 |
commit | 20def4da21e9fcea3d6ab910493b529ab371e3f4 (patch) | |
tree | ac68f362180d8e1595f413ed0f0fc7f89bb70b1a /src/lib/ecore_drm2/ecore_drm2_outputs.c | |
parent | 7e0beea3f599c56dd2a99d4eaec820723cf6bda2 (diff) |
ecore_drm2: Add a query for the next vblank time
I guess this is a feature, and we're deep in freeze, but:
a) this is critical for fixing T5462 properly without any side effects.
b) ecore_drm2 is all beta api
c) this should only affect wayland users
ref T5462
Diffstat (limited to 'src/lib/ecore_drm2/ecore_drm2_outputs.c')
-rw-r--r-- | src/lib/ecore_drm2/ecore_drm2_outputs.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/lib/ecore_drm2/ecore_drm2_outputs.c b/src/lib/ecore_drm2/ecore_drm2_outputs.c index 11b3c22ae3..d2b3acb54b 100644 --- a/src/lib/ecore_drm2/ecore_drm2_outputs.c +++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c | |||
@@ -1582,3 +1582,25 @@ ecore_drm2_output_subpixel_get(const Ecore_Drm2_Output *output) | |||
1582 | EINA_SAFETY_ON_NULL_RETURN_VAL(output, 0); | 1582 | EINA_SAFETY_ON_NULL_RETURN_VAL(output, 0); |
1583 | return output->subpixel; | 1583 | return output->subpixel; |
1584 | } | 1584 | } |
1585 | |||
1586 | EAPI Eina_Bool | ||
1587 | ecore_drm2_output_blanktime_get(Ecore_Drm2_Output *output, long *sec, long *usec) | ||
1588 | { | ||
1589 | drmVBlank v; | ||
1590 | int ret; | ||
1591 | |||
1592 | EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE); | ||
1593 | EINA_SAFETY_ON_NULL_RETURN_VAL(sec, EINA_FALSE); | ||
1594 | EINA_SAFETY_ON_NULL_RETURN_VAL(usec, EINA_FALSE); | ||
1595 | |||
1596 | memset(&v, 0, sizeof(v)); | ||
1597 | v.request.type = DRM_VBLANK_RELATIVE; | ||
1598 | ret = sym_drmWaitVBlank(output->fd, &v); | ||
1599 | if (ret) return EINA_FALSE; | ||
1600 | if (v.reply.tval_sec < 0) return EINA_FALSE; | ||
1601 | if (v.reply.tval_usec < 0) return EINA_FALSE; | ||
1602 | |||
1603 | *sec = v.reply.tval_sec; | ||
1604 | *usec = v.reply.tval_usec; | ||
1605 | return EINA_TRUE; | ||
1606 | } | ||