gralloc: Perform func to return stride and height

The custom stride and height can be set by video
decoder for smooth streaming. Return this in
perform so that graphics can use it

Change-Id: I44c814b2bae1f61d3ec5c36a22d1c6119542b10a
diff --git a/libgralloc/mapper.cpp b/libgralloc/mapper.cpp
index c3ae070..62a6ee5 100644
--- a/libgralloc/mapper.cpp
+++ b/libgralloc/mapper.cpp
@@ -364,6 +364,25 @@
                 res = 0;
             } break;
 
+        case GRALLOC_MODULE_PERFORM_GET_CUSTOM_STRIDE_AND_HEIGHT_FROM_HANDLE:
+            {
+                private_handle_t* hnd =  va_arg(args, private_handle_t*);
+                int *stride = va_arg(args, int *);
+                int *height = va_arg(args, int *);
+                if (private_handle_t::validate(hnd)) {
+                    return res;
+                }
+                MetaData_t *metadata = (MetaData_t *)hnd->base_metadata;
+                if(metadata && metadata->operation & UPDATE_BUFFER_GEOMETRY) {
+                    *stride = metadata->bufferDim.sliceWidth;
+                    *height = metadata->bufferDim.sliceHeight;
+                } else {
+                    *stride = hnd->width;
+                    *height = hnd->height;
+                }
+                res = 0;
+            } break;
+
         case GRALLOC_MODULE_PERFORM_GET_ATTRIBUTES:
             {
                 int width   = va_arg(args, int);