From a6bda75e5961c66ca4eadb50454ed52dd14d2e98 Mon Sep 17 00:00:00 2001 From: Naseer Ahmed Date: Sun, 20 Nov 2011 17:05:55 -0800 Subject: [PATCH] display: Enable triple FrameBuffering Change-Id: Iab7ea670a940438f83dd7130933cceafd15b29a6 --- libgralloc/framebuffer.cpp | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/libgralloc/framebuffer.cpp b/libgralloc/framebuffer.cpp index bdaa204..19ee4d1 100644 --- a/libgralloc/framebuffer.cpp +++ b/libgralloc/framebuffer.cpp @@ -640,15 +640,15 @@ static int fb_post(struct framebuffer_device_t* dev, buffer_handle_t buffer) // post/queue the new buffer pthread_mutex_lock(&(m->avail[nxtIdx].lock)); if (m->avail[nxtIdx].is_avail != true) { - //LOGE_IF(m->swapInterval != 0, "Found %d buf to be not avail", nxtIdx); + LOGE_IF(m->swapInterval != 0, "Found %d buf to be not avail", nxtIdx); } m->avail[nxtIdx].is_avail = false; if (m->avail[nxtIdx].state != AVL) { - //LOGD("[%d] state %c, expected %c", nxtIdx, - // framebufferStateName[m->avail[nxtIdx].state], - // framebufferStateName[AVL]); + LOGD("[%d] state %c, expected %c", nxtIdx, + framebufferStateName[m->avail[nxtIdx].state], + framebufferStateName[AVL]); } m->avail[nxtIdx].state = SUB; @@ -823,9 +823,6 @@ int mapFrameBufferLocked(struct private_module_t* module) /* * Request NUM_BUFFERS screens (at lest 2 for page flipping) */ - // XXX Disable triple FB for now - int numberOfBuffers = NUM_FRAMEBUFFERS_MIN; -#if 0 int numberOfBuffers = (int)(finfo.smem_len/(info.yres * info.xres * (info.bits_per_pixel/8))); LOGV("num supported framebuffers in kernel = %d", numberOfBuffers); @@ -835,7 +832,6 @@ int mapFrameBufferLocked(struct private_module_t* module) numberOfBuffers = num; } } -#endif if (numberOfBuffers > NUM_FRAMEBUFFERS_MAX) numberOfBuffers = NUM_FRAMEBUFFERS_MAX; @@ -1048,11 +1044,7 @@ int fb_device_open(hw_module_t const* module, const char* name, dev->device.post = fb_post; dev->device.setUpdateRect = 0; dev->device.compositionComplete = fb_compositionComplete; - // XXX triple buffering related changes - // are disabled -#if 0 dev->device.lockBuffer = fb_lockBuffer; -#endif #if defined(HDMI_DUAL_DISPLAY) dev->device.orientationChanged = fb_orientationChanged; dev->device.videoOverlayStarted = fb_videoOverlayStarted; @@ -1075,9 +1067,7 @@ int fb_device_open(hw_module_t const* module, const char* name, const_cast(dev->device.fps) = m->fps; const_cast(dev->device.minSwapInterval) = private_module_t::PRIV_MIN_SWAP_INTERVAL; const_cast(dev->device.maxSwapInterval) = private_module_t::PRIV_MAX_SWAP_INTERVAL; -#if 0 const_cast(dev->device.numFramebuffers) = m->numBuffers; -#endif if (m->finfo.reserved[0] == 0x5444 && m->finfo.reserved[1] == 0x5055) { dev->device.setUpdateRect = fb_setUpdateRect;