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/libgralloc/fb_priv.h b/libgralloc/fb_priv.h
index 48e5669..340968c 100644
--- a/libgralloc/fb_priv.h
+++ b/libgralloc/fb_priv.h
@@ -54,6 +54,9 @@
     pthread_mutex_t fbPostLock;
     //Condition to inform HWC that fb_post called
     pthread_cond_t fbPostCond;
+    bool fbPanDone;
+    pthread_mutex_t fbPanLock;
+    pthread_cond_t fbPanCond;
 };