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: 64d18f84b0 ("u_gralloc/mapper4: fill u_gralloc_buffer_color_info properly")
Reported-by: Alessandro Astone <ales.astone@gmail.com>
Reviewed-by: Alessandro Astone <ales.astone@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36277>
(cherry picked from commit 2553628369)
This commit is contained in:
Yiwei Zhang 2025-07-22 01:09:20 +00:00 committed by Eric Engestrom
parent 0077c8cae7
commit 991767e9be
2 changed files with 3 additions and 1 deletions

View file

@ -3504,7 +3504,7 @@
"description": "u_gralloc/mapper4: properly expose ChromaSiting types based on api level",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "64d18f84b0b674c4d95fe3b9c92b99b0bada3c53",
"notes": null

View file

@ -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;