libgralloc-qsd8k: disable framebuffer state related error reporting when swapinterval set to 0

Change-Id: Idf0d8b7d261240f6300c5df805cc42dee8098310
This commit is contained in:
Harshad Bhutada 2011-04-15 14:14:33 +05:30 committed by Govind Surti
parent 3ea7a7fc38
commit b10f481ae2

View File

@ -181,7 +181,7 @@ static void *disp_loop(void *ptr)
} else {
pthread_mutex_lock(&(m->avail[nxtBuf.idx].lock));
if (m->avail[nxtBuf.idx].state != SUB) {
LOGE("[%d] state %c, expected %c", nxtBuf.idx,
LOGE_IF(m->swapInterval != 0, "[%d] state %c, expected %c", nxtBuf.idx,
framebufferStateName[m->avail[nxtBuf.idx].state],
framebufferStateName[SUB]);
}
@ -191,7 +191,7 @@ static void *disp_loop(void *ptr)
pthread_mutex_lock(&(m->avail[cur_buf].lock));
m->avail[cur_buf].is_avail = true;
if (m->avail[cur_buf].state != REF) {
LOGE("[%d] state %c, expected %c", cur_buf,
LOGE_IF(m->swapInterval != 0, "[%d] state %c, expected %c", cur_buf,
framebufferStateName[m->avail[cur_buf].state],
framebufferStateName[REF]);
}
@ -451,7 +451,7 @@ 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("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;
@ -490,7 +490,7 @@ static int fb_post(struct framebuffer_device_t* dev, buffer_handle_t buffer)
m->currentBuffer = buffer;
m->currentIdx = nxtIdx;
if (m->avail[futureIdx].state != AVL) {
LOGE("[%d] != AVL!", futureIdx);
LOGE_IF(m->swapInterval != 0, "[%d] != AVL!", futureIdx);
}
} else {
if (m->currentBuffer)
@ -548,7 +548,7 @@ static int fb_dequeueBuffer(struct framebuffer_device_t* dev, int index)
dev->common.module);
// Return immediately if the buffer is available
if (m->avail[index].state == AVL)
if ((m->avail[index].state == AVL) || (m->swapInterval == 0))
return 0;
pthread_mutex_lock(&(m->avail[index].lock));