Merge "libgralloc: Don't pad if debug.gralloc.map_fb_memory is set"
diff --git a/libgralloc/alloc_controller.cpp b/libgralloc/alloc_controller.cpp
index 123be3f..677bb4e 100644
--- a/libgralloc/alloc_controller.cpp
+++ b/libgralloc/alloc_controller.cpp
@@ -105,6 +105,15 @@
int stride = ALIGN(width, 32);
// Currently surface padding is only computed for RGB* surfaces.
if (format < 0x7) {
+ // Don't add any additional padding if debug.gralloc.map_fb_memory
+ // is enabled
+ char property[PROPERTY_VALUE_MAX];
+ if((property_get("debug.gralloc.map_fb_memory", property, NULL) > 0) &&
+ (!strncmp(property, "1", PROPERTY_VALUE_MAX ) ||
+ (!strncasecmp(property,"true", PROPERTY_VALUE_MAX )))) {
+ return stride;
+ }
+
int bpp = 4;
switch(format)
{