void ExternalDisplay::processUEventOffline(const char *str) {
    const char *s1 = str + (strlen(str)-strlen(DEVICE_NODE_FB1));
    // check if it is for FB1
    if(strncmp(s1,DEVICE_NODE_FB1, strlen(DEVICE_NODE_FB1))== 0) {
        enableHDMIVsync(EXTERN_DISPLAY_NONE);
        closeFrameBuffer();
        resetInfo();
        setExternalDisplay(EXTERN_DISPLAY_NONE);
    }
    else if(strncmp(s1, DEVICE_NODE_FB2, strlen(DEVICE_NODE_FB2)) == 0) {
        closeFrameBuffer();
        setExternalDisplay(EXTERN_DISPLAY_NONE);
    }
    triggerRefresh();
}
void ExternalDisplay::setExternalDisplay(int connected)
{

    hwc_context_t* ctx = mHwcContext;
    if(ctx) {
        ALOGD_IF(DEBUG, "%s: status = %d", __FUNCTION__,
                 connected);
        if(connected) {
            readResolution();
            //Get the best mode and set
            // TODO: Move this to activate
            setResolution(getBestMode());
            setDpyAttr();
            //enable hdmi vsync
        } else {
            // Disable the hdmi vsync
            closeFrameBuffer();
            resetInfo();
        }
        // Store the external display
        mExternalDisplay = connected;
        const char* prop = (connected) ? "1" : "0";
        // set system property
        property_set("hw.hdmiON", prop);
    }
    return;
}
void ExternalDisplay::processUEventOnline(const char *str) {
    const char *s1 = str + (strlen(str)-strlen(DEVICE_NODE_FB1));
    // check if it is for FB1
    if(strncmp(s1,DEVICE_NODE_FB1, strlen(DEVICE_NODE_FB1))== 0) {
        if(isHDMIConfigured()) {
            // HDMI connect event.
            // Tear-down WFD if it is active.
            if(mExternalDisplay == EXTERN_DISPLAY_FB2) {
                closeFrameBuffer();
                setExternalDisplay(EXTERN_DISPLAY_NONE);
                triggerRefresh();
            }
        }
        readResolution();
        //Get the best mode and set
        setResolution(getBestMode());
        enableHDMIVsync(EXTERN_DISPLAY_FB1);
        setExternalDisplay(EXTERN_DISPLAY_FB1);
        triggerRefresh();
    }
    else if(strncmp(s1, DEVICE_NODE_FB2, strlen(DEVICE_NODE_FB2)) == 0) {
        // WFD connect event
        if(mExternalDisplay  == EXTERN_DISPLAY_FB1) {
            // HDMI has higher priority.
            // Do Not Override.
        }else {
            // WFD is connected
            openFrameBuffer(EXTERN_DISPLAY_FB2);
            setExternalDisplay(EXTERN_DISPLAY_FB2);
            triggerRefresh();
        }
    }
}
Ejemplo n.º 4
0
int HDMIDisplay::teardown() {
    closeFrameBuffer();
    resetInfo();
    // unset system property
    property_set("hw.hdmiON", "0");
    return 0;
}
int VirtualDisplay::teardown() {
    closeFrameBuffer();
    memset(&mVInfo, 0, sizeof(mVInfo));
    // Reset the resolution when we close the fb for this device. We need
    // this to distinguish between an ONLINE and RESUME event.
    mHwcContext->dpyAttr[HWC_DISPLAY_VIRTUAL].xres = 0;
    mHwcContext->dpyAttr[HWC_DISPLAY_VIRTUAL].yres = 0;
    return 0;
}
Ejemplo n.º 6
0
int ExternalDisplay::teardownWFDDisplay() {
    if(mConnectedFbNum == mWfdFbNum) {
        // wfd offline event..!
        closeFrameBuffer();
        memset(&mVInfo, 0, sizeof(mVInfo));
        setExternalDisplay(false);
    }
    return 0;
}
Ejemplo n.º 7
0
int ExternalDisplay::teardownHDMIDisplay() {
    if(mConnectedFbNum == mHdmiFbNum) {
        // hdmi offline event..!
        closeFrameBuffer();
        resetInfo();
        setExternalDisplay(false);
    }
    return 0;
}
ExternalDisplay::~ExternalDisplay()
{
    closeFrameBuffer();
}
VirtualDisplay::~VirtualDisplay()
{
    closeFrameBuffer();
}
Ejemplo n.º 10
0
HDMIDisplay::~HDMIDisplay()
{
    delete [] supported_video_mode_lut;
    closeFrameBuffer();
}