Skip to content
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

I915 cleanup android #2

Open
wants to merge 11 commits into
base: i915_cleanup
Choose a base branch
from
4 changes: 4 additions & 0 deletions media_driver/cmake/linux/media_compile_flags_linux.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,7 @@ if (DEFINED MEDIA_VERSION)
elseif (DEFINED ENV{MEDIA_VERSION})
add_definitions(-DUFO_VERSION="$ENV{MEDIA_VERSION}")
endif()

if (MEDIA_EXT)
add_definitions(-DMEDIA_EXT)
endif()
35 changes: 5 additions & 30 deletions media_driver/linux/common/ddi/media_libva_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -519,40 +519,15 @@ VAStatus DdiMediaUtil_AllocateSurface(
if (!DdiMediaUtil_IsExternalSurface(mediaSurface))
{
unsigned long ulPitch = 0;
#if defined(I915_PARAM_CREATE_VERSION)
int32_t value = 0;
int32_t ret = -1;
drm_i915_getparam_t gp;
memset( &gp, 0, sizeof(gp) );
gp.value = &value;
gp.param = I915_PARAM_CREATE_VERSION;
ret = drmIoctl(mediaDrvCtx->fd, DRM_IOCTL_I915_GETPARAM, &gp);
if ((0 == ret) && (tileformat != I915_TILING_NONE))
if ( tileformat == I915_TILING_NONE )
{
bo = mos_bo_alloc_tiled(mediaDrvCtx->pDrmBufMgr, "MEDIA", gmmPitch, gmmSize/gmmPitch, 1, &tileformat, (unsigned long *)&ulPitch, BO_ALLOC_STOLEN);
if (nullptr == bo)
{
bo = mos_bo_alloc_tiled(mediaDrvCtx->pDrmBufMgr, "MEDIA", gmmPitch, gmmSize/gmmPitch, 1, &tileformat, (unsigned long *)&ulPitch, 0);
}
else
{
DDI_VERBOSEMESSAGE("Stolen memory is created sucessfully on AllocateSurface");
}
pitch = ulPitch;
bo = mos_bo_alloc(mediaDrvCtx->pDrmBufMgr, "MEDIA", gmmSize, 4096);
pitch = gmmPitch;
}
else
#endif
{
if ( tileformat == I915_TILING_NONE )
{
bo = mos_bo_alloc(mediaDrvCtx->pDrmBufMgr, "MEDIA", gmmSize, 4096);
pitch = gmmPitch;
}
else
{
bo = mos_bo_alloc_tiled(mediaDrvCtx->pDrmBufMgr, "MEDIA", gmmPitch, gmmSize/gmmPitch, 1, &tileformat, (unsigned long *)&ulPitch, 0);
pitch = ulPitch;
}
bo = mos_bo_alloc_tiled(mediaDrvCtx->pDrmBufMgr, "MEDIA", gmmPitch, gmmSize/gmmPitch, 1, &tileformat, (unsigned long *)&ulPitch, 0);
pitch = ulPitch;
}
}
else if(mediaSurface->pSurfDesc->uiFlags & VA_SURFACE_ATTRIB_MEM_TYPE_USER_PTR)
Expand Down
Loading