summaryrefslogtreecommitdiffstats
path: root/libgralloc/framebuffer.cpp
diff options
context:
space:
mode:
authorSaurabh Shah <saurshah@codeaurora.org>2012-08-17 19:47:52 -0700
committerIliyan Malchev <malchev@google.com>2012-08-27 13:53:40 -0700
commitfc2acbe75484dea7197b75d0ef9889f78398b06b (patch)
tree14070c0de4a3cdb23e0cdd560baa22f7c0cc903b /libgralloc/framebuffer.cpp
parent94822ee87c6b3de1af7ca25c04f868f7e29e4ca2 (diff)
downloadandroid_hardware_qcom_display-fc2acbe75484dea7197b75d0ef9889f78398b06b.tar.gz
android_hardware_qcom_display-fc2acbe75484dea7197b75d0ef9889f78398b06b.tar.bz2
android_hardware_qcom_display-fc2acbe75484dea7197b75d0ef9889f78398b06b.zip
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
Diffstat (limited to 'libgralloc/framebuffer.cpp')
-rw-r--r--libgralloc/framebuffer.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/libgralloc/framebuffer.cpp b/libgralloc/framebuffer.cpp
index 4f8401158..dd630d525 100644
--- a/libgralloc/framebuffer.cpp
+++ b/libgralloc/framebuffer.cpp
@@ -136,6 +136,13 @@ static int fb_post(struct framebuffer_device_t* dev, buffer_handle_t buffer)
genlock_unlock_buffer(hnd);
return -errno;
}
+
+ //Signals the composition thread to unblock and loop over if necessary
+ pthread_mutex_lock(&m->fbPanLock);
+ m->fbPanDone = true;
+ pthread_cond_signal(&m->fbPanCond);
+ pthread_mutex_unlock(&m->fbPanLock);
+
CALC_FPS();
m->currentBuffer = hnd;
}
@@ -365,6 +372,9 @@ int mapFrameBufferLocked(struct private_module_t* module)
module->fbPostDone = false;
pthread_mutex_init(&(module->fbPostLock), NULL);
pthread_cond_init(&(module->fbPostCond), NULL);
+ module->fbPanDone = false;
+ pthread_mutex_init(&(module->fbPanLock), NULL);
+ pthread_cond_init(&(module->fbPanCond), NULL);
return 0;
}