Skip to content

Commit

Permalink
check pitch from application for user ptr
Browse files Browse the repository at this point in the history
Signed-off-by: XinfengZhang <carl.zhang@intel.com>
  • Loading branch information
XinfengZhang authored and intel-mediadev committed Sep 5, 2019
1 parent ec34d40 commit ab3c3c6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions media_driver/linux/common/ddi/media_libva_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,12 @@ VAStatus DdiMediaUtil_AllocateSurface(
gmmParams.BaseHeight = mediaSurface->pSurfDesc->uiSize / mediaSurface->pSurfDesc->uiPitches[0];
}
}
if(mediaSurface->pSurfDesc->uiVaMemType == VA_SURFACE_ATTRIB_MEM_TYPE_USER_PTR)
{
gmmParams.ExistingSysMemSize = mediaSurface->pSurfDesc->uiBuffserSize;
gmmParams.pExistingSysMem = mediaSurface->pSurfDesc->ulBuffer;
gmmParams.Flags.Info.ExistingSysMem = true;
}
}
else
{
Expand Down Expand Up @@ -405,6 +411,12 @@ VAStatus DdiMediaUtil_AllocateSurface(
uint32_t gmmPitch;
uint32_t gmmSize;
uint32_t gmmHeight;

gmmPitch = (uint32_t)gmmResourceInfo->GetRenderPitch();
if( DdiMediaUtil_IsExternalSurface(mediaSurface) && ( mediaSurface->pSurfDesc->uiVaMemType == VA_SURFACE_ATTRIB_MEM_TYPE_USER_PTR ) && mediaSurface->pSurfDesc->uiPitches[0])
{
gmmResourceInfo->OverridePitch(mediaSurface->pSurfDesc->uiPitches[0]);
}
gmmPitch = (uint32_t)gmmResourceInfo->GetRenderPitch();
gmmSize = (uint32_t)gmmResourceInfo->GetSizeSurface();
gmmHeight = gmmResourceInfo->GetBaseHeight();
Expand Down

0 comments on commit ab3c3c6

Please sign in to comment.