libgralloc: Don't pad if debug.gralloc.map_fb_memory is set

Don't add adreno specific padding computed by libadreno_utils if
debug.gralloc.map_fb_memory is set.
Since this is a debug property, we can disable surface padding
when the property is enabled.

Change-Id: I5ff310483930f8da04f6955889eea3973fd3d342
CRs-fixed: 480925
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)
         {