From bcec635f0ac7958a471f442f4bfc1321d350b98a Mon Sep 17 00:00:00 2001 From: Eino-Ville Talvala Date: Mon, 21 Oct 2024 01:01:24 +0000 Subject: [PATCH] Unfreeze graphics.common HAL and add YCBCR_P210 format YCBCR_P210 is a 10-bit 4:2:2 YCbCr color format Test: Builds, camera/media/graphics CTS continues to pass Flag: EXEMPT HAL interface change Bug: 368395888 Merged-In: I6609870be75675dd08c2203d4b5be49ebd1de447 Change-Id: I6609870be75675dd08c2203d4b5be49ebd1de447 --- graphics/common/aidl/Android.bp | 2 +- .../hardware/graphics/common/PixelFormat.aidl | 1 + .../hardware/graphics/common/PixelFormat.aidl | 22 +++++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/graphics/common/aidl/Android.bp b/graphics/common/aidl/Android.bp index c28da4ceb6..3c75d7bbe2 100644 --- a/graphics/common/aidl/Android.bp +++ b/graphics/common/aidl/Android.bp @@ -43,7 +43,7 @@ aidl_interface { enabled: true, }, }, - frozen: true, + frozen: false, versions_with_info: [ { version: "1", diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PixelFormat.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PixelFormat.aidl index ed84a44b4f..54a9d8dcc9 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PixelFormat.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PixelFormat.aidl @@ -68,4 +68,5 @@ enum PixelFormat { R_16_UINT = 0x39, RG_1616_UINT = 0x3a, RGBA_10101010 = 0x3b, + YCBCR_P210 = 0x3c, } diff --git a/graphics/common/aidl/android/hardware/graphics/common/PixelFormat.aidl b/graphics/common/aidl/android/hardware/graphics/common/PixelFormat.aidl index 1117504c43..55be4d256c 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/PixelFormat.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/PixelFormat.aidl @@ -531,4 +531,26 @@ enum PixelFormat { * interpretation is defined by the dataspace. */ RGBA_10101010 = 0x3b, + + /** + * YCBCR_P210 is a 4:2:2 YCbCr semiplanar format comprised of a WxH Y plane + * followed by a WxH CbCr plane. Each sample is represented by a 16-bit + * little-endian value, with the lower 6 bits set to zero. + * + * This format must be accepted by the allocator when used with the + * following usage flags: + * + * - BufferUsage::VIDEO_* + * - BufferUsage::CPU_* + * - BufferUsage::GPU_TEXTURE + * + * The component values are unsigned normalized to the range [0, 1], whose + * interpretation is defined by the dataspace. + * + * This format is appropriate for 10bit video content. + * + * Buffers with this format must be locked with IMapper::lockYCbCr + * or with IMapper::lock. + */ + YCBCR_P210 = 0x3c, }