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

Commit b173f759 authored by Marin Shalamanov's avatar Marin Shalamanov
Browse files

SF: Move ALLM and GameContentType to DynamicDisplayInfo

ALLM and Game content type support may change after a hotplug,
for that reason we move them to DynamicDisplayInfo.

Bug: 180108954
Test: flash a device and manually test that the values are
   properly piped to DisplayManager
Change-Id: I05810c620b241e204d2c01618bb8a4069c41d32d
parent 228f46b5
Loading
Loading
Loading
Loading
+0 −70
Original line number Original line Diff line number Diff line
@@ -411,24 +411,6 @@ public:
        return static_cast<status_t>(reply.readInt32());
        return static_cast<status_t>(reply.readInt32());
    }
    }


    status_t getAutoLowLatencyModeSupport(const sp<IBinder>& display,
                                          bool* outSupport) const override {
        Parcel data, reply;
        data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
        status_t result = data.writeStrongBinder(display);
        if (result != NO_ERROR) {
            ALOGE("getAutoLowLatencyModeSupport failed to writeStrongBinder: %d", result);
            return result;
        }
        result = remote()->transact(BnSurfaceComposer::GET_AUTO_LOW_LATENCY_MODE_SUPPORT, data,
                                    &reply);
        if (result != NO_ERROR) {
            ALOGE("getAutoLowLatencyModeSupport failed to transact: %d", result);
            return result;
        }
        return reply.readBool(outSupport);
    }

    void setAutoLowLatencyMode(const sp<IBinder>& display, bool on) override {
    void setAutoLowLatencyMode(const sp<IBinder>& display, bool on) override {
        Parcel data, reply;
        Parcel data, reply;
        status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
        status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
@@ -454,23 +436,6 @@ public:
        }
        }
    }
    }


    status_t getGameContentTypeSupport(const sp<IBinder>& display,
                                       bool* outSupport) const override {
        Parcel data, reply;
        data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
        status_t result = data.writeStrongBinder(display);
        if (result != NO_ERROR) {
            ALOGE("getGameContentTypeSupport failed to writeStrongBinder: %d", result);
            return result;
        }
        result = remote()->transact(BnSurfaceComposer::GET_GAME_CONTENT_TYPE_SUPPORT, data, &reply);
        if (result != NO_ERROR) {
            ALOGE("getGameContentTypeSupport failed to transact: %d", result);
            return result;
        }
        return reply.readBool(outSupport);
    }

    void setGameContentType(const sp<IBinder>& display, bool on) override {
    void setGameContentType(const sp<IBinder>& display, bool on) override {
        Parcel data, reply;
        Parcel data, reply;
        status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
        status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
@@ -1423,23 +1388,6 @@ status_t BnSurfaceComposer::onTransact(
            result = reply->writeInt32(result);
            result = reply->writeInt32(result);
            return result;
            return result;
        }
        }

        case GET_AUTO_LOW_LATENCY_MODE_SUPPORT: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            sp<IBinder> display = nullptr;
            status_t result = data.readStrongBinder(&display);
            if (result != NO_ERROR) {
                ALOGE("getAutoLowLatencyModeSupport failed to readStrongBinder: %d", result);
                return result;
            }
            bool supported = false;
            result = getAutoLowLatencyModeSupport(display, &supported);
            if (result == NO_ERROR) {
                result = reply->writeBool(supported);
            }
            return result;
        }

        case SET_AUTO_LOW_LATENCY_MODE: {
        case SET_AUTO_LOW_LATENCY_MODE: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            sp<IBinder> display = nullptr;
            sp<IBinder> display = nullptr;
@@ -1457,23 +1405,6 @@ status_t BnSurfaceComposer::onTransact(
            setAutoLowLatencyMode(display, setAllm);
            setAutoLowLatencyMode(display, setAllm);
            return result;
            return result;
        }
        }

        case GET_GAME_CONTENT_TYPE_SUPPORT: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            sp<IBinder> display = nullptr;
            status_t result = data.readStrongBinder(&display);
            if (result != NO_ERROR) {
                ALOGE("getGameContentTypeSupport failed to readStrongBinder: %d", result);
                return result;
            }
            bool supported = false;
            result = getGameContentTypeSupport(display, &supported);
            if (result == NO_ERROR) {
                result = reply->writeBool(supported);
            }
            return result;
        }

        case SET_GAME_CONTENT_TYPE: {
        case SET_GAME_CONTENT_TYPE: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            sp<IBinder> display = nullptr;
            sp<IBinder> display = nullptr;
@@ -1491,7 +1422,6 @@ status_t BnSurfaceComposer::onTransact(
            setGameContentType(display, setGameContentTypeOn);
            setGameContentType(display, setGameContentTypeOn);
            return result;
            return result;
        }
        }

        case CLEAR_ANIMATION_FRAME_STATS: {
        case CLEAR_ANIMATION_FRAME_STATS: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            status_t result = clearAnimationFrameStats();
            status_t result = clearAnimationFrameStats();
+0 −12
Original line number Original line Diff line number Diff line
@@ -1876,22 +1876,10 @@ status_t SurfaceComposerClient::setActiveColorMode(const sp<IBinder>& display,
    return ComposerService::getComposerService()->setActiveColorMode(display, colorMode);
    return ComposerService::getComposerService()->setActiveColorMode(display, colorMode);
}
}


bool SurfaceComposerClient::getAutoLowLatencyModeSupport(const sp<IBinder>& display) {
    bool supported = false;
    ComposerService::getComposerService()->getAutoLowLatencyModeSupport(display, &supported);
    return supported;
}

void SurfaceComposerClient::setAutoLowLatencyMode(const sp<IBinder>& display, bool on) {
void SurfaceComposerClient::setAutoLowLatencyMode(const sp<IBinder>& display, bool on) {
    ComposerService::getComposerService()->setAutoLowLatencyMode(display, on);
    ComposerService::getComposerService()->setAutoLowLatencyMode(display, on);
}
}


bool SurfaceComposerClient::getGameContentTypeSupport(const sp<IBinder>& display) {
    bool supported = false;
    ComposerService::getComposerService()->getGameContentTypeSupport(display, &supported);
    return supported;
}

void SurfaceComposerClient::setGameContentType(const sp<IBinder>& display, bool on) {
void SurfaceComposerClient::setGameContentType(const sp<IBinder>& display, bool on) {
    ComposerService::getComposerService()->setGameContentType(display, on);
    ComposerService::getComposerService()->setGameContentType(display, on);
}
}
+6 −21
Original line number Original line Diff line number Diff line
@@ -218,33 +218,18 @@ public:
    virtual status_t setActiveColorMode(const sp<IBinder>& display,
    virtual status_t setActiveColorMode(const sp<IBinder>& display,
            ui::ColorMode colorMode) = 0;
            ui::ColorMode colorMode) = 0;


    /**
     * Returns true if the connected display reports support for HDMI 2.1 Auto
     * Low Latency Mode.
     * For more information, see the HDMI 2.1 specification.
     */
    virtual status_t getAutoLowLatencyModeSupport(const sp<IBinder>& display,
                                                  bool* outSupport) const = 0;

    /**
    /**
     * Switches Auto Low Latency Mode on/off on the connected display, if it is
     * Switches Auto Low Latency Mode on/off on the connected display, if it is
     * available. This should only be called if #getAutoLowLatencyMode returns
     * available. This should only be called if the display supports Auto Low
     * true.
     * Latency Mode as reported in #getDynamicDisplayInfo.
     * For more information, see the HDMI 2.1 specification.
     * For more information, see the HDMI 2.1 specification.
     */
     */
    virtual void setAutoLowLatencyMode(const sp<IBinder>& display, bool on) = 0;
    virtual void setAutoLowLatencyMode(const sp<IBinder>& display, bool on) = 0;


    /**
     * Returns true if the connected display reports support for Game Content Type.
     * For more information, see the HDMI 1.4 specification.
     */
    virtual status_t getGameContentTypeSupport(const sp<IBinder>& display,
                                               bool* outSupport) const = 0;

    /**
    /**
     * This will start sending infoframes to the connected display with
     * This will start sending infoframes to the connected display with
     * ContentType=Game (if on=true). This will switch the disply to Game mode.
     * ContentType=Game (if on=true). This should only be called if the display
     * This should only be called if #getGameContentTypeSupport returns true.
     * Game Content Type as reported in #getDynamicDisplayInfo.
     * For more information, see the HDMI 1.4 specification.
     * For more information, see the HDMI 1.4 specification.
     */
     */
    virtual void setGameContentType(const sp<IBinder>& display, bool on) = 0;
    virtual void setGameContentType(const sp<IBinder>& display, bool on) = 0;
@@ -563,9 +548,9 @@ public:
        CAPTURE_DISPLAY_BY_ID,
        CAPTURE_DISPLAY_BY_ID,
        NOTIFY_POWER_BOOST,
        NOTIFY_POWER_BOOST,
        SET_GLOBAL_SHADOW_SETTINGS,
        SET_GLOBAL_SHADOW_SETTINGS,
        GET_AUTO_LOW_LATENCY_MODE_SUPPORT,
        GET_AUTO_LOW_LATENCY_MODE_SUPPORT, // Deprecated. Use GET_DYNAMIC_DISPLAY_INFO instead.
        SET_AUTO_LOW_LATENCY_MODE,
        SET_AUTO_LOW_LATENCY_MODE,
        GET_GAME_CONTENT_TYPE_SUPPORT,
        GET_GAME_CONTENT_TYPE_SUPPORT, // Deprecated. Use GET_DYNAMIC_DISPLAY_INFO instead.
        SET_GAME_CONTENT_TYPE,
        SET_GAME_CONTENT_TYPE,
        SET_FRAME_RATE,
        SET_FRAME_RATE,
        ACQUIRE_FRAME_RATE_FLEXIBILITY_TOKEN,
        ACQUIRE_FRAME_RATE_FLEXIBILITY_TOKEN,
+0 −6
Original line number Original line Diff line number Diff line
@@ -139,17 +139,11 @@ public:
    static status_t setActiveColorMode(const sp<IBinder>& display,
    static status_t setActiveColorMode(const sp<IBinder>& display,
            ui::ColorMode colorMode);
            ui::ColorMode colorMode);


    // Reports whether the connected display supports Auto Low Latency Mode
    static bool getAutoLowLatencyModeSupport(const sp<IBinder>& display);

    // Switches on/off Auto Low Latency Mode on the connected display. This should only be
    // Switches on/off Auto Low Latency Mode on the connected display. This should only be
    // called if the connected display supports Auto Low Latency Mode as reported by
    // called if the connected display supports Auto Low Latency Mode as reported by
    // #getAutoLowLatencyModeSupport
    // #getAutoLowLatencyModeSupport
    static void setAutoLowLatencyMode(const sp<IBinder>& display, bool on);
    static void setAutoLowLatencyMode(const sp<IBinder>& display, bool on);


    // Reports whether the connected display supports Game content type
    static bool getGameContentTypeSupport(const sp<IBinder>& display);

    // Turns Game mode on/off on the connected display. This should only be called
    // Turns Game mode on/off on the connected display. This should only be called
    // if the display supports Game content type, as reported by #getGameContentTypeSupport
    // if the display supports Game content type, as reported by #getGameContentTypeSupport
    static void setGameContentType(const sp<IBinder>& display, bool on);
    static void setGameContentType(const sp<IBinder>& display, bool on);
+0 −8
Original line number Original line Diff line number Diff line
@@ -757,15 +757,7 @@ public:
                            const sp<IScreenCaptureListener>& /* captureListener */) override {
                            const sp<IScreenCaptureListener>& /* captureListener */) override {
        return NO_ERROR;
        return NO_ERROR;
    }
    }
    status_t getAutoLowLatencyModeSupport(const sp<IBinder>& /*display*/,
                                          bool* /*outSupport*/) const override {
        return NO_ERROR;
    }
    void setAutoLowLatencyMode(const sp<IBinder>& /*display*/, bool /*on*/) override {}
    void setAutoLowLatencyMode(const sp<IBinder>& /*display*/, bool /*on*/) override {}
    status_t getGameContentTypeSupport(const sp<IBinder>& /*display*/,
                                       bool* /*outSupport*/) const override {
        return NO_ERROR;
    }
    void setGameContentType(const sp<IBinder>& /*display*/, bool /*on*/) override {}
    void setGameContentType(const sp<IBinder>& /*display*/, bool /*on*/) override {}
    status_t captureDisplay(uint64_t /*displayOrLayerStack*/,
    status_t captureDisplay(uint64_t /*displayOrLayerStack*/,
                            const sp<IScreenCaptureListener>& /* captureListener */) override {
                            const sp<IScreenCaptureListener>& /* captureListener */) override {
Loading