Switch SurfaceFlinger to HWC 2.0
Enables SurfaceFlinger to speak to version 2.0 of the Hardware Composer
HAL instead of version 1.x (also removing support for the framebuffer
HAL). By default, however, this functionality is disabled. In order to
enable it, USE_HWC2 must be set to true in Android.mk.
Change-Id: I4589e02ac2165236b10ff2f7cb772f87e0d3daab
diff --git a/services/surfaceflinger/Android.mk b/services/surfaceflinger/Android.mk
index 3d71aa8..8cc9fc1 100644
--- a/services/surfaceflinger/Android.mk
+++ b/services/surfaceflinger/Android.mk
@@ -15,13 +15,11 @@
LayerDim.cpp \
MessageQueue.cpp \
MonitoredProducer.cpp \
- SurfaceFlinger.cpp \
SurfaceFlingerConsumer.cpp \
Transform.cpp \
DisplayHardware/FramebufferSurface.cpp \
DisplayHardware/HWC2.cpp \
DisplayHardware/HWC2On1Adapter.cpp \
- DisplayHardware/HWComposer.cpp \
DisplayHardware/PowerHAL.cpp \
DisplayHardware/VirtualDisplaySurface.cpp \
Effects/Daltonizer.cpp \
@@ -42,6 +40,19 @@
LOCAL_CFLAGS := -DLOG_TAG=\"SurfaceFlinger\"
LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
+
+USE_HWC2 := false
+ifeq ($(USE_HWC2),true)
+ LOCAL_CFLAGS += -DUSE_HWC2
+ LOCAL_SRC_FILES += \
+ SurfaceFlinger.cpp \
+ DisplayHardware/HWComposer.cpp
+else
+ LOCAL_SRC_FILES += \
+ SurfaceFlinger_hwc1.cpp \
+ DisplayHardware/HWComposer_hwc1.cpp
+endif
+
ifeq ($(TARGET_BOARD_PLATFORM),omap4)
LOCAL_CFLAGS += -DHAS_CONTEXT_PRIORITY
endif