display: Enable triple FrameBuffering

Change-Id: Iab7ea670a940438f83dd7130933cceafd15b29a6
This commit is contained in:
Naseer Ahmed 2011-11-20 17:05:55 -08:00
parent b0d4ae5c3a
commit a6bda75e59

View File

@ -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<float&>(dev->device.fps) = m->fps;
const_cast<int&>(dev->device.minSwapInterval) = private_module_t::PRIV_MIN_SWAP_INTERVAL;
const_cast<int&>(dev->device.maxSwapInterval) = private_module_t::PRIV_MAX_SWAP_INTERVAL;
#if 0
const_cast<int&>(dev->device.numFramebuffers) = m->numBuffers;
#endif
if (m->finfo.reserved[0] == 0x5444 &&
m->finfo.reserved[1] == 0x5055) {
dev->device.setUpdateRect = fb_setUpdateRect;