summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm2
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2017-07-28 09:40:40 -0500
committerDerek Foreman <derekf@osg.samsung.com>2017-07-28 10:41:11 -0500
commit8e500c683549e8d3afe78657c4582560a5c75eba (patch)
tree50980e4ca653cd4b9b868eaaa2928cf33baa0721 /src/lib/ecore_drm2
parent2efa25511f04dc2cb278471aa041e0e24ffa13f0 (diff)
ecore_drm2: Allow picking a sequence number for blanktime_get
This lets us do a blocking wait for a vsync. Something we should try to do as infrequently as possible, but in some cases we need it one time at startup to catch graphics driver bugs.
Diffstat (limited to 'src/lib/ecore_drm2')
-rw-r--r--src/lib/ecore_drm2/Ecore_Drm2.h9
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_outputs.c3
2 files changed, 9 insertions, 3 deletions
diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h
index 4be533bc66..450f1faa0c 100644
--- a/src/lib/ecore_drm2/Ecore_Drm2.h
+++ b/src/lib/ecore_drm2/Ecore_Drm2.h
@@ -1079,15 +1079,20 @@ EAPI void ecore_drm2_fb_status_handler_set(Ecore_Drm2_Fb *fb, Ecore_Drm2_Fb_Stat
1079/** 1079/**
1080 * Get the time of the last vblank 1080 * Get the time of the last vblank
1081 * 1081 *
1082 * Query the display hardware for the time of the last vblank. 1082 * Query the display hardware for the time of a vblank, potentially blocking.
1083 *
1084 * If sequence is 0 the time of the last vblank will be immediately returned,
1085 * if it's above zero that number of vblanks will pass before the function
1086 * returns.
1083 * 1087 *
1084 * @param output 1088 * @param output
1089 * @param sequence
1085 * @param sec 1090 * @param sec
1086 * @param usec 1091 * @param usec
1087 * 1092 *
1088 * @since 1.20 1093 * @since 1.20
1089 */ 1094 */
1090EAPI Eina_Bool ecore_drm2_output_blanktime_get(Ecore_Drm2_Output *output, long *sec, long *usec); 1095EAPI Eina_Bool ecore_drm2_output_blanktime_get(Ecore_Drm2_Output *output, int sequence, long *sec, long *usec);
1091 1096
1092# endif 1097# endif
1093 1098
diff --git a/src/lib/ecore_drm2/ecore_drm2_outputs.c b/src/lib/ecore_drm2/ecore_drm2_outputs.c
index d2b3acb54b..fba4be0c8d 100644
--- a/src/lib/ecore_drm2/ecore_drm2_outputs.c
+++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c
@@ -1584,7 +1584,7 @@ ecore_drm2_output_subpixel_get(const Ecore_Drm2_Output *output)
1584} 1584}
1585 1585
1586EAPI Eina_Bool 1586EAPI Eina_Bool
1587ecore_drm2_output_blanktime_get(Ecore_Drm2_Output *output, long *sec, long *usec) 1587ecore_drm2_output_blanktime_get(Ecore_Drm2_Output *output, int sequence, long *sec, long *usec)
1588{ 1588{
1589 drmVBlank v; 1589 drmVBlank v;
1590 int ret; 1590 int ret;
@@ -1595,6 +1595,7 @@ ecore_drm2_output_blanktime_get(Ecore_Drm2_Output *output, long *sec, long *usec
1595 1595
1596 memset(&v, 0, sizeof(v)); 1596 memset(&v, 0, sizeof(v));
1597 v.request.type = DRM_VBLANK_RELATIVE; 1597 v.request.type = DRM_VBLANK_RELATIVE;
1598 v.request.sequence = sequence;
1598 ret = sym_drmWaitVBlank(output->fd, &v); 1599 ret = sym_drmWaitVBlank(output->fd, &v);
1599 if (ret) return EINA_FALSE; 1600 if (ret) return EINA_FALSE;
1600 if (v.reply.tval_sec < 0) return EINA_FALSE; 1601 if (v.reply.tval_sec < 0) return EINA_FALSE;