From f87ee7db28d2c1f0397ebc45097166d800095f18 Mon Sep 17 00:00:00 2001 From: Harshad Bhutada Date: Thu, 17 Mar 2011 17:34:00 +0530 Subject: [PATCH] libgralloc-qsd8k: disable framebuffer state related error reporting when swapinterval set to 0 Change-Id: I916408280dc155e4448de9303272dfbd5dc1c423 --- framebuffer.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/framebuffer.cpp b/framebuffer.cpp index 2a7d289..4d1ab7e 100644 --- a/framebuffer.cpp +++ b/framebuffer.cpp @@ -180,7 +180,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]); } @@ -190,7 +190,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]); } @@ -447,7 +447,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; @@ -486,7 +486,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) @@ -544,7 +544,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));