summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--hwc/sw_vsync.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/hwc/sw_vsync.c b/hwc/sw_vsync.c
index cf24b31..fce6d37 100644
--- a/hwc/sw_vsync.c
+++ b/hwc/sw_vsync.c
@@ -60,10 +60,16 @@ static void *vsync_loop(void *data)
for (;;) {
pthread_mutex_lock(&vsync_mutex);
- period = vsync_rate; /* re-read rate */
while (!vsync_loop_active) {
pthread_cond_wait(&vsync_cond, &vsync_mutex);
}
+ /* the vsync_rate should be re-read after
+ * user sets the vsync_rate by calling start_sw_vsync
+ * explicitly. This is guaranteed by re-reading it
+ * after the vsync_cond is signalled.
+ */
+ period = vsync_rate; /* re-read rate */
+
pthread_mutex_unlock(&vsync_mutex);
clock_gettime(CLOCK_MONOTONIC, &tp);