summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
Diffstat (limited to 'services')
-rw-r--r--services/surfaceflinger/Android.mk4
-rw-r--r--services/surfaceflinger/DisplayHardware/HWComposer.cpp16
2 files changed, 20 insertions, 0 deletions
diff --git a/services/surfaceflinger/Android.mk b/services/surfaceflinger/Android.mk
index c1ddba1..6a90083 100644
--- a/services/surfaceflinger/Android.mk
+++ b/services/surfaceflinger/Android.mk
@@ -95,6 +95,10 @@ else
LOCAL_CFLAGS += -DMAX_VIRTUAL_DISPLAY_DIMENSION=0
endif
+ifeq ($(BOARD_USE_BGRA_8888),true)
+ LOCAL_CFLAGS += -DUSE_BGRA_8888
+endif
+
LOCAL_CFLAGS += -fvisibility=hidden -Werror=format
LOCAL_CFLAGS += -std=c++11
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
index a43597a..17e91d9 100644
--- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp
+++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
@@ -435,7 +435,11 @@ status_t HWComposer::queryDisplayProperties(int disp) {
}
// FIXME: what should we set the format to?
+#ifdef USE_BGRA_8888
+ mDisplayData[disp].format = HAL_PIXEL_FORMAT_BGRA_8888;
+#else
mDisplayData[disp].format = HAL_PIXEL_FORMAT_RGBA_8888;
+#endif
mDisplayData[disp].connected = true;
return NO_ERROR;
}
@@ -497,7 +501,11 @@ sp<Fence> HWComposer::getDisplayFence(int disp) const {
uint32_t HWComposer::getFormat(int disp) const {
if (static_cast<uint32_t>(disp) >= MAX_HWC_DISPLAYS || !mAllocatedDisplayIDs.hasBit(disp)) {
+#ifdef USE_BGRA_8888
+ return HAL_PIXEL_FORMAT_BGRA_8888;
+#else
return HAL_PIXEL_FORMAT_RGBA_8888;
+#endif
} else {
return mDisplayData[disp].format;
}
@@ -879,7 +887,11 @@ int HWComposer::getVisualID() const {
// FIXME: temporary hack until HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED
// is supported by the implementation. we can only be in this case
// if we have HWC 1.1
+#ifdef USE_BGRA_8888
+ return HAL_PIXEL_FORMAT_BGRA_8888;
+#else
return HAL_PIXEL_FORMAT_RGBA_8888;
+#endif
//return HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED;
} else {
return mFbDev->format;
@@ -1367,7 +1379,11 @@ bool HWComposer::VSyncThread::threadLoop() {
HWComposer::DisplayData::DisplayData()
: configs(),
currentConfig(0),
+#ifdef USE_BGRA_8888
+ format(HAL_PIXEL_FORMAT_BGRA_8888),
+#else
format(HAL_PIXEL_FORMAT_RGBA_8888),
+#endif
connected(false),
hasFbComp(false), hasOvComp(false),
capacity(0), list(NULL),