gralloc: Default camera buffers to full range
Certain apps use camera gralloc flags and expect full range buffers without touching the metadata. Change-Id: Ifdd000b0600d87f42e167b9c58a1ab4029ddeae5 CRs-fixed: 961720
This commit is contained in:
@@ -136,6 +136,11 @@ int gpu_context_t::gralloc_alloc_buffer(unsigned int size, int usage,
|
|||||||
flags |= private_handle_t::PRIV_FLAGS_CPU_RENDERED;
|
flags |= private_handle_t::PRIV_FLAGS_CPU_RENDERED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ColorSpace_t colorSpace = ITU_R_601;
|
||||||
|
if (usage & GRALLOC_USAGE_HW_CAMERA_MASK) {
|
||||||
|
colorSpace = ITU_R_601_FR;
|
||||||
|
}
|
||||||
|
|
||||||
if (usage & (GRALLOC_USAGE_HW_VIDEO_ENCODER |
|
if (usage & (GRALLOC_USAGE_HW_VIDEO_ENCODER |
|
||||||
GRALLOC_USAGE_HW_CAMERA_WRITE |
|
GRALLOC_USAGE_HW_CAMERA_WRITE |
|
||||||
GRALLOC_USAGE_HW_RENDER |
|
GRALLOC_USAGE_HW_RENDER |
|
||||||
@@ -160,7 +165,6 @@ int gpu_context_t::gralloc_alloc_buffer(unsigned int size, int usage,
|
|||||||
hnd->offset = data.offset;
|
hnd->offset = data.offset;
|
||||||
hnd->base = (uint64_t)(data.base) + data.offset;
|
hnd->base = (uint64_t)(data.base) + data.offset;
|
||||||
hnd->gpuaddr = 0;
|
hnd->gpuaddr = 0;
|
||||||
ColorSpace_t colorSpace = ITU_R_601;
|
|
||||||
setMetaData(hnd, UPDATE_COLOR_SPACE, (void*) &colorSpace);
|
setMetaData(hnd, UPDATE_COLOR_SPACE, (void*) &colorSpace);
|
||||||
|
|
||||||
*pHandle = hnd;
|
*pHandle = hnd;
|
||||||
|
|||||||
Reference in New Issue
Block a user