From 25536283697e06e57c0daad48c75197e9d014982 Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Tue, 22 Jul 2025 01:09:20 +0000 Subject: [PATCH] u_gralloc/mapper4: properly expose ChromaSiting types based on api level ChromaSiting::COSITED_VERTICAL and ChromaSiting::COSITED_BOTH only exist in api level 35 and above. Fixes: 64d18f84b0b ("u_gralloc/mapper4: fill u_gralloc_buffer_color_info properly") Reported-by: Alessandro Astone Reviewed-by: Alessandro Astone Part-of: --- src/util/u_gralloc/u_gralloc_imapper4_api.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/util/u_gralloc/u_gralloc_imapper4_api.cpp b/src/util/u_gralloc/u_gralloc_imapper4_api.cpp index 941aa95403c..d2d26439cb6 100644 --- a/src/util/u_gralloc/u_gralloc_imapper4_api.cpp +++ b/src/util/u_gralloc/u_gralloc_imapper4_api.cpp @@ -238,6 +238,7 @@ mapper4_get_buffer_color_info(struct u_gralloc *gralloc, out->horizontal_siting = __DRI_YUV_CHROMA_SITING_0; out->vertical_siting = __DRI_YUV_CHROMA_SITING_0_5; break; +#if ANDROID_API_LEVEL >= 35 case ChromaSiting::COSITED_VERTICAL: out->horizontal_siting = __DRI_YUV_CHROMA_SITING_0_5; out->vertical_siting = __DRI_YUV_CHROMA_SITING_0; @@ -246,6 +247,7 @@ mapper4_get_buffer_color_info(struct u_gralloc *gralloc, out->horizontal_siting = __DRI_YUV_CHROMA_SITING_0; out->vertical_siting = __DRI_YUV_CHROMA_SITING_0; break; +#endif case ChromaSiting::SITED_INTERSTITIAL: default: out->horizontal_siting = __DRI_YUV_CHROMA_SITING_0_5;