From b10f481ae26c74576f4b3d99ee29cd60e3f4f96c Mon Sep 17 00:00:00 2001 From: Harshad Bhutada Date: Fri, 15 Apr 2011 14:14:33 +0530 Subject: [PATCH] libgralloc-qsd8k: disable framebuffer state related error reporting when swapinterval set to 0 Change-Id: Idf0d8b7d261240f6300c5df805cc42dee8098310 --- libgralloc-qsd8k/framebuffer.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libgralloc-qsd8k/framebuffer.cpp b/libgralloc-qsd8k/framebuffer.cpp index f27ea5f..6d9a929 100644 --- a/libgralloc-qsd8k/framebuffer.cpp +++ b/libgralloc-qsd8k/framebuffer.cpp @@ -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));