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

Commit 5d4bc4e0 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira Committed by Gerrit Code Review
Browse files

Merge "surfaceflinger: Add support for LGE's HDMI rotation" into gingerbread

parents 2fe71919 3131841b
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -63,6 +63,12 @@ LOCAL_SHARED_LIBRARIES := \
	libui \
	libsurfaceflinger_client

ifeq ($(BOARD_USES_LGE_HDMI_ROTATION),true)
LOCAL_CFLAGS += -DUSE_LGE_HDMI
LOCAL_SHARED_LIBRARIES += \
	libnvdispmgr_d
endif

LOCAL_C_INCLUDES := \
	$(call include-path-for, corecg graphics)

+21 −0
Original line number Diff line number Diff line
@@ -67,6 +67,13 @@

#define DISPLAY_COUNT       1

#ifdef USE_LGE_HDMI
extern "C" void MainRegisterHPD();
extern "C" void MainUnRegisterHPD();
extern "C" void NvDispMgrPreAutoOrientation(int rotation);
extern "C" void NvDispMgrAutoOrientation(int rotation);
#endif

namespace android {
// ---------------------------------------------------------------------------

@@ -103,6 +110,9 @@ SurfaceFlinger::SurfaceFlinger()
        mUseDithering(true)
{
    init();
#ifdef USE_LGE_HDMI
    MainRegisterHPD();
#endif
}

void SurfaceFlinger::init()
@@ -136,6 +146,9 @@ void SurfaceFlinger::init()
SurfaceFlinger::~SurfaceFlinger()
{
    glDeleteTextures(1, &mWormholeTexName);
#ifdef USE_LGE_HDMI
    MainUnRegisterHPD();
#endif
}

overlay_control_device_t* SurfaceFlinger::getOverlayEngine() const
@@ -414,9 +427,17 @@ bool SurfaceFlinger::threadLoop()
        logger.log(GraphicLog::SF_COMPOSITION_COMPLETE, index);
        hw.compositionComplete();

#ifdef USE_LGE_HDMI
        NvDispMgrPreAutoOrientation(mCurrentState.orientation);
#endif

        logger.log(GraphicLog::SF_SWAP_BUFFERS, index);
        postFramebuffer();

#ifdef USE_LGE_HDMI
        NvDispMgrAutoOrientation(mCurrentState.orientation);
#endif

        logger.log(GraphicLog::SF_REPAINT_DONE, index);
    } else {
        // pretend we did the post