Revert "Bypass: Turn off only after FB content is displayed."

This reverts commit f2dbabe786.

This change is not needed any more because we are caching the MDP pipe
contents when closing the channel. So no need to wait for postFB finish.

Change-Id: Ia6f01c33953762cb7a97e0b2b795d9afeb60d2d9
(cherry picked from commit 441f1824593bb12a97508b426b597a16b35091e6)
This commit is contained in:
Jeykumar Sankaran 2012-01-20 12:48:01 -08:00 committed by Andrew Sutherland
parent 022c7668c4
commit bd35204368
4 changed files with 3 additions and 69 deletions

View File

@ -45,8 +45,8 @@ ifeq ($(TARGET_QCOM_HDMI_OUT),true)
LOCAL_SHARED_LIBRARIES += liboverlay
endif
ifeq ($(TARGET_HAVE_BYPASS),true)
LOCAL_CFLAGS += -DCOMPOSITION_BYPASS
ifeq ($(TARGET_USES_SF_BYPASS),true)
LOCAL_CFLAGS += -DSF_BYPASS
endif
ifeq ($(TARGET_GRALLOC_USES_ASHMEM),true)

View File

@ -148,7 +148,7 @@ static void *disp_loop(void *ptr)
pthread_mutex_lock(&(m->qlock));
// wait (sleep) while display queue is empty;
while (m->disp.isEmpty()) {
if (m->disp.isEmpty()) {
pthread_cond_wait(&(m->qpost),&(m->qlock));
}
@ -176,13 +176,6 @@ static void *disp_loop(void *ptr)
LOGE("ERROR FBIOPUT_VSCREENINFO failed; frame not displayed");
}
#if defined COMPOSITION_BYPASS
//Signal so that we can close channels if we need to
pthread_mutex_lock(&m->bufferPostLock);
m->bufferPostDone = true;
pthread_cond_signal(&m->bufferPostCond);
pthread_mutex_unlock(&m->bufferPostLock);
#endif
CALC_FPS();
if (cur_buf == -1) {
@ -433,34 +426,6 @@ static int fb_orientationChanged(struct framebuffer_device_t* dev, int orientati
}
#endif
//Wait until framebuffer content is displayed.
//This is called in the context of threadLoop.
//Display loop wakes this up after display.
static int fb_waitForBufferPost(struct framebuffer_device_t* dev)
{
#if defined COMPOSITION_BYPASS
private_module_t* m = reinterpret_cast<private_module_t*>(
dev->common.module);
pthread_mutex_lock(&m->bufferPostLock);
while(m->bufferPostDone == false) {
pthread_cond_wait(&(m->bufferPostCond), &(m->bufferPostLock));
}
pthread_mutex_unlock(&m->bufferPostLock);
#endif
return 0;
}
static int fb_resetBufferPostStatus(struct framebuffer_device_t* dev)
{
#if defined COMPOSITION_BYPASS
private_module_t* m = reinterpret_cast<private_module_t*>(
dev->common.module);
pthread_mutex_lock(&m->bufferPostLock);
m->bufferPostDone = false;
pthread_mutex_unlock(&m->bufferPostLock);
#endif
return 0;
}
static int fb_post(struct framebuffer_device_t* dev, buffer_handle_t buffer)
{
if (private_handle_t::validate(buffer) < 0)
@ -841,11 +806,6 @@ int mapFrameBufferLocked(struct private_module_t* module)
pthread_t hdmiUIThread;
pthread_create(&hdmiUIThread, NULL, &hdmi_ui_loop, (void *) module);
#endif
#if defined COMPOSITION_BYPASS
pthread_mutex_init(&(module->bufferPostLock), NULL);
pthread_cond_init(&(module->bufferPostCond), NULL);
module->bufferPostDone = false;
#endif
return 0;
}
@ -909,11 +869,6 @@ int fb_device_open(hw_module_t const* module, const char* name,
dev->device.setActionSafeHeightRatio = fb_setActionSafeHeightRatio;
#endif
#if defined COMPOSITION_BYPASS
dev->device.waitForBufferPost = fb_waitForBufferPost;
dev->device.resetBufferPostStatus = fb_resetBufferPostStatus;
#endif
private_module_t* m = (private_module_t*)module;
status = mapFrameBuffer(m);
if (status >= 0) {

View File

@ -284,11 +284,6 @@ struct private_module_t {
pthread_mutex_t overlayLock;
pthread_cond_t overlayPost;
#endif
#ifdef COMPOSITION_BYPASS
pthread_mutex_t bufferPostLock;
pthread_cond_t bufferPostCond;
bool bufferPostDone;
#endif
};
/*****************************************************************************/

View File

@ -1223,9 +1223,6 @@ static int hwc_set(hwc_composer_device_t *dev,
private_hwc_module_t* hwcModule = reinterpret_cast<private_hwc_module_t*>(
dev->common.module);
framebuffer_device_t *fbDev = hwcModule->fbDevice;
if (!list || !hwcModule) {
LOGE("hwc_set invalid list or module");
#ifdef COMPOSITION_BYPASS
@ -1259,19 +1256,12 @@ static int hwc_set(hwc_composer_device_t *dev,
storeLockedBypassHandle(list, ctx);
// We have stored the handles, unset the current lock states in the context.
unsetBypassBufferLockState(ctx);
//Setup for waiting until 1 FB post is done before closing bypass mode.
if (ctx->bypassState == BYPASS_OFF_PENDING) {
fbDev->resetBufferPostStatus(fbDev);
}
#endif
// Do not call eglSwapBuffers if we the skip composition flag is set on the list.
if (!(list->flags & HWC_SKIP_COMPOSITION)) {
EGLBoolean sucess = eglSwapBuffers((EGLDisplay)dpy, (EGLSurface)sur);
if (!sucess) {
ret = HWC_EGL_ERROR;
LOGE("eglSwapBuffers() failed in %s", __FUNCTION__);
}
}
else {
@ -1279,12 +1269,6 @@ static int hwc_set(hwc_composer_device_t *dev,
}
#ifdef COMPOSITION_BYPASS
if(ctx->bypassState == BYPASS_OFF_PENDING) {
//Close channels only after fb content is displayed.
//We have already reset status before eglSwapBuffers.
if (!(list->flags & HWC_SKIP_COMPOSITION)) {
fbDev->waitForBufferPost(fbDev);
}
closeBypass(ctx);
ctx->bypassState = BYPASS_OFF;
}