Skip to content

Commit

Permalink
Move the lock earlier to make surface heap status aligned when surfac…
Browse files Browse the repository at this point in the history
…e is destroy.
  • Loading branch information
hongbolv authored and intel-mediadev committed May 28, 2019
1 parent 1f15f04 commit efbb30c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion media_driver/linux/common/ddi/media_libva.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit efbb30c

Please sign in to comment.