From efbb30c652efdf8efcdd6f20e1a40e0cfc22fa3d Mon Sep 17 00:00:00 2001 From: hongbolv Date: Wed, 17 Apr 2019 22:21:06 +0800 Subject: [PATCH] Move the lock earlier to make surface heap status aligned when surface is destroy. --- media_driver/linux/common/ddi/media_libva.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/media_driver/linux/common/ddi/media_libva.cpp b/media_driver/linux/common/ddi/media_libva.cpp index 1322a964745..8d3c3be7bd4 100755 --- a/media_driver/linux/common/ddi/media_libva.cpp +++ b/media_driver/linux/common/ddi/media_libva.cpp @@ -1871,9 +1871,9 @@ static VAStatus DdiMedia_DestroySurfaces ( DdiMediaUtil_UnRegisterRTSurfaces(ctx, surface); + DdiMediaUtil_LockMutex(&mediaCtx->SurfaceMutex); DdiMediaUtil_FreeSurface(surface); MOS_FreeMemory(surface); - DdiMediaUtil_LockMutex(&mediaCtx->SurfaceMutex); DdiMediaUtil_ReleasePMediaSurfaceFromHeap(mediaCtx->pSurfaceHeap, (uint32_t)surfaces[i]); mediaCtx->uiNumSurfaces--; DdiMediaUtil_UnLockMutex(&mediaCtx->SurfaceMutex);