From 0b247086de281f77b9ae3d3755872ea8583403a3 Mon Sep 17 00:00:00 2001 From: Marc Mao Date: Tue, 10 Apr 2012 16:34:02 +0800 Subject: [PATCH] [Graphics/3D]: Reset pLastSyncInfo to fix Post and Post2 switch hang issue BZ: 30855 When HWC enabled, HWC bypass layers will displayed by Post2 interface. But normal Framebuffer will still use Post interface. In kernel driver, Post2 will call PVRSRVSwapToDCBuffer2KM, it will append last frame's sync info to current flip command. But if app switch for Post, the previous buffer maybe is freed and the sync info is wrong. The patch will clear the pLastSyncInfo and then PVRSRVSwapToDCBuffer2KM will not append last frame's sync info to the first frame after switch. Change-Id: If700cd17aa6d55d4e9bf2574e18e078c307ee764 Signed-off-by: Marc Mao Reviewed-on: http://android.intel.com:8080/42890 Reviewed-by: Xu, Randy Tested-by: Xu, Randy Reviewed-by: Wang, Gang A Reviewed-by: buildbot Tested-by: buildbot --- drivers/staging/mrst/pvr/services4/srvkm/common/deviceclass.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/staging/mrst/pvr/services4/srvkm/common/deviceclass.c b/drivers/staging/mrst/pvr/services4/srvkm/common/deviceclass.c index 7b1f0ef..47b2b1d1 100755 --- a/drivers/staging/mrst/pvr/services4/srvkm/common/deviceclass.c +++ b/drivers/staging/mrst/pvr/services4/srvkm/common/deviceclass.c @@ -1540,6 +1540,16 @@ PVRSRV_ERROR PVRSRVSwapToDCBufferKM(IMG_HANDLE hDeviceKM, psBuffer->psSwapChain->psLastFlipBuffer = psBuffer; psDCInfo->psDCSwapChainCur = psBuffer->psSwapChain; +#if !defined(SUPPORT_DC_CMDCOMPLETE_WHEN_NO_LONGER_DISPLAYED) + if (psBuffer->psSwapChain->ppsLastSyncInfos) + { + OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(PVRSRV_KERNEL_SYNC_INFO *) * psBuffer->psSwapChain->ui32LastNumSyncInfos, + psBuffer->psSwapChain->ppsLastSyncInfos, IMG_NULL); + psBuffer->psSwapChain->ppsLastSyncInfos = IMG_NULL; + psBuffer->psSwapChain->ui32LastNumSyncInfos = 0; + } +#endif + Exit: if(eError == PVRSRV_ERROR_CANNOT_GET_QUEUE_SPACE) -- 2.7.4