gralloc: 8960: handle YCbCr 420SP format in lock_ycbcr

Bug: 17906609
Change-Id: I28476291908f564477bb1d7a34196aed3e811f0d
This commit is contained in:
Praveen Chavan 2015-02-02 09:44:58 -08:00 committed by Lajos Molnar
parent adc3f5944f
commit 41b4b6aab2
1 changed files with 11 additions and 0 deletions

View File

@ -265,6 +265,17 @@ int gralloc_lock_ycbcr(gralloc_module_t const* module,
ycbcr->chroma_step = 2;
memset(ycbcr->reserved, 0, sizeof(ycbcr->reserved));
break;
// YCbCr_420_SP
case HAL_PIXEL_FORMAT_NV12:
ystride = ALIGN(hnd->width, 16);
ycbcr->y = (void*)hnd->base;
ycbcr->cb = (void*)(hnd->base + ystride * hnd->height);
ycbcr->cr = (void*)(hnd->base + ystride * hnd->height + 1);
ycbcr->ystride = ystride;
ycbcr->cstride = ystride;
ycbcr->chroma_step = 2;
memset(ycbcr->reserved, 0, sizeof(ycbcr->reserved));
break;
default:
ALOGD("%s: Invalid format passed: 0x%x", __FUNCTION__,
hnd->format);