surfaceflinger: Add support for Exynos HWC services

Change-Id: I600e946a22064d64549e266c5a3cf452d0cf6299
This commit is contained in:
Christopher N. Hesse 2016-04-29 16:21:35 +02:00 committed by Gerrit Code Review
parent b7021eff8d
commit 60f8bdfb45
2 changed files with 50 additions and 0 deletions

View File

@ -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

View File

@ -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);