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

Commit 68ac37dc authored by Arun Kumar K.R's avatar Arun Kumar K.R Committed by Giulio Cervera
Browse files

SurfaceFlinger: Handle WFD and HDMI concurrency

- changes to handle wifi display and HDMI concurrency
- rename enableHDMIOutput to enableExternalDisplay
- remove action safe related functions(not used anymore)

Change-Id: Ib7d9aa4472a4419c395728fec07f7f9827198bbf
parent df84f453
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -69,6 +69,11 @@ namespace android {
#define SYSFS_HPD               DEVICE_ROOT "/" DEVICE_NODE "/hpd"
#define SYSFS_HDCP_PRESENT      DEVICE_ROOT "/" DEVICE_NODE "/hdcp_present"

#ifdef QCOM_HARDWARE
//Should match to the external_display_type HDMI in QComUI
#define EXT_DISPLAY_HDMI        1
#endif

HDMIDaemon::HDMIDaemon() : Thread(false),
           mFrameworkSock(-1), mAcceptedConnection(-1), mUeventSock(-1),
           mHDMIUeventQueueHead(NULL), fd1(-1), mCurrentID(-1), mNxtMode(-1)
@@ -525,7 +530,11 @@ void HDMIDaemon::setResolution(int ID)
            if (cur->video_format == ID)
                mode = cur;
        }
#ifdef QCOM_HARDWARE
        SurfaceComposerClient::enableExternalDisplay(EXT_DISPLAY_HDMI, 0);
#else
        SurfaceComposerClient::enableHDMIOutput(0);
#endif
        ioctl(fd1, FBIOGET_VSCREENINFO, &info);
        LOGD("GET Info<ID=%d %dx%d (%d,%d,%d), (%d,%d,%d) %dMHz>",
            info.reserved[3], info.xres, info.yres,
@@ -549,7 +558,11 @@ void HDMIDaemon::setResolution(int ID)
    ioctl(fd1, FBIOPAN_DISPLAY, &info);
    property_set("hw.hdmiON", "1");
    //Inform SF about HDMI
#ifdef QCOM_HARDWARE
    SurfaceComposerClient::enableExternalDisplay(EXT_DISPLAY_HDMI, 1);
#else
    SurfaceComposerClient::enableHDMIOutput(1);
#endif
}

int HDMIDaemon::processFrameworkCommand()
@@ -580,7 +593,11 @@ int HDMIDaemon::processFrameworkCommand()
        if (!openFramebuffer())
            return -1;
        property_set("hw.hdmiON", "0");
#ifdef QCOM_HARDWARE
        SurfaceComposerClient::enableExternalDisplay(EXT_DISPLAY_HDMI, 0);
#else
        SurfaceComposerClient::enableHDMIOutput(0);
#endif
        close(fd1);
        fd1 = -1;
    } else if (!strncmp(buffer, HDMI_CMD_SET_ASWIDTH, strlen(HDMI_CMD_SET_ASWIDTH))) {
+3 −7
Original line number Diff line number Diff line
@@ -133,10 +133,8 @@ public:
            const sp<ISurfaceTexture>& surface) const = 0;

#ifdef QCOM_HDMI_OUT
    //HDMI SPecific functions
    virtual void enableHDMIOutput(int enable) = 0;
    virtual void setActionSafeWidthRatio(float asWidthRatio) = 0;
    virtual void setActionSafeHeightRatio(float asHeightRatio) = 0;
    //External display specific functions
    virtual void enableExternalDisplay(int disp_type, int enable) = 0;
#endif

};
@@ -160,9 +158,7 @@ public:
        TURN_ELECTRON_BEAM_ON,
        AUTHENTICATE_SURFACE,
#ifdef QCOM_HDMI_OUT
        ENABLE_HDMI_OUTPUT,
        SET_ACTIONSAFE_WIDTH_RATIO,
        SET_ACTIONSAFE_HEIGHT_RATIO
        EXTERNAL_DISPLAY,
#endif
    };

+4 −4
Original line number Diff line number Diff line
@@ -137,7 +137,7 @@ public:

#ifdef QCOM_HDMI_OUT
    //HDMI SPecific functions
    static void enableHDMIOutput(int enable);
    static void enableExternalDisplay(int disp_type, int enable);
    static void setActionSafeWidthRatio(float asWidthRatio);
    static void setActionSafeHeightRatio(float asHeightRatio);
#endif
+6 −30
Original line number Diff line number Diff line
@@ -176,28 +176,13 @@ public:
    }

#ifdef QCOM_HDMI_OUT
    virtual void enableHDMIOutput(int enable)
    virtual void enableExternalDisplay(int disp_type, int enable)
    {
        Parcel data, reply;
        data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
        data.writeInt32(disp_type);
        data.writeInt32(enable);
        remote()->transact(BnSurfaceComposer::ENABLE_HDMI_OUTPUT, data, &reply);
    }

    virtual void setActionSafeWidthRatio(float asWidthRatio)
    {
        Parcel data, reply;
        data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
        data.writeFloat(asWidthRatio);
        remote()->transact(BnSurfaceComposer::SET_ACTIONSAFE_WIDTH_RATIO, data, &reply);
    }

    virtual void setActionSafeHeightRatio(float asHeightRatio)
    {
        Parcel data, reply;
        data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
        data.writeFloat(asHeightRatio);
        remote()->transact(BnSurfaceComposer::SET_ACTIONSAFE_HEIGHT_RATIO, data, &reply);
        remote()->transact(BnSurfaceComposer::EXTERNAL_DISPLAY, data, &reply);
    }
#endif

@@ -282,20 +267,11 @@ status_t BnSurfaceComposer::onTransact(
            reply->writeInt32(result);
        } break;
#ifdef QCOM_HDMI_OUT
        case ENABLE_HDMI_OUTPUT: {
        case EXTERNAL_DISPLAY: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            int disp_type = data.readInt32();
            int enable = data.readInt32();
            enableHDMIOutput(enable);
        } break;
        case SET_ACTIONSAFE_WIDTH_RATIO: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            float asWidthRatio = data.readFloat();
            setActionSafeWidthRatio(asWidthRatio);
        } break;
        case SET_ACTIONSAFE_HEIGHT_RATIO: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            float asHeightRatio = data.readFloat();
            setActionSafeHeightRatio(asHeightRatio);
            enableExternalDisplay(disp_type, enable);
        } break;
#endif
        default:
+2 −12
Original line number Diff line number Diff line
@@ -281,20 +281,10 @@ status_t Composer::setFreezeTint(const sp<SurfaceComposerClient>& client,
}

#ifdef QCOM_HDMI_OUT
void SurfaceComposerClient::enableHDMIOutput(int enable)
void SurfaceComposerClient::enableExternalDisplay(int disp_type, int enable)
{
    sp<ISurfaceComposer> sm(getComposerService());
    return sm->enableHDMIOutput(enable);
}

void SurfaceComposerClient::setActionSafeWidthRatio(float asWidthRatio){
    sp<ISurfaceComposer> sm(getComposerService());
    return sm->setActionSafeWidthRatio(asWidthRatio);
}

void SurfaceComposerClient::setActionSafeHeightRatio(float asHeightRatio){
    sp<ISurfaceComposer> sm(getComposerService());
    return sm->setActionSafeHeightRatio(asHeightRatio);
    return sm->enableExternalDisplay(disp_type, enable);
}
#endif

Loading