display: Add color Metadata
- Add color aspects and HDR10 related static metadata which will be used in the existing metadata structure. - Clients can use COLOR_METADATA to update the CSC information - UPDATE_COLOR_SPACE is legacy and will be used when COLOR_METADATA is not set. - Update gralloc to return color space when set from COLOR_METADATA - Gaurd the usage with USE_COLOR_METADATA for cobalt. Change-Id: I460accf6cd2bb7a305c7e93284955e566a5b7532 Crs-fixed: 1074172
This commit is contained in:
committed by
Gerrit - the friendly Code Review server
parent
8b3dddc082
commit
b2771bff77
@@ -588,7 +588,27 @@ gralloc1_error_t BufferManager::Perform(int operation, va_list args) {
|
||||
return GRALLOC1_ERROR_BAD_HANDLE;
|
||||
}
|
||||
MetaData_t *metadata = reinterpret_cast<MetaData_t *>(hnd->base_metadata);
|
||||
if (metadata && metadata->operation & UPDATE_COLOR_SPACE) {
|
||||
if (!metadata) {
|
||||
return GRALLOC1_ERROR_BAD_HANDLE;
|
||||
#ifdef USE_COLOR_METADATA
|
||||
} else if (metadata->operation & COLOR_METADATA) {
|
||||
ColorMetaData *colorMetadata = &metadata->color;
|
||||
switch (colorMetadata->colorPrimaries) {
|
||||
case ColorPrimaries_BT709_5:
|
||||
*color_space = HAL_CSC_ITU_R_709;
|
||||
break;
|
||||
case ColorPrimaries_BT601_6_525:
|
||||
*color_space = ((colorMetadata->range) ? HAL_CSC_ITU_R_601_FR : HAL_CSC_ITU_R_601);
|
||||
break;
|
||||
case ColorPrimaries_BT2020:
|
||||
*color_space = (colorMetadata->range) ? HAL_CSC_ITU_R_2020_FR : HAL_CSC_ITU_R_2020;
|
||||
break;
|
||||
default:
|
||||
ALOGE("Unknown Color Space = %d", colorMetadata->colorPrimaries);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
} else if (metadata->operation & UPDATE_COLOR_SPACE) {
|
||||
*color_space = metadata->colorSpace;
|
||||
}
|
||||
} break;
|
||||
|
||||
Reference in New Issue
Block a user