gralloc: Use adreno_utils api for NV21 and NV12 alignment
Use adreno_utils api to get stride alignment requirement by GPU for NV21 & NV12 formats. It is required to keep Camera & Gralloc in sync. CRs-Fixed: 880927 Change-Id: Ie71f864c975e38fe4aa58735cc8ffe9dd0734f4f
This commit is contained in:
@@ -105,6 +105,7 @@ AdrenoMemInfo::AdrenoMemInfo()
|
||||
LINK_adreno_isMacroTilingSupportedByGpu = NULL;
|
||||
LINK_adreno_compute_compressedfmt_aligned_width_and_height = NULL;
|
||||
LINK_adreno_isUBWCSupportedByGpu = NULL;
|
||||
LINK_adreno_get_gpu_pixel_alignment = NULL;
|
||||
|
||||
libadreno_utils = ::dlopen("libadreno_utils.so", RTLD_NOW);
|
||||
if (libadreno_utils) {
|
||||
@@ -119,6 +120,8 @@ AdrenoMemInfo::AdrenoMemInfo()
|
||||
"compute_compressedfmt_aligned_width_and_height");
|
||||
*(void **)&LINK_adreno_isUBWCSupportedByGpu =
|
||||
::dlsym(libadreno_utils, "isUBWCSupportedByGpu");
|
||||
*(void **)&LINK_adreno_get_gpu_pixel_alignment =
|
||||
::dlsym(libadreno_utils, "get_gpu_pixel_alignment");
|
||||
}
|
||||
|
||||
// Check if the overriding property debug.gralloc.gfx_ubwc_disable
|
||||
@@ -189,11 +192,18 @@ void AdrenoMemInfo::getAlignedWidthAndHeight(int width, int height, int format,
|
||||
|
||||
aligned_w = width;
|
||||
aligned_h = height;
|
||||
int alignment = 32;
|
||||
switch (format)
|
||||
{
|
||||
case HAL_PIXEL_FORMAT_YCrCb_420_SP:
|
||||
case HAL_PIXEL_FORMAT_YCbCr_420_SP:
|
||||
if (LINK_adreno_get_gpu_pixel_alignment) {
|
||||
alignment = LINK_adreno_get_gpu_pixel_alignment();
|
||||
}
|
||||
aligned_w = ALIGN(width, alignment);
|
||||
break;
|
||||
case HAL_PIXEL_FORMAT_YCrCb_420_SP_ADRENO:
|
||||
aligned_w = ALIGN(width, 32);
|
||||
aligned_w = ALIGN(width, alignment);
|
||||
break;
|
||||
case HAL_PIXEL_FORMAT_RAW16:
|
||||
aligned_w = ALIGN(width, 16);
|
||||
@@ -204,7 +214,6 @@ void AdrenoMemInfo::getAlignedWidthAndHeight(int width, int height, int format,
|
||||
case HAL_PIXEL_FORMAT_YCbCr_420_SP_TILED:
|
||||
aligned_w = ALIGN(width, 128);
|
||||
break;
|
||||
case HAL_PIXEL_FORMAT_YCbCr_420_SP:
|
||||
case HAL_PIXEL_FORMAT_YV12:
|
||||
case HAL_PIXEL_FORMAT_YCbCr_422_SP:
|
||||
case HAL_PIXEL_FORMAT_YCrCb_422_SP:
|
||||
|
||||
Reference in New Issue
Block a user