Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ba23a7fa authored by Christopher N. Hesse's avatar Christopher N. Hesse Committed by Ethan Chen
Browse files

surfaceflinger: Add support for Exynos HWC services

Change-Id: I600e946a22064d64549e266c5a3cf452d0cf6299
parent a7620e3b
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -155,6 +155,24 @@ ifeq ($(TARGET_USES_QCOM_BSP), true)
  endif
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
+32 −0
Original line number Diff line number Diff line
@@ -82,6 +82,10 @@
#include "RenderEngine/RenderEngine.h"
#include <cutils/compiler.h>

#ifdef USES_HWC_SERVICES
#include "ExynosHWCService.h"
#endif

#define DISPLAY_COUNT       1

/*
@@ -128,6 +132,10 @@ const String16 sDump("android.permission.DUMP");

// ---------------------------------------------------------------------------

#ifdef USES_HWC_SERVICES
static bool notifyPSRExit = true;
#endif

SurfaceFlinger::SurfaceFlinger()
    :   BnSurfaceComposer(),
        mTransactionFlags(0),
@@ -316,6 +324,14 @@ void SurfaceFlinger::bootFinished()
    // 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

    const int LOGTAG_SF_STOP_BOOTANIM = 60110;
    LOG_EVENT_LONG(LOGTAG_SF_STOP_BOOTANIM,
                   ns2ms(systemTime(SYSTEM_TIME_MONOTONIC)));
@@ -879,6 +895,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();
}

@@ -1078,6 +1107,9 @@ void SurfaceFlinger::handleMessageRefresh() {
    doDebugFlashRegions();
    doComposition();
    postComposition(refreshStartTime);
#ifdef USES_HWC_SERVICES
    notifyPSRExit = true;
#endif

    mPreviousPresentFence = mHwc->getRetireFence(HWC_DISPLAY_PRIMARY);