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/gpu.cpp b/libgralloc/gpu.cpp
index 5b22e6d..8bae926 100644
--- a/libgralloc/gpu.cpp
+++ b/libgralloc/gpu.cpp
@@ -53,6 +53,16 @@
{
int err = 0;
int flags = 0;
+ int alignedw = 0;
+ int alignedh = 0;
+
+ AdrenoMemInfo::getInstance().getAlignedWidthAndHeight(width,
+ height,
+ format,
+ usage,
+ alignedw,
+ alignedh);
+
size = roundUpToPageSize(size);
alloc_data data;
data.offset = 0;
@@ -153,8 +163,8 @@
flags |= data.allocType;
uint64_t eBaseAddr = (uint64_t)(eData.base) + eData.offset;
private_handle_t *hnd = new private_handle_t(data.fd, size, flags,
- bufferType, format, width, height, eData.fd, eData.offset,
- eBaseAddr);
+ bufferType, format, alignedw, alignedh,
+ eData.fd, eData.offset, eBaseAddr, width, height);
hnd->offset = data.offset;
hnd->base = (uint64_t)(data.base) + data.offset;
@@ -327,7 +337,7 @@
err = gralloc_alloc_framebuffer(usage, pHandle);
} else {
err = gralloc_alloc_buffer(size, usage, pHandle, bufferType,
- grallocFormat, alignedw, alignedh);
+ grallocFormat, w, h);
}
if (err < 0) {