aboutsummaryrefslogtreecommitdiff
path: root/hwcomposer.cpp
diff options
context:
space:
mode:
authorSean Paul <seanpaul@chromium.org>2015-02-22 17:55:43 -0500
committerSean Paul <seanpaul@google.com>2015-02-23 17:57:17 +0000
commite147a2a71f7c7f0b3cc925199fe68951cb311379 (patch)
treef7ec237b7efe5811e75ba1d050bedc8332da4b4d /hwcomposer.cpp
parenta99534ab0ddf258a46b7a680a6bc56b128c6ae48 (diff)
downloaddrm_hwcomposer-e147a2a71f7c7f0b3cc925199fe68951cb311379.tar.gz
drm_hwcomposer: Initialize timeline_next to 1
Initialize timeline_next to 1, because point 0 will be the very first set operation. Since we increment every time set() is called, initializing to 0 would cause an off-by-one error where surfaceflinger would always composite on the front buffer. Change-Id: I1e67c36864716595eb489286a7db3f1dcb04f67e Signed-off-by: Sean Paul <seanpaul@chromium.org> Reviewed-on: https://chrome-internal-review.googlesource.com/200735 Tested-by: Alexandre Courbot <acourbot@nvidia.com> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Reviewed-by: Allen Martin <amartin@nvidia.com> Reviewed-by: Sean Paul <seanpaul@google.com>
Diffstat (limited to 'hwcomposer.cpp')
-rw-r--r--hwcomposer.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/hwcomposer.cpp b/hwcomposer.cpp
index 1c2b8b2..3f20e53 100644
--- a/hwcomposer.cpp
+++ b/hwcomposer.cpp
@@ -1194,7 +1194,14 @@ static int hwc_initialize_display(struct hwc_context_t *ctx, int display,
return ret;
}
hd->timeline_fd = ret;
- hd->timeline_next = 0;
+
+ /*
+ * Initialize timeline_next to 1, because point 0 will be the very first
+ * set operation. Since we increment every time set() is called,
+ * initializing to 0 would cause an off-by-one error where
+ * surfaceflinger would composite on the front buffer.
+ */
+ hd->timeline_next = 1;
ret = hwc_set_initial_config(hd);
if (ret) {