summaryrefslogtreecommitdiff
path: root/gralloc4/src
diff options
context:
space:
mode:
authorWen Chang Liu <wenchangliu@google.com>2023-01-18 02:09:52 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2023-01-18 02:09:52 +0000
commitf813f511e7c4fa205c563dcb4408bc91347dd528 (patch)
tree751f1a5362d9e0607de8950a37954e7b037a9e0d /gralloc4/src
parent3f14139835513022759a854820d477a85db56c19 (diff)
parent61be54777136dec7cf967f41e48a38ec5909a99a (diff)
downloadgchips-f813f511e7c4fa205c563dcb4408bc91347dd528.tar.gz
Merge "Support single fd formats for MFC codec"
Diffstat (limited to 'gralloc4/src')
-rw-r--r--gralloc4/src/core/format_info.cpp5
-rw-r--r--gralloc4/src/core/mali_gralloc_bufferallocation.cpp9
-rw-r--r--gralloc4/src/core/mali_gralloc_formats.cpp1
-rw-r--r--gralloc4/src/hidl_common/MapperMetadata.cpp11
4 files changed, 13 insertions, 13 deletions
diff --git a/gralloc4/src/core/format_info.cpp b/gralloc4/src/core/format_info.cpp
index 84fae5f..08608fb 100644
--- a/gralloc4/src/core/format_info.cpp
+++ b/gralloc4/src/core/format_info.cpp
@@ -85,8 +85,9 @@ const format_info_t formats[] = {
{ ID(HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP_M_TILED), .npln = 2, .ncmp = { 1, 2, 0 }, .bps = 8, .bpp_afbc = { 0, 0, 0 }, .bpp = { 8, 16, 0 }, .hsub = 2, .vsub = 2, .align_w = 2, .align_h = 2, ALIGN_W_CPU_DEFAULT, .tile_size = 16, .has_alpha = false, .is_rgb = false, .is_yuv = true, .afbc = false, .linear = true, .yuv_transform = false, .flex = true, .planes_contiguous = false },
{ ID(HAL_PIXEL_FORMAT_EXYNOS_YV12_M), .npln = 3, .ncmp = { 1, 1, 1 }, .bps = 8, .bpp_afbc = { 0, 0, 0 }, .bpp = { 8, 8, 8 }, .hsub = 2, .vsub = 2, .align_w = 2, .align_h = 2, ALIGN_W_CPU_DEFAULT, .tile_size = 1, .has_alpha = false, .is_rgb = false, .is_yuv = true, .afbc = false, .linear = true, .yuv_transform = false, .flex = true, .planes_contiguous = false },
{ ID(HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_P_M), .npln = 3, .ncmp = { 1, 1, 1 }, .bps = 8, .bpp_afbc = { 0, 0, 0 }, .bpp = { 8, 8, 8 }, .hsub = 2, .vsub = 2, .align_w = 2, .align_h = 2, ALIGN_W_CPU_DEFAULT, .tile_size = 1, .has_alpha = false, .is_rgb = false, .is_yuv = true, .afbc = false, .linear = true, .yuv_transform = false, .flex = true, .planes_contiguous = false },
- { ID(HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN), .npln = 2, .ncmp = { 1, 2, 0 }, .bps = 8, .bpp_afbc = { 0, 0, 0 }, .bpp = { 8, 16, 0 }, .hsub = 2, .vsub = 2, .align_w = 2, .align_h = 2, ALIGN_W_CPU_DEFAULT, .tile_size = 1, .has_alpha = false, .is_rgb = false, .is_yuv = true, .afbc = false, .linear = true, .yuv_transform = false, .flex = true, .planes_contiguous = false },
+ { ID(HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN), .npln = 2, .ncmp = { 1, 2, 0 }, .bps = 8, .bpp_afbc = { 0, 0, 0 }, .bpp = { 8, 16, 0 }, .hsub = 2, .vsub = 2, .align_w = 64, .align_h = 16, .align_w_cpu = 64, .tile_size = 1, .has_alpha = false, .is_rgb = false, .is_yuv = true, .afbc = false, .linear = true, .yuv_transform = false, .flex = true, .planes_contiguous = false },
{ ID(HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN_S10B), .npln = 2, .ncmp = { 1, 2, 0 }, .bps = 10, .bpp_afbc = { 0, 0, 0 }, .bpp = { 16, 32, 0 }, .hsub = 2, .vsub = 2, .align_w = 2, .align_h = 2, ALIGN_W_CPU_DEFAULT, .tile_size = 1, .has_alpha = false, .is_rgb = false, .is_yuv = true, .afbc = false, .linear = true, .yuv_transform = false, .flex = true, .planes_contiguous = false },
+ { ID(HAL_PIXEL_FORMAT_EXYNOS_YCbCr_P010_SPN), .npln = 2, .ncmp = { 1, 2, 0 }, .bps = 10, .bpp_afbc = { 0, 0, 0 }, .bpp = { 16, 32, 0 }, .hsub = 2, .vsub = 2, .align_w = 64, .align_h = 16, .align_w_cpu = 64, .tile_size = 1, .has_alpha = false, .is_rgb = false, .is_yuv = true, .afbc = false, .linear = true, .yuv_transform = false, .flex = true, .planes_contiguous = false },
{ ID(HAL_PIXEL_FORMAT_EXYNOS_YCbCr_P010_M), .npln = 2, .ncmp = { 1, 2, 0 }, .bps = 10, .bpp_afbc = { 0, 0, 0 }, .bpp = { 16, 32, 0 }, .hsub = 2, .vsub = 2, .align_w = 2, .align_h = 2, ALIGN_W_CPU_DEFAULT, .tile_size = 1, .has_alpha = false, .is_rgb = false, .is_yuv = true, .afbc = false, .linear = true, .yuv_transform = false, .flex = true, .planes_contiguous = false },
{ ID(HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_P), .npln = 3, .ncmp = { 1, 1, 1 }, .bps = 8, .bpp_afbc = { 0, 0, 0 }, .bpp = { 8, 8, 8 }, .hsub = 2, .vsub = 2, .align_w = 2, .align_h = 2, .align_w_cpu = 16, .tile_size = 1, .has_alpha = false, .is_rgb = false, .is_yuv = true, .afbc = false, .linear = true, .yuv_transform = false, .flex = true, .planes_contiguous = false },
{ ID(HAL_PIXEL_FORMAT_YCrCb_420_SP), .npln = 2, .ncmp = { 1, 2, 0 }, .bps = 8, .bpp_afbc = { 0, 0, 0 }, .bpp = { 8, 16, 0 }, .hsub = 2, .vsub = 2, .align_w = 2, .align_h = 2, ALIGN_W_CPU_DEFAULT, .tile_size = 1, .has_alpha = false, .is_rgb = false, .is_yuv = true, .afbc = false, .linear = true, .yuv_transform = false, .flex = true, .planes_contiguous = false },
@@ -178,6 +179,7 @@ const format_ip_support_t formats_ip_support[] = {
{ .id = HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP_M_TILED, .cpu_wr = F_LIN, .cpu_rd = F_LIN, .gpu_wr = F_LIN, .gpu_rd = F_LIN, .dpu_wr = F_NONE, .dpu_rd = F_LIN, .dpu_aeu_wr = F_NONE, .vpu_wr = F_LIN, .vpu_rd = F_LIN },
{ .id = HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN, .cpu_wr = F_LIN, .cpu_rd = F_LIN, .gpu_wr = F_LIN, .gpu_rd = F_LIN, .dpu_wr = F_NONE, .dpu_rd = F_LIN, .dpu_aeu_wr = F_NONE, .vpu_wr = F_LIN, .vpu_rd = F_LIN },
{ .id = HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN_S10B, .cpu_wr = F_LIN, .cpu_rd = F_LIN, .gpu_wr = F_LIN, .gpu_rd = F_LIN, .dpu_wr = F_NONE, .dpu_rd = F_LIN, .dpu_aeu_wr = F_NONE, .vpu_wr = F_LIN, .vpu_rd = F_LIN },
+ { .id = HAL_PIXEL_FORMAT_EXYNOS_YCbCr_P010_SPN, .cpu_wr = F_LIN, .cpu_rd = F_LIN, .gpu_wr = F_LIN, .gpu_rd = F_LIN, .dpu_wr = F_NONE, .dpu_rd = F_LIN, .dpu_aeu_wr = F_NONE, .vpu_wr = F_LIN, .vpu_rd = F_LIN },
{ .id = HAL_PIXEL_FORMAT_EXYNOS_YCbCr_P010_M, .cpu_wr = F_LIN, .cpu_rd = F_LIN, .gpu_wr = F_LIN, .gpu_rd = F_LIN, .dpu_wr = F_NONE, .dpu_rd = F_LIN, .dpu_aeu_wr = F_NONE, .vpu_wr = F_LIN, .vpu_rd = F_LIN },
{ .id = HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_P, .cpu_wr = F_LIN, .cpu_rd = F_LIN, .gpu_wr = F_LIN, .gpu_rd = F_LIN, .dpu_wr = F_NONE, .dpu_rd = F_LIN, .dpu_aeu_wr = F_NONE, .vpu_wr = F_LIN, .vpu_rd = F_LIN },
{ .id = HAL_PIXEL_FORMAT_YCrCb_420_SP, .cpu_wr = F_LIN, .cpu_rd = F_LIN, .gpu_wr = F_LIN, .gpu_rd = F_LIN, .dpu_wr = F_NONE, .dpu_rd = F_NONE, .dpu_aeu_wr = F_NONE, .vpu_wr = F_LIN, .vpu_rd = F_LIN },
@@ -265,6 +267,7 @@ static const hal_int_fmt hal_to_internal_format[] =
{ HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP_M_TILED, false, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP_M_TILED},
{ HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN, false, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN },
{ HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN_S10B, false, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN_S10B },
+ { HAL_PIXEL_FORMAT_EXYNOS_YCbCr_P010_SPN, false, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_P010_SPN },
{ HAL_PIXEL_FORMAT_EXYNOS_YCbCr_P010_M, false, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_P010_M },
{ HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_P, false, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_P },
/* SBWC Formats */
diff --git a/gralloc4/src/core/mali_gralloc_bufferallocation.cpp b/gralloc4/src/core/mali_gralloc_bufferallocation.cpp
index f9ed409..2044fe3 100644
--- a/gralloc4/src/core/mali_gralloc_bufferallocation.cpp
+++ b/gralloc4/src/core/mali_gralloc_bufferallocation.cpp
@@ -907,7 +907,7 @@ static int prepare_descriptor_exynos_formats(
break;
case HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN:
- w = GRALLOC_ALIGN(w, 16);
+ w = GRALLOC_ALIGN(w, 64);
h = GRALLOC_ALIGN(h, 16);
fd_count = 1;
plane_count = setup_420_sp(w, h, fd_count, bufDescriptor->plane_info);
@@ -935,6 +935,13 @@ static int prepare_descriptor_exynos_formats(
plane_count = setup_p010_sp(w, h, fd_count, bufDescriptor->plane_info);
break;
+ case HAL_PIXEL_FORMAT_EXYNOS_YCbCr_P010_SPN:
+ w = GRALLOC_ALIGN(w, 64);
+ h = GRALLOC_ALIGN(h, 16);
+ fd_count = 1;
+ plane_count = setup_p010_sp(w, h, fd_count, bufDescriptor->plane_info);
+ break;
+
default:
MALI_GRALLOC_LOGE("invalid yuv format (%s %" PRIx64 ")", format_name(bufDescriptor->alloc_format),
bufDescriptor->alloc_format);
diff --git a/gralloc4/src/core/mali_gralloc_formats.cpp b/gralloc4/src/core/mali_gralloc_formats.cpp
index 60519da..b9f78e2 100644
--- a/gralloc4/src/core/mali_gralloc_formats.cpp
+++ b/gralloc4/src/core/mali_gralloc_formats.cpp
@@ -1621,6 +1621,7 @@ bool is_exynos_format(uint32_t base_format)
case HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN:
case HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP_M_S10B:
case HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN_S10B:
+ case HAL_PIXEL_FORMAT_EXYNOS_YCbCr_P010_SPN:
case HAL_PIXEL_FORMAT_EXYNOS_YCbCr_P010_M:
case HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN_SBWC:
case HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN_10B_SBWC:
diff --git a/gralloc4/src/hidl_common/MapperMetadata.cpp b/gralloc4/src/hidl_common/MapperMetadata.cpp
index 478c4a2..cb0a820 100644
--- a/gralloc4/src/hidl_common/MapperMetadata.cpp
+++ b/gralloc4/src/hidl_common/MapperMetadata.cpp
@@ -310,17 +310,6 @@ static android::status_t get_plane_layouts(const private_handle_t *handle, std::
offset = (int64_t)handle->bases[plane_index] - handle->bases[0];
}
- /* sample increments in bits must be 8 for y plane for lock */
- if (plane_index == 0)
- {
- sample_increment_in_bits = 8;
- }
- /* sample increments in bits must be 8 or 16 for cb/cr plane for lock */
- else if (sample_increment_in_bits > 16)
- {
- sample_increment_in_bits = 16;
- }
-
PlaneLayout layout = {.offsetInBytes = offset,
.sampleIncrementInBits = sample_increment_in_bits,
.strideInBytes = handle->plane_info[plane_index].byte_stride,