gralloc: 8974: handle YV12 format in lock_ycbcr

Bug: 21596364
Change-Id: I47030cbca4188d983b5b12b909881bb7b37d36ff
diff --git a/msm8974/libgralloc/mapper.cpp b/msm8974/libgralloc/mapper.cpp
index 6579aac..4f43d40 100644
--- a/msm8974/libgralloc/mapper.cpp
+++ b/msm8974/libgralloc/mapper.cpp
@@ -275,6 +275,18 @@
                 ycbcr->cstride = cstride;
                 ycbcr->chroma_step = 2;
                 break;
+              //Planar
+            case HAL_PIXEL_FORMAT_YV12:
+                ystride = hnd->width;
+                cstride = ALIGN(hnd->width/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;
+                break;
             default:
                 ALOGD("%s: Invalid format passed: 0x%x", __FUNCTION__,
                       hnd->format);