From fc489cac9e1286b3f3ccd2cf4097654271901401 Mon Sep 17 00:00:00 2001 From: John Reck Date: Fri, 9 Jun 2023 16:46:49 -0400 Subject: [PATCH] Add ChromaSiting VERTICAL & BOTH Bug: 221248303 Test: make Change-Id: Ib5a3db2b580c1a063ae176ba3718cdd3ed7e1e9c --- graphics/common/aidl/Android.bp | 2 +- .../hardware/graphics/common/BufferUsage.aidl | 48 ++++---- .../graphics/common/ChromaSiting.aidl | 2 + .../hardware/graphics/common/Dataspace.aidl | 116 +++++++++--------- .../hardware/graphics/common/PixelFormat.aidl | 64 +++++----- .../common/PlaneLayoutComponentType.aidl | 16 +-- .../hardware/graphics/common/Transform.aidl | 10 +- .../graphics/common/ChromaSiting.aidl | 8 ++ 8 files changed, 138 insertions(+), 128 deletions(-) diff --git a/graphics/common/aidl/Android.bp b/graphics/common/aidl/Android.bp index 02334e85c2..142c7c17be 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/BufferUsage.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/BufferUsage.aidl index d3ab44f2ce..d42a6d57b8 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/BufferUsage.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/BufferUsage.aidl @@ -35,31 +35,31 @@ package android.hardware.graphics.common; /* @hide */ @Backing(type="long") @VintfStability enum BufferUsage { - CPU_READ_MASK = 15, + CPU_READ_MASK = 0xf, CPU_READ_NEVER = 0, CPU_READ_RARELY = 2, CPU_READ_OFTEN = 3, - CPU_WRITE_MASK = 240, - CPU_WRITE_NEVER = 0, - CPU_WRITE_RARELY = 32, - CPU_WRITE_OFTEN = 48, - GPU_TEXTURE = 256, - GPU_RENDER_TARGET = 512, - COMPOSER_OVERLAY = 2048, - COMPOSER_CLIENT_TARGET = 4096, - PROTECTED = 16384, - COMPOSER_CURSOR = 32768, - VIDEO_ENCODER = 65536, - CAMERA_OUTPUT = 131072, - CAMERA_INPUT = 262144, - RENDERSCRIPT = 1048576, - VIDEO_DECODER = 4194304, - SENSOR_DIRECT_DATA = 8388608, - GPU_DATA_BUFFER = 16777216, - GPU_CUBE_MAP = 33554432, - GPU_MIPMAP_COMPLETE = 67108864, - HW_IMAGE_ENCODER = 134217728, - FRONT_BUFFER = 4294967296, - VENDOR_MASK = -268435456, - VENDOR_MASK_HI = -281474976710656, + CPU_WRITE_MASK = (0xf << 4) /* 240 */, + CPU_WRITE_NEVER = (0 << 4) /* 0 */, + CPU_WRITE_RARELY = (2 << 4) /* 32 */, + CPU_WRITE_OFTEN = (3 << 4) /* 48 */, + GPU_TEXTURE = (1 << 8) /* 256 */, + GPU_RENDER_TARGET = (1 << 9) /* 512 */, + COMPOSER_OVERLAY = (1 << 11) /* 2048 */, + COMPOSER_CLIENT_TARGET = (1 << 12) /* 4096 */, + PROTECTED = (1 << 14) /* 16384 */, + COMPOSER_CURSOR = (1 << 15) /* 32768 */, + VIDEO_ENCODER = (1 << 16) /* 65536 */, + CAMERA_OUTPUT = (1 << 17) /* 131072 */, + CAMERA_INPUT = (1 << 18) /* 262144 */, + RENDERSCRIPT = (1 << 20) /* 1048576 */, + VIDEO_DECODER = (1 << 22) /* 4194304 */, + SENSOR_DIRECT_DATA = (1 << 23) /* 8388608 */, + GPU_DATA_BUFFER = (1 << 24) /* 16777216 */, + GPU_CUBE_MAP = (1 << 25) /* 33554432 */, + GPU_MIPMAP_COMPLETE = (1 << 26) /* 67108864 */, + HW_IMAGE_ENCODER = (1 << 27) /* 134217728 */, + FRONT_BUFFER = (1L << 32) /* 4294967296 */, + VENDOR_MASK = (0xf << 28) /* -268435456 */, + VENDOR_MASK_HI = ((1L * 0xffff) << 48) /* -281474976710656 */, } diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ChromaSiting.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ChromaSiting.aidl index b8af644604..784fc1798a 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ChromaSiting.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ChromaSiting.aidl @@ -39,4 +39,6 @@ enum ChromaSiting { UNKNOWN = 1, SITED_INTERSTITIAL = 2, COSITED_HORIZONTAL = 3, + COSITED_VERTICAL = 4, + COSITED_BOTH = 5, } diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Dataspace.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Dataspace.aidl index 563b6c1ac4..d9ff5aabed 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Dataspace.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Dataspace.aidl @@ -35,65 +35,65 @@ package android.hardware.graphics.common; /* @hide */ @Backing(type="int") @VintfStability enum Dataspace { - UNKNOWN = 0, - ARBITRARY = 1, + UNKNOWN = 0x0, + ARBITRARY = 0x1, STANDARD_SHIFT = 16, - STANDARD_MASK = 4128768, - STANDARD_UNSPECIFIED = 0, - STANDARD_BT709 = 65536, - STANDARD_BT601_625 = 131072, - STANDARD_BT601_625_UNADJUSTED = 196608, - STANDARD_BT601_525 = 262144, - STANDARD_BT601_525_UNADJUSTED = 327680, - STANDARD_BT2020 = 393216, - STANDARD_BT2020_CONSTANT_LUMINANCE = 458752, - STANDARD_BT470M = 524288, - STANDARD_FILM = 589824, - STANDARD_DCI_P3 = 655360, - STANDARD_ADOBE_RGB = 720896, + STANDARD_MASK = (63 << 16) /* 4128768 */, + STANDARD_UNSPECIFIED = (0 << 16) /* 0 */, + STANDARD_BT709 = (1 << 16) /* 65536 */, + STANDARD_BT601_625 = (2 << 16) /* 131072 */, + STANDARD_BT601_625_UNADJUSTED = (3 << 16) /* 196608 */, + STANDARD_BT601_525 = (4 << 16) /* 262144 */, + STANDARD_BT601_525_UNADJUSTED = (5 << 16) /* 327680 */, + STANDARD_BT2020 = (6 << 16) /* 393216 */, + STANDARD_BT2020_CONSTANT_LUMINANCE = (7 << 16) /* 458752 */, + STANDARD_BT470M = (8 << 16) /* 524288 */, + STANDARD_FILM = (9 << 16) /* 589824 */, + STANDARD_DCI_P3 = (10 << 16) /* 655360 */, + STANDARD_ADOBE_RGB = (11 << 16) /* 720896 */, TRANSFER_SHIFT = 22, - TRANSFER_MASK = 130023424, - TRANSFER_UNSPECIFIED = 0, - TRANSFER_LINEAR = 4194304, - TRANSFER_SRGB = 8388608, - TRANSFER_SMPTE_170M = 12582912, - TRANSFER_GAMMA2_2 = 16777216, - TRANSFER_GAMMA2_6 = 20971520, - TRANSFER_GAMMA2_8 = 25165824, - TRANSFER_ST2084 = 29360128, - TRANSFER_HLG = 33554432, + TRANSFER_MASK = (31 << 22) /* 130023424 */, + TRANSFER_UNSPECIFIED = (0 << 22) /* 0 */, + TRANSFER_LINEAR = (1 << 22) /* 4194304 */, + TRANSFER_SRGB = (2 << 22) /* 8388608 */, + TRANSFER_SMPTE_170M = (3 << 22) /* 12582912 */, + TRANSFER_GAMMA2_2 = (4 << 22) /* 16777216 */, + TRANSFER_GAMMA2_6 = (5 << 22) /* 20971520 */, + TRANSFER_GAMMA2_8 = (6 << 22) /* 25165824 */, + TRANSFER_ST2084 = (7 << 22) /* 29360128 */, + TRANSFER_HLG = (8 << 22) /* 33554432 */, RANGE_SHIFT = 27, - RANGE_MASK = 939524096, - RANGE_UNSPECIFIED = 0, - RANGE_FULL = 134217728, - RANGE_LIMITED = 268435456, - RANGE_EXTENDED = 402653184, - SRGB_LINEAR = 138477568, - SCRGB_LINEAR = 406913024, - SRGB = 142671872, - SCRGB = 411107328, - JFIF = 146931712, - BT601_625 = 281149440, - BT601_525 = 281280512, - BT709 = 281083904, - DCI_P3_LINEAR = 139067392, - DCI_P3 = 155844608, - DISPLAY_P3_LINEAR = 139067392, - DISPLAY_P3 = 143261696, - ADOBE_RGB = 151715840, - BT2020_LINEAR = 138805248, - BT2020 = 147193856, - BT2020_PQ = 163971072, - DEPTH = 4096, - SENSOR = 4097, - BT2020_ITU = 281411584, - BT2020_ITU_PQ = 298188800, - BT2020_ITU_HLG = 302383104, - BT2020_HLG = 168165376, - DISPLAY_BT2020 = 142999552, - DYNAMIC_DEPTH = 4098, - JPEG_APP_SEGMENTS = 4099, - HEIF = 4100, - JPEG_R = 4101, - BT709_FULL_RANGE = 146866176, + RANGE_MASK = (7 << 27) /* 939524096 */, + RANGE_UNSPECIFIED = (0 << 27) /* 0 */, + RANGE_FULL = (1 << 27) /* 134217728 */, + RANGE_LIMITED = (2 << 27) /* 268435456 */, + RANGE_EXTENDED = (3 << 27) /* 402653184 */, + SRGB_LINEAR = (((1 << 16) | (1 << 22)) | (1 << 27)) /* 138477568 */, + SCRGB_LINEAR = (((1 << 16) | (1 << 22)) | (3 << 27)) /* 406913024 */, + SRGB = (((1 << 16) | (2 << 22)) | (1 << 27)) /* 142671872 */, + SCRGB = (((1 << 16) | (2 << 22)) | (3 << 27)) /* 411107328 */, + JFIF = (((2 << 16) | (3 << 22)) | (1 << 27)) /* 146931712 */, + BT601_625 = (((2 << 16) | (3 << 22)) | (2 << 27)) /* 281149440 */, + BT601_525 = (((4 << 16) | (3 << 22)) | (2 << 27)) /* 281280512 */, + BT709 = (((1 << 16) | (3 << 22)) | (2 << 27)) /* 281083904 */, + DCI_P3_LINEAR = (((10 << 16) | (1 << 22)) | (1 << 27)) /* 139067392 */, + DCI_P3 = (((10 << 16) | (5 << 22)) | (1 << 27)) /* 155844608 */, + DISPLAY_P3_LINEAR = (((10 << 16) | (1 << 22)) | (1 << 27)) /* 139067392 */, + DISPLAY_P3 = (((10 << 16) | (2 << 22)) | (1 << 27)) /* 143261696 */, + ADOBE_RGB = (((11 << 16) | (4 << 22)) | (1 << 27)) /* 151715840 */, + BT2020_LINEAR = (((6 << 16) | (1 << 22)) | (1 << 27)) /* 138805248 */, + BT2020 = (((6 << 16) | (3 << 22)) | (1 << 27)) /* 147193856 */, + BT2020_PQ = (((6 << 16) | (7 << 22)) | (1 << 27)) /* 163971072 */, + DEPTH = 0x1000, + SENSOR = 0x1001, + BT2020_ITU = (((6 << 16) | (3 << 22)) | (2 << 27)) /* 281411584 */, + BT2020_ITU_PQ = (((6 << 16) | (7 << 22)) | (2 << 27)) /* 298188800 */, + BT2020_ITU_HLG = (((6 << 16) | (8 << 22)) | (2 << 27)) /* 302383104 */, + BT2020_HLG = (((6 << 16) | (8 << 22)) | (1 << 27)) /* 168165376 */, + DISPLAY_BT2020 = (((6 << 16) | (2 << 22)) | (1 << 27)) /* 142999552 */, + DYNAMIC_DEPTH = 0x1002, + JPEG_APP_SEGMENTS = 0x1003, + HEIF = 0x1004, + JPEG_R = 0x1005, + BT709_FULL_RANGE = (((1 << 16) | (3 << 22)) | (1 << 27)) /* 146866176 */, } 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 68857e816f..ed84a44b4f 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 @@ -36,36 +36,36 @@ package android.hardware.graphics.common; @Backing(type="int") @VintfStability enum PixelFormat { UNSPECIFIED = 0, - RGBA_8888 = 1, - RGBX_8888 = 2, - RGB_888 = 3, - RGB_565 = 4, - BGRA_8888 = 5, - YCBCR_422_SP = 16, - YCRCB_420_SP = 17, - YCBCR_422_I = 20, - RGBA_FP16 = 22, - RAW16 = 32, - BLOB = 33, - IMPLEMENTATION_DEFINED = 34, - YCBCR_420_888 = 35, - RAW_OPAQUE = 36, - RAW10 = 37, - RAW12 = 38, - RGBA_1010102 = 43, - Y8 = 538982489, - Y16 = 540422489, - YV12 = 842094169, - DEPTH_16 = 48, - DEPTH_24 = 49, - DEPTH_24_STENCIL_8 = 50, - DEPTH_32F = 51, - DEPTH_32F_STENCIL_8 = 52, - STENCIL_8 = 53, - YCBCR_P010 = 54, - HSV_888 = 55, - R_8 = 56, - R_16_UINT = 57, - RG_1616_UINT = 58, - RGBA_10101010 = 59, + RGBA_8888 = 0x1, + RGBX_8888 = 0x2, + RGB_888 = 0x3, + RGB_565 = 0x4, + BGRA_8888 = 0x5, + YCBCR_422_SP = 0x10, + YCRCB_420_SP = 0x11, + YCBCR_422_I = 0x14, + RGBA_FP16 = 0x16, + RAW16 = 0x20, + BLOB = 0x21, + IMPLEMENTATION_DEFINED = 0x22, + YCBCR_420_888 = 0x23, + RAW_OPAQUE = 0x24, + RAW10 = 0x25, + RAW12 = 0x26, + RGBA_1010102 = 0x2B, + Y8 = 0x20203859, + Y16 = 0x20363159, + YV12 = 0x32315659, + DEPTH_16 = 0x30, + DEPTH_24 = 0x31, + DEPTH_24_STENCIL_8 = 0x32, + DEPTH_32F = 0x33, + DEPTH_32F_STENCIL_8 = 0x34, + STENCIL_8 = 0x35, + YCBCR_P010 = 0x36, + HSV_888 = 0x37, + R_8 = 0x38, + R_16_UINT = 0x39, + RG_1616_UINT = 0x3a, + RGBA_10101010 = 0x3b, } diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayoutComponentType.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayoutComponentType.aidl index 8ba93811a4..e3067515fd 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayoutComponentType.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayoutComponentType.aidl @@ -35,12 +35,12 @@ package android.hardware.graphics.common; /* @hide */ @Backing(type="long") @VintfStability enum PlaneLayoutComponentType { - Y = 1, - CB = 2, - CR = 4, - R = 1024, - G = 2048, - B = 4096, - RAW = 1048576, - A = 1073741824, + Y = (1 << 0) /* 1 */, + CB = (1 << 1) /* 2 */, + CR = (1 << 2) /* 4 */, + R = (1 << 10) /* 1024 */, + G = (1 << 11) /* 2048 */, + B = (1 << 12) /* 4096 */, + RAW = (1 << 20) /* 1048576 */, + A = (1 << 30) /* 1073741824 */, } diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Transform.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Transform.aidl index 986d089027..dbed57dae6 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Transform.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Transform.aidl @@ -36,9 +36,9 @@ package android.hardware.graphics.common; @Backing(type="int") @VintfStability enum Transform { NONE = 0, - FLIP_H = 1, - FLIP_V = 2, - ROT_90 = 4, - ROT_180 = 3, - ROT_270 = 7, + FLIP_H = (1 << 0) /* 1 */, + FLIP_V = (1 << 1) /* 2 */, + ROT_90 = (1 << 2) /* 4 */, + ROT_180 = (FLIP_H | FLIP_V) /* 3 */, + ROT_270 = ((FLIP_H | FLIP_V) | ROT_90) /* 7 */, } diff --git a/graphics/common/aidl/android/hardware/graphics/common/ChromaSiting.aidl b/graphics/common/aidl/android/hardware/graphics/common/ChromaSiting.aidl index ac448535e8..7da45daa6d 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/ChromaSiting.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/ChromaSiting.aidl @@ -37,4 +37,12 @@ enum ChromaSiting { * Cb and Cr are vertically sited interstitially. * This is used by 4:2:0 for MPEG-2 frame pictures. */ COSITED_HORIZONTAL = 3, + + /* Cb and Cr are horizontally sited interstitially with a luma sample. + * Cb and Cr are vertically sited coincident. */ + COSITED_VERTICAL = 4, + + /* Cb and Cr are both horizontally & vertically sited coincident + * with a luma sample. */ + COSITED_BOTH = 5, }