diff options
| author | Lajos Molnar <lajos@google.com> | 2015-06-19 17:36:36 -0700 |
|---|---|---|
| committer | Lajos Molnar <lajos@google.com> | 2015-06-19 17:38:45 -0700 |
| commit | d6e36fa315e667055d8f51fcbf9b496737636d60 (patch) | |
| tree | 7721b8936418d03a78ba22e33a458283add21895 /msm8960 | |
| parent | 3b065d79f9764d450a3c09dc5f43f3e1b06a9bff (diff) | |
| download | platform_hardware_qcom_display-d6e36fa315e667055d8f51fcbf9b496737636d60.tar.gz platform_hardware_qcom_display-d6e36fa315e667055d8f51fcbf9b496737636d60.tar.bz2 platform_hardware_qcom_display-d6e36fa315e667055d8f51fcbf9b496737636d60.zip | |
gralloc: 8960: add lock_ycbcr support for HAL_PIXEL_FORMAT_YV12
Bug: 21596464
Change-Id: Ibd469011f8b401a7817a752db07dc7eff1a7b69a
Diffstat (limited to 'msm8960')
| -rw-r--r-- | msm8960/libgralloc/mapper.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/msm8960/libgralloc/mapper.cpp b/msm8960/libgralloc/mapper.cpp index 55a34a9d..f2d6e230 100644 --- a/msm8960/libgralloc/mapper.cpp +++ b/msm8960/libgralloc/mapper.cpp @@ -250,7 +250,7 @@ int gralloc_lock_ycbcr(gralloc_module_t const* module, { private_handle_t* hnd = (private_handle_t*)handle; int err = gralloc_map_and_invalidate(module, handle, usage, l, t, w, h); - int ystride; + int ystride, cstride; if(!err) { //hnd->format holds our implementation defined format //HAL_PIXEL_FORMAT_YCrCb_420_SP is the only one set right now. @@ -276,6 +276,19 @@ int gralloc_lock_ycbcr(gralloc_module_t const* module, ycbcr->chroma_step = 2; memset(ycbcr->reserved, 0, sizeof(ycbcr->reserved)); break; + // YCrCb_420_P + case HAL_PIXEL_FORMAT_YV12: + ystride = ALIGN(hnd->width, 16); + cstride = ALIGN(ystride / 2, 16); + ycbcr->y = (void*)hnd->base; + ycbcr->cr = (void*)(hnd->base + ystride * hnd->height); + ycbcr->cb = (void*)(hnd->base + ystride * hnd->height + + cstride * hnd->height / 2); + ycbcr->ystride = ystride; + ycbcr->cstride = cstride; + ycbcr->chroma_step = 1; + memset(ycbcr->reserved, 0, sizeof(ycbcr->reserved)); + break; default: ALOGD("%s: Invalid format passed: 0x%x", __FUNCTION__, hnd->format); |
