libgralloc: Store unaligned buffer resolution in private handle.

Add unaligned_width and unaligned_height in private_handle_t to store
the buffer resolution without alignment that client asked to allocate.

Change-Id: I28d757af4178f581e6a83dc06198106c85fc7262
CRs-Fixed: 1040942
diff --git a/libgralloc/alloc_controller.cpp b/libgralloc/alloc_controller.cpp
index 0ef0a9a..8d43f98 100644
--- a/libgralloc/alloc_controller.cpp
+++ b/libgralloc/alloc_controller.cpp
@@ -180,6 +180,18 @@
 
 }
 
+void AdrenoMemInfo::getUnalignedWidthAndHeight(const private_handle_t *hnd, int& unaligned_w,
+                                               int& unaligned_h) {
+    MetaData_t *metadata = (MetaData_t *)hnd->base_metadata;
+    if(metadata && metadata->operation & UPDATE_BUFFER_GEOMETRY) {
+        unaligned_w = metadata->bufferDim.sliceWidth;
+        unaligned_h = metadata->bufferDim.sliceHeight;
+    } else {
+        unaligned_w = hnd->unaligned_width;
+        unaligned_h = hnd->unaligned_height;
+    }
+}
+
 bool isUncompressedRgbFormat(int format)
 {
     bool is_rgb_format = false;
@@ -709,7 +721,6 @@
     return size;
 }
 
-
 void getBufferAttributes(int width, int height, int format, int usage,
         int& alignedw, int &alignedh, int& tiled, unsigned int& size)
 {
@@ -892,7 +903,7 @@
 
     private_handle_t* hnd = new private_handle_t(data.fd, data.size,
                                                  data.allocType, 0, format,
-                                                 alignedw, alignedh);
+                                                 alignedw, alignedh, -1, 0, 0, w, h);
     hnd->base = (uint64_t) data.base;
     hnd->offset = data.offset;
     hnd->gpuaddr = 0;