/**
* Get the time of the last vblank
*
- * Query the display hardware for the time of the last vblank.
+ * Query the display hardware for the time of a vblank, potentially blocking.
+ *
+ * If sequence is 0 the time of the last vblank will be immediately returned,
+ * if it's above zero that number of vblanks will pass before the function
+ * returns.
*
* @param output
+ * @param sequence
* @param sec
* @param usec
*
* @since 1.20
*/
-EAPI Eina_Bool ecore_drm2_output_blanktime_get(Ecore_Drm2_Output *output, long *sec, long *usec);
+EAPI Eina_Bool ecore_drm2_output_blanktime_get(Ecore_Drm2_Output *output, int sequence, long *sec, long *usec);
# endif
}
EAPI Eina_Bool
-ecore_drm2_output_blanktime_get(Ecore_Drm2_Output *output, long *sec, long *usec)
+ecore_drm2_output_blanktime_get(Ecore_Drm2_Output *output, int sequence, long *sec, long *usec)
{
drmVBlank v;
int ret;
memset(&v, 0, sizeof(v));
v.request.type = DRM_VBLANK_RELATIVE;
+ v.request.sequence = sequence;
ret = sym_drmWaitVBlank(output->fd, &v);
if (ret) return EINA_FALSE;
if (v.reply.tval_sec < 0) return EINA_FALSE;
long sec, usec;
edata = ee->engine.data;
- if (!ecore_drm2_output_blanktime_get(edata->output, &sec, &usec))
+ if (!ecore_drm2_output_blanktime_get(edata->output, 0, &sec, &usec))
return -1.0;
return sec + usec / 1000000.0;