hwc/fb/overlay: wait for fbpost and pan display
Draw sequence in hwc_set
--eglSwapBuffers
--wait for fb_post. Its ok to draw to External only at this point.
--draw to external | Parallel with PAN
--commit to external | Parallel with PAN
--wait for pan (happening in fb_post) to finish.
Call MSMFB_OVERLAY_SET ioctl only when params change.
These thing together ensure a correct sequence and should fix tearing and
stuttering, the latter assuming there are no other display pipeline delays.
Acked-by: Arun Kumar K.R <akumarkr@codeaurora.org>
Change-Id: Ibb0ad8485fa6b30dc6ac07ae8b25a760941c08ce
diff --git a/libhwcomposer/hwc_utils.h b/libhwcomposer/hwc_utils.h
index b586fa8..33446b9 100644
--- a/libhwcomposer/hwc_utils.h
+++ b/libhwcomposer/hwc_utils.h
@@ -77,6 +77,12 @@
void calculate_crop_rects(hwc_rect_t& crop, hwc_rect_t& dst,
const int fbWidth, const int fbHeight);
+// Waits for the fb_post to be called
+void wait4fbPost(hwc_context_t* ctx);
+
+// Waits for the fb_post to finish PAN (primary commit)
+void wait4Pan(hwc_context_t* ctx);
+
// Inline utility functions
static inline bool isSkipLayer(const hwc_layer_1_t* l) {
return (UNLIKELY(l && (l->flags & HWC_SKIP_LAYER)));