From: gwang23 Date: Sat, 28 Apr 2012 07:59:48 +0000 (+0800) Subject: Graphics: Refine the PVRSRVGetDCFrontBufferKM to avoid duplicates blt X-Git-Tag: 2.1b_release~839 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c5c78b32c2272a91624b0ba1d5ca0dcd34e94400;p=kernel%2Fkernel-mfld-blackbay.git Graphics: Refine the PVRSRVGetDCFrontBufferKM to avoid duplicates blt BZ: 33328 In previous solution, PVRSRVGetDCFrontBufferKM would return the last handled buffer in flip command queues. There is a delay between handling the flip command and eglSwapBuffers(), there are in different threads, so in some case, the old buffer would be used in PVR2DBltWidi(); Current solution is to return the last buffer used in eglSwapBuffers(), Since in current pvr dirvers, eglSwapBuffers() would wait for the buffer rendering complete, then the buffer can be returned for Widi. Change-Id: Iaf65746c23c276ba0f21ceb929661a5a6d042c59 Signed-off-by: gwang23 Reviewed-on: http://android.intel.com:8080/46657 Reviewed-by: Tao, Tao Q Reviewed-by: Tong, BoX Tested-by: Tong, BoX Reviewed-by: buildbot Tested-by: buildbot --- diff --git a/drivers/staging/mrst/pvr/services4/srvkm/common/deviceclass.c b/drivers/staging/mrst/pvr/services4/srvkm/common/deviceclass.c index e23ab56..f3ce7ce 100644 --- a/drivers/staging/mrst/pvr/services4/srvkm/common/deviceclass.c +++ b/drivers/staging/mrst/pvr/services4/srvkm/common/deviceclass.c @@ -1998,36 +1998,14 @@ PVRSRV_ERROR PVRSRVGetDCFrontBufferKM(IMG_HANDLE hDeviceKM, psDCInfo = DCDeviceHandleToDCInfo(hDeviceKM); psSwapChain = psDCInfo->psDCSwapChainCur; - - eError = psDCInfo->psFuncTable->pfnGetDCFrontBuffer(psDCInfo->hExtDevice, - pui32FlipChainID, - &frontBuffer); - if (eError != PVRSRV_OK || *pui32FlipChainID == 0) - { - goto Exit; - } - - if (psDCInfo->psDCSwapChainCur - && psDCInfo->psDCSwapChainCur->ui32SwapChainID == *pui32FlipChainID) - { - psSwapChain = psDCInfo->psDCSwapChainCur; - } - else - { - psSwapChain = psDCInfo->psDCSwapChainShared; - while (psSwapChain - && psSwapChain->ui32SwapChainID != *pui32FlipChainID) - { - psSwapChain = psSwapChain->psNext; - } - } - if (psSwapChain == IMG_NULL) { PVR_DPF((PVR_DBG_ERROR,"PVRSRVGetDCFrontBufferKM: No Swap Chain is in used")); goto Exit; } + frontBuffer = psSwapChain->psLastFlipBuffer->sDeviceClassBuffer.hExtBuffer; + for (bufIndex = 0; bufIndex < psSwapChain->ui32BufferCount; bufIndex++) { if (frontBuffer ==