diff options
author | Fahad Kunnathadi <fahad.k@linaro.org> | 2012-10-17 11:10:24 +0530 |
---|---|---|
committer | Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org> | 2012-12-01 01:14:19 +0100 |
commit | 29c8589b96a267713335c355ca00c82587a261b0 (patch) | |
tree | d860ddbb1e1a91ad0c71014f5de66f6ab78cc459 | |
parent | f04f6519357815cdb9bf9d15e0cee8bf3173fa77 (diff) | |
download | native-29c8589b96a267713335c355ca00c82587a261b0.tar.gz |
surfaceflinger: HDMI Samsung Soc Origen HDMI Enabling Code
This code enables HDMI in origen board.
Change-Id: I9c95b9a0aa6ed9dae077cff59104e2f95efe9327
Signed-off-by: Fahad Kunnathadi <fahad.k@linaro.org>
-rw-r--r-- | services/surfaceflinger/Android.mk | 10 | ||||
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 104 |
2 files changed, 113 insertions, 1 deletions
diff --git a/services/surfaceflinger/Android.mk b/services/surfaceflinger/Android.mk index 5a57697951..20ba700517 100644 --- a/services/surfaceflinger/Android.mk +++ b/services/surfaceflinger/Android.mk @@ -42,6 +42,10 @@ ifneq ($(NUM_FRAMEBUFFER_SURFACE_BUFFERS),) LOCAL_CFLAGS += -DNUM_FRAMEBUFFER_SURFACE_BUFFERS=$(NUM_FRAMEBUFFER_SURFACE_BUFFERS) endif +ifeq ($(BOARD_HAVE_HDMI_SUPPORT),SAMSUNG_HDMI_SUPPORT) + LOCAL_CFLAGS += -DSAMSUNG_HDMI_SUPPORT +endif + LOCAL_SHARED_LIBRARIES := \ libcutils \ libdl \ @@ -53,6 +57,12 @@ LOCAL_SHARED_LIBRARIES := \ libui \ libgui +ifeq ($(BOARD_HAVE_HDMI_SUPPORT),SAMSUNG_HDMI_SUPPORT) + LOCAL_C_INCLUDES += vendor/samsung/origen/proprietary/include + LOCAL_LDFLAGS += vendor/samsung/origen/proprietary/system/lib/libfimc.so + LOCAL_LDFLAGS += vendor/samsung/origen/proprietary/system/lib/libhdmi.so +endif + LOCAL_MODULE:= libsurfaceflinger include $(BUILD_SHARED_LIBRARY) diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index ce10c78194..4f1357ad3e 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -69,11 +69,33 @@ #include "DisplayHardware/HWComposer.h" +// true : HDMI cable is pluged in, false: HDMI cable is plugged out +bool mHdmiCableInserted; + +#ifdef SAMSUNG_HDMI_SUPPORT +#include "SecHdmi.h" +#endif + #define EGL_VERSION_HW_ANDROID 0x3143 #define DISPLAY_COUNT 1 namespace android { + +#ifdef SAMSUNG_HDMI_SUPPORT +extern "C" { + +extern bool blit2Hdmi(); +extern int SecHdmi_flush(); +extern int SecHdmi_connect(void); +extern int SecHdmi_disconnect(void); +extern int SecHdmi_destroy(void); +extern void SecHdmi(); +extern int SecHdmi_create(void); +extern void setHdmiStatus(uint32_t status); +} +#endif + // --------------------------------------------------------------------------- const String16 sHardwareTest("android.permission.HARDWARE_TEST"); @@ -517,6 +539,17 @@ status_t SurfaceFlinger::readyToRun() DisplayDevice::makeCurrent(mEGLDisplay, hw, mEGLContext); initializeGL(mEGLDisplay); +#ifdef SAMSUNG_HDMI_SUPPORT + SecHdmi(); + if(SecHdmi_create() == 0) + ALOGE("%s::mSecHdmi.create() fail \n", __func__); + else + { + // for it to connect + setHdmiStatus(1); + } +#endif + // start the EventThread mEventThread = new EventThread(this); mEventQueue.setEventThread(mEventThread); @@ -1032,6 +1065,13 @@ void SurfaceFlinger::postFramebuffer() mLastSwapBufferTime = systemTime() - now; mDebugInSwapBuffers = 0; + +#ifdef SAMSUNG_HDMI_SUPPORT + if(mHdmiCableInserted == true) + { + blit2Hdmi(); + } +#endif } void SurfaceFlinger::handleTransaction(uint32_t transactionFlags) @@ -1853,11 +1893,73 @@ uint32_t SurfaceFlinger::setClientStateLocked( return flags; } +#ifdef SAMSUNG_HDMI_SUPPORT +void setHdmiStatus(uint32_t status) +{ + + bool hdmiCableInserted = (bool)status; + + if(mHdmiCableInserted == hdmiCableInserted) + return; + + if(hdmiCableInserted == true) + { + if(SecHdmi_connect() == 0) + { + hdmiCableInserted = false; + } + } + else + { + if(SecHdmi_disconnect() == 0) + { + ALOGE("%s::mSecHdmi.disconnect() fail\n", __func__); + } + } + + mHdmiCableInserted = hdmiCableInserted; + + if(mHdmiCableInserted == true) + { + blit2Hdmi(); + } +} + +void setHdmiMode(uint32_t mode) +{ +} + +void setHdmiResolution(uint32_t resolution) +{ +} + +void setHdmiHdcp(uint32_t hdcp_en) +{ +} + +bool blit2Hdmi(void) +{ + if(mHdmiCableInserted == false) + { + ALOGE("mHdmiCableInserted == false fail"); + return false; + } + + if(SecHdmi_flush() == false) + { + ALOGE("%s::mSecHdmi.flush() fail\n", __func__); + } + + return true; +} + +#endif + sp<ISurface> SurfaceFlinger::createLayer( ISurfaceComposerClient::surface_data_t* params, const String8& name, const sp<Client>& client, - uint32_t w, uint32_t h, PixelFormat format, + uint32_t w, uint32_t h, PixelFormat format, uint32_t flags) { sp<LayerBaseClient> layer; |