hwc: Support for reading FB format from driver
- Instead of assuming the default format(RGBA_8888),
read FB format from driver and pass the info to SF
- For now, this is limited to primary and HDMI only.
WB FBformat is assumed to be in RGBA_8888
- If FB doesn't have alpha channel, disable mixed mode
Change-Id: Iefc0080819749b541483ea47357bb37ec150c544
diff --git a/libhwcomposer/hwc.cpp b/libhwcomposer/hwc.cpp
index adf48e7..a934f3e 100644
--- a/libhwcomposer/hwc.cpp
+++ b/libhwcomposer/hwc.cpp
@@ -805,6 +805,9 @@
HWC_DISPLAY_DPI_X,
HWC_DISPLAY_DPI_Y,
HWC_DISPLAY_SECURE,
+#ifdef GET_FRAMEBUFFER_FORMAT_FROM_HWC
+ HWC_DISPLAY_FBFORMAT,
+#endif
HWC_DISPLAY_NO_ATTRIBUTE,
};
@@ -855,6 +858,11 @@
case HWC_DISPLAY_SECURE:
values[i] = (int32_t) (ctx->dpyAttr[disp].secure);
break;
+#ifdef GET_FRAMEBUFFER_FORMAT_FROM_HWC
+ case HWC_DISPLAY_FBFORMAT:
+ values[i] = ctx->dpyAttr[disp].fbformat;
+ break;
+#endif
default:
ALOGE("Unknown display attribute %d",
attributes[i]);