summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher N. Hesse <raymanfx@gmail.com>2016-04-29 16:21:35 +0200
committerGerrit Code Review <gerrit@cyanogenmod.org>2016-08-18 10:41:58 -0700
commit60f8bdfb455f0c1ff61c32427cc7de0389517257 (patch)
tree680e068fd6fc9b657855960c482154561029e6b1
parentb7021eff8d1f415bed0ac5a84f21e6bc99ae4b85 (diff)
downloadframeworks_native-60f8bdfb455f0c1ff61c32427cc7de0389517257.zip
frameworks_native-60f8bdfb455f0c1ff61c32427cc7de0389517257.tar.gz
frameworks_native-60f8bdfb455f0c1ff61c32427cc7de0389517257.tar.bz2
surfaceflinger: Add support for Exynos HWC services
Change-Id: I600e946a22064d64549e266c5a3cf452d0cf6299
-rw-r--r--services/surfaceflinger/Android.mk18
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp32
2 files changed, 50 insertions, 0 deletions
diff --git a/services/surfaceflinger/Android.mk b/services/surfaceflinger/Android.mk
index 0bbdac0..25fa503 100644
--- a/services/surfaceflinger/Android.mk
+++ b/services/surfaceflinger/Android.mk
@@ -132,6 +132,24 @@ ifeq ($(TARGET_USES_QCOM_BSP), true)
ExSurfaceFlinger/ExHWComposer.cpp
endif
+ifeq ($(BOARD_USES_HWC_SERVICES), true)
+ LOCAL_CFLAGS += -DUSES_HWC_SERVICES
+ LOCAL_SHARED_LIBRARIES += libExynosHWCService
+ LOCAL_C_INCLUDES += \
+ $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include \
+ $(TOP)/hardware/samsung_slsi-$(TARGET_SLSI_VARIANT)/$(TARGET_BOARD_PLATFORM)/libhwcService \
+ $(TOP)/hardware/samsung_slsi-$(TARGET_SLSI_VARIANT)/$(TARGET_BOARD_PLATFORM)/include \
+ $(TOP)/hardware/samsung_slsi-$(TARGET_SLSI_VARIANT)/$(TARGET_SOC)/include \
+ $(TOP)/hardware/samsung_slsi-$(TARGET_SLSI_VARIANT)/$(TARGET_SOC)/libhwcmodule \
+ $(TOP)/hardware/samsung_slsi-$(TARGET_SLSI_VARIANT)/exynos/libhwc \
+ $(TOP)/hardware/samsung_slsi-$(TARGET_SLSI_VARIANT)/exynos/include \
+ $(TOP)/hardware/samsung_slsi-$(TARGET_SLSI_VARIANT)/exynos/libexynosutils \
+ $(TOP)/system/core/libsync/include
+
+LOCAL_ADDITIONAL_DEPENDENCIES := \
+ $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
+endif
+
LOCAL_MODULE := libsurfaceflinger
LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 3070e45..441bad8 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -83,6 +83,10 @@
#include <cutils/compiler.h>
#include "DisplayUtils.h"
+#ifdef USES_HWC_SERVICES
+#include "ExynosHWCService.h"
+#endif
+
#define DISPLAY_COUNT 1
/*
@@ -131,6 +135,10 @@ static sp<Layer> lastSurfaceViewLayer;
// ---------------------------------------------------------------------------
+#ifdef USES_HWC_SERVICES
+static bool notifyPSRExit = true;
+#endif
+
SurfaceFlinger::SurfaceFlinger()
: BnSurfaceComposer(),
mTransactionFlags(0),
@@ -313,6 +321,14 @@ void SurfaceFlinger::bootFinished()
// formerly we would just kill the process, but we now ask it to exit so it
// can choose where to stop the animation.
property_set("service.bootanim.exit", "1");
+
+#ifdef USES_HWC_SERVICES
+ sp<IServiceManager> sm = defaultServiceManager();
+ sp<android::IExynosHWCService> hwc =
+ interface_cast<android::IExynosHWCService>(sm->getService(String16("Exynos.HWCService")));
+ ALOGD("boot finished. Inform HWC");
+ hwc->setBootFinished();
+#endif
}
void SurfaceFlinger::deleteTextureAsync(uint32_t texture) {
@@ -799,6 +815,19 @@ void SurfaceFlinger::signalTransaction() {
}
void SurfaceFlinger::signalLayerUpdate() {
+#ifdef USES_HWC_SERVICES
+ if (notifyPSRExit) {
+ notifyPSRExit = false;
+ sp<IServiceManager> sm = defaultServiceManager();
+ sp<IExynosHWCService> hwcService =
+ interface_cast<android::IExynosHWCService>(
+ sm->getService(String16("Exynos.HWCService")));
+ if (hwcService != NULL)
+ hwcService->notifyPSRExit();
+ else
+ ALOGE("HWCService::notifyPSRExit failed");
+ }
+#endif
mEventQueue.invalidate();
}
@@ -983,6 +1012,9 @@ void SurfaceFlinger::handleMessageRefresh() {
doDebugFlashRegions();
doComposition();
postComposition();
+#ifdef USES_HWC_SERVICES
+ notifyPSRExit = true;
+#endif
}
previousExpectedPresent = mPrimaryDispSync.computeNextRefresh(0);