Skip to content
Open
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
15 changes: 15 additions & 0 deletions c2_utils/src/mfx_va_allocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,19 @@ static mfxU32 ConvertVAFourccToVARTFormat(mfxU32 va_fourcc)
}
}

// quick fix tiling issue, formal should use modifier with PRIME2 interface
static bool isTiledGrallocFourcc(int fourcc) {
switch (fourcc) {
case HAL_PIXEL_FORMAT_NV12_Y_TILED_INTEL:
case HAL_PIXEL_FORMAT_YUV420PackedSemiPlanar_Tiled_INTEL:
case HAL_PIXEL_FORMAT_P010_INTEL:
return true;
default:
break;
}
return false;
}

MfxVaFrameAllocator::MfxVaFrameAllocator(VADisplay dpy)
: m_dpy(dpy)
{
Expand Down Expand Up @@ -546,6 +559,8 @@ mfxStatus MfxVaFrameAllocator::CreateSurfaceFromGralloc(const MfxGrallocModule::
if (IS_PRIME_VALID(info.prime)) {
surfExtBuf.buffers = (uintptr_t *)&info.prime;
surfExtBuf.flags = VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME;
if (isTiledGrallocFourcc(info.format))
surfExtBuf.flags |= VA_SURFACE_EXTBUF_DESC_ENABLE_TILING;
} else {
surfExtBuf.buffers = (uintptr_t *)&info.handle;
surfExtBuf.flags = VA_SURFACE_ATTRIB_MEM_TYPE_ANDROID_GRALLOC;
Expand Down