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

Commit 3f4a58e8 authored by Giulio Cervera's avatar Giulio Cervera
Browse files

Revert "SurfaceFlinger: Handle WFD and HDMI concurrency"

This reverts commit 68ac37dc.
parent 226cbefa
Loading
Loading
Loading
Loading
+0 −17
Original line number Diff line number Diff line
@@ -69,11 +69,6 @@ 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)
@@ -530,11 +525,7 @@ 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,
@@ -558,11 +549,7 @@ 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()
@@ -595,11 +582,7 @@ 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))) {
+7 −3
Original line number Diff line number Diff line
@@ -133,8 +133,10 @@ public:
            const sp<ISurfaceTexture>& surface) const = 0;

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

};
@@ -158,7 +160,9 @@ public:
        TURN_ELECTRON_BEAM_ON,
        AUTHENTICATE_SURFACE,
#ifdef QCOM_HDMI_OUT
        EXTERNAL_DISPLAY,
        ENABLE_HDMI_OUTPUT,
        SET_ACTIONSAFE_WIDTH_RATIO,
        SET_ACTIONSAFE_HEIGHT_RATIO
#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 enableExternalDisplay(int disp_type, int enable);
    static void enableHDMIOutput(int enable);
    static void setActionSafeWidthRatio(float asWidthRatio);
    static void setActionSafeHeightRatio(float asHeightRatio);
#endif
+30 −6
Original line number Diff line number Diff line
@@ -176,13 +176,28 @@ public:
    }

#ifdef QCOM_HDMI_OUT
    virtual void enableExternalDisplay(int disp_type, int enable)
    virtual void enableHDMIOutput(int enable)
    {
        Parcel data, reply;
        data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
        data.writeInt32(disp_type);
        data.writeInt32(enable);
        remote()->transact(BnSurfaceComposer::EXTERNAL_DISPLAY, data, &reply);
        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);
    }
#endif

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

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

Loading