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

Commit 64b604bd authored by Ricardo Cerqueira's avatar Ricardo Cerqueira
Browse files

ui/sf: Add support for exynos HDMI

Change-Id: I27b34e95c04750e3dd321a2183b6cc1d89f29b5d

Conflicts:
	libs/ui/Android.mk
	services/surfaceflinger/Android.mk
	services/surfaceflinger/SurfaceFlinger.cpp
	services/surfaceflinger/SurfaceFlinger.h
parent 833eb91c
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -31,6 +31,10 @@
#define MIN_NUM_FRAME_BUFFERS  2
#define MAX_NUM_FRAME_BUFFERS  3

#ifdef SAMSUNG_HDMI_SUPPORT
#include "SecHdmiClient.h"
#endif

extern "C" EGLNativeWindowType android_createDisplaySurface(void);

// ---------------------------------------------------------------------------
@@ -39,6 +43,9 @@ namespace android {

class Surface;
class NativeBuffer;
#ifdef SAMSUNG_HDMI_SUPPORT
class SecHdmiClient;
#endif

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

@@ -88,6 +95,9 @@ private:
    int32_t mBufferHead;
    int32_t mCurrentBufferIndex;
    bool mUpdateOnDemand;
#ifdef SAMSUNG_HDMI_SUPPORT
    SecHdmiClient *mHdmiClient;
#endif
};
    
// ---------------------------------------------------------------------------
+19 −0
Original line number Diff line number Diff line
@@ -37,6 +37,25 @@ ifneq ($(BOARD_FRAMEBUFFER_FORCE_FORMAT),)
LOCAL_CFLAGS += -DFRAMEBUFFER_FORCE_FORMAT=$(BOARD_FRAMEBUFFER_FORCE_FORMAT)
endif

ifeq ($(TARGET_SOC),exynos4210)
    LOCAL_CFLAGS += -DSAMSUNG_EXYNOS4210
endif

ifeq ($(TARGET_SOC),exynos4x12)
    LOCAL_CFLAGS += -DSAMSUNG_EXYNOS4x12
endif

ifeq ($(TARGET_SOC),exynos5250)
    LOCAL_CFLAGS += -DSAMSUNG_EXYNOS5250
endif

ifeq ($(BOARD_USES_SAMSUNG_HDMI),true)
LOCAL_CFLAGS += -DSAMSUNG_HDMI_SUPPORT
LOCAL_SHARED_LIBRARIES += libhdmiclient
LOCAL_C_INCLUDES += hardware/samsung/$(TARGET_BOARD_PLATFORM)/libhdmi/libhdmiservice
LOCAL_C_INCLUDES += hardware/samsung/$(TARGET_BOARD_PLATFORM)/include
endif

LOCAL_MODULE:= libui

include $(BUILD_SHARED_LIBRARY)
+24 −0
Original line number Diff line number Diff line
@@ -76,6 +76,11 @@ FramebufferNativeWindow::FramebufferNativeWindow()
    : BASE(), fbDev(0), grDev(0), mUpdateOnDemand(false)
{
    hw_module_t const* module;

#ifdef SAMSUNG_HDMI_SUPPORT
    mHdmiClient = android::SecHdmiClient::getInstance();
#endif

    if (hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &module) == 0) {
        int stride;
        int err;
@@ -287,6 +292,25 @@ int FramebufferNativeWindow::queueBuffer(ANativeWindow* window,
    self->front = static_cast<NativeBuffer*>(buffer);
    self->mNumFreeBuffers++;
    self->mCondition.broadcast();
#ifdef SAMSUNG_HDMI_SUPPORT
#if defined(SAMSUNG_EXYNOS4210) || defined(SAMSUNG_EXYNOS4x12)
    if (self->mHdmiClient != NULL)
        self->mHdmiClient->blit2Hdmi(buffer->width, buffer->height,
                                    HAL_PIXEL_FORMAT_BGRA_8888,
                                    0, 0, 0,
                                    0, 0,
                                    android::SecHdmiClient::HDMI_MODE_UI,
                                    0);
#elif defined(SAMSUNG_EXYNOS5250)
    if (self->mHdmiClient != NULL)
        self->mHdmiClient->blit2Hdmi(buffer->width, buffer->height,
                                    HAL_PIXEL_FORMAT_BGRA_8888,
                                    0, 0, 0,
                                    0, 0,
                                    android::SecHdmiClient::HDMI_MODE_MIRROR,
                                    0);
#endif
#endif
    return res;
}

+7 −0
Original line number Diff line number Diff line
@@ -94,6 +94,13 @@ LOCAL_SHARED_LIBRARIES := \
	libui \
	libgui

ifeq ($(BOARD_USES_SAMSUNG_HDMI),true)
        LOCAL_CFLAGS += -DSAMSUNG_HDMI_SUPPORT
        LOCAL_SHARED_LIBRARIES += libTVOut libhdmiclient
        LOCAL_C_INCLUDES += hardware/samsung/$(TARGET_BOARD_PLATFORM)/libhdmi/libhdmiservice
        LOCAL_C_INCLUDES += hardware/samsung/$(TARGET_BOARD_PLATFORM)/include
endif

LOCAL_MODULE:= libsurfaceflinger

include $(BUILD_SHARED_LIBRARY)
+14 −0
Original line number Diff line number Diff line
@@ -75,6 +75,10 @@
#include "RenderEngine/RenderEngine.h"
#include <cutils/compiler.h>

#ifdef SAMSUNG_HDMI_SUPPORT
#include "SecTVOutService.h"
#endif

#define DISPLAY_COUNT       1

/*
@@ -175,6 +179,16 @@ SurfaceFlinger::SurfaceFlinger()
    }
    ALOGI_IF(mDebugRegion, "showupdates enabled");
    ALOGI_IF(mDebugDDMS, "DDMS debugging enabled");

#ifdef SAMSUNG_HDMI_SUPPORT
    ALOGD(">>> Run service");
    android::SecTVOutService::instantiate();
#if defined(SAMSUNG_EXYNOS5250)
    mHdmiClient = SecHdmiClient::getInstance();
    mHdmiClient->setHdmiEnable(1);
#endif
#endif

}

void SurfaceFlinger::onFirstRef()
Loading