Skip to content

accept cacheable setting from libva #1946

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3299,7 +3299,8 @@ VAStatus MediaLibvaInterfaceNext::CreateSurfaces2 (
expectedFourcc = externalBufDescripor.pixel_format;
width = externalBufDescripor.width;
height = externalBufDescripor.height;
// the following code is for backward compatible and it will be removed in the future
descFlag = externalBufDescripor.flags;
// the following code is for backward compatible problem caused by incorrect use of VA_SURFACE_ATTRIB_MEM_TYPE_XXX in application layer. and it will be removed in the future
// new implemention should use VASurfaceAttribMemoryType attrib and set its value to VA_SURFACE_ATTRIB_MEM_TYPE_KERNEL_DRM
if ((externalBufDescripor.flags & VA_SURFACE_ATTRIB_MEM_TYPE_KERNEL_DRM )||
(externalBufDescripor.flags & VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME)||
Expand Down
6 changes: 5 additions & 1 deletion media_softlet/linux/common/ddi/media_libva_util_next.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -651,9 +651,13 @@ VAStatus MediaLibvaUtilNext::CreateExternalSurface(

GMM_RESCREATE_CUSTOM_PARAMS_2 gmmCustomParams;
MOS_ZeroMemory(&gmmCustomParams, sizeof(gmmCustomParams));
gmmCustomParams.Usage = GMM_RESOURCE_USAGE_STAGING;
if ((VA_SURFACE_EXTBUF_DESC_UNCACHED & mediaSurface->pSurfDesc->uiFlags) || (VA_SURFACE_EXTBUF_DESC_WC & mediaSurface->pSurfDesc->uiFlags))
{
gmmCustomParams.Usage = GMM_RESOURCE_USAGE_UNKNOWN;
}
if (VA_SURFACE_ATTRIB_MEM_TYPE_USER_PTR == mediaSurface->pSurfDesc->uiVaMemType)
{
gmmCustomParams.Usage = GMM_RESOURCE_USAGE_STAGING;
gmmCustomParams.Type = RESOURCE_1D;
}

Expand Down