gralloc: Use only metadata for color space

Currently both handle metadata and handle flags are used to indicate
the color space. This change deprecates support for flags.

Also gralloc doesn't set a color space based on use case anymore,
since front-end requirements keep changing. The default is set to 601
and the onus of correctly specifying the color space now rests on
clients.

CRs-fixed: 919117

Change-Id: I4988830e22804517b393c60dbe641d3bd1d790ec
This commit is contained in:
Saurabh Shah
2015-09-30 13:31:55 -07:00
committed by Gerrit - the friendly Code Review server
parent b740c118fe
commit bddb9529c8
2 changed files with 5 additions and 24 deletions

View File

@@ -95,31 +95,11 @@ int gpu_context_t::gralloc_alloc_buffer(unsigned int size, int usage,
if (usage & GRALLOC_USAGE_PRIVATE_EXTERNAL_ONLY) {
flags |= private_handle_t::PRIV_FLAGS_EXTERNAL_ONLY;
}
if (usage & GRALLOC_USAGE_PRIVATE_INTERNAL_ONLY) {
flags |= private_handle_t::PRIV_FLAGS_INTERNAL_ONLY;
}
ColorSpace_t colorSpace = ITU_R_601;
flags |= private_handle_t::PRIV_FLAGS_ITU_R_601;
if (bufferType == BUFFER_TYPE_VIDEO) {
if (usage & GRALLOC_USAGE_HW_CAMERA_WRITE) {
// Per the camera spec ITU 709 format should be set only for
// video encoding.
// It should be set to ITU 601 full range format for any other
// camera buffer
//
if (usage & GRALLOC_USAGE_HW_CAMERA_MASK) {
if (usage & GRALLOC_USAGE_HW_VIDEO_ENCODER) {
flags |= private_handle_t::PRIV_FLAGS_ITU_R_709;
colorSpace = ITU_R_709;
} else {
flags |= private_handle_t::PRIV_FLAGS_ITU_R_601_FR;
colorSpace = ITU_R_601_FR;
}
}
}
}
if (usage & GRALLOC_USAGE_HW_VIDEO_ENCODER ) {
flags |= private_handle_t::PRIV_FLAGS_VIDEO_ENCODER;
}
@@ -176,6 +156,7 @@ int gpu_context_t::gralloc_alloc_buffer(unsigned int size, int usage,
hnd->offset = data.offset;
hnd->base = (uint64_t)(data.base) + data.offset;
hnd->gpuaddr = 0;
ColorSpace_t colorSpace = ITU_R_601;
setMetaData(hnd, UPDATE_COLOR_SPACE, (void*) &colorSpace);
*pHandle = hnd;

View File

@@ -193,9 +193,9 @@ struct private_handle_t : public native_handle {
PRIV_FLAGS_CAMERA_READ = 0x00040000,
PRIV_FLAGS_HW_COMPOSER = 0x00080000,
PRIV_FLAGS_HW_TEXTURE = 0x00100000,
PRIV_FLAGS_ITU_R_601 = 0x00200000,
PRIV_FLAGS_ITU_R_601_FR = 0x00400000,
PRIV_FLAGS_ITU_R_709 = 0x00800000,
PRIV_FLAGS_ITU_R_601 = 0x00200000, //Unused from display
PRIV_FLAGS_ITU_R_601_FR = 0x00400000, //Unused from display
PRIV_FLAGS_ITU_R_709 = 0x00800000, //Unused from display
PRIV_FLAGS_SECURE_DISPLAY = 0x01000000,
// Buffer is rendered in Tile Format
PRIV_FLAGS_TILE_RENDERED = 0x02000000,