gralloc: Set default value for implementation defined formats

For implementation defined formats which go via HWC, set the
default value to RGBA8888

Change-Id: I6a45c69260b54f0b78c480f54b07a4de161b4cc5
diff --git a/msm8974/libgralloc/gpu.cpp b/msm8974/libgralloc/gpu.cpp
index 039dba2..d499ac4 100644
--- a/msm8974/libgralloc/gpu.cpp
+++ b/msm8974/libgralloc/gpu.cpp
@@ -274,6 +274,12 @@
             grallocFormat = HAL_PIXEL_FORMAT_YCrCb_420_SP; //NV21
     }
 
+    if (grallocFormat == HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED &&
+            (usage & GRALLOC_USAGE_HW_COMPOSER )) {
+        //XXX: If we still haven't set a format, default to RGBA8888
+        grallocFormat = HAL_PIXEL_FORMAT_RGBA_8888;
+    }
+
     getGrallocInformationFromFormat(grallocFormat, &bufferType);
     size = getBufferSizeAndDimensions(w, h, grallocFormat, alignedw, alignedh);