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

Commit 329808e1 authored by Marin Shalamanov's avatar Marin Shalamanov Committed by Android (Google) Code Review
Browse files

Merge "SF: Move ALLM and GameContentType to DynamicDisplayInfo" into sc-dev

parents 7dc57eff b173f759
Loading
Loading
Loading
Loading
+0 −70
Original line number Diff line number Diff line
@@ -411,24 +411,6 @@ public:
        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 {
        Parcel data, reply;
        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 {
        Parcel data, reply;
        status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
@@ -1423,23 +1388,6 @@ status_t BnSurfaceComposer::onTransact(
            result = reply->writeInt32(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: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            sp<IBinder> display = nullptr;
@@ -1457,23 +1405,6 @@ status_t BnSurfaceComposer::onTransact(
            setAutoLowLatencyMode(display, setAllm);
            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: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            sp<IBinder> display = nullptr;
@@ -1491,7 +1422,6 @@ status_t BnSurfaceComposer::onTransact(
            setGameContentType(display, setGameContentTypeOn);
            return result;
        }

        case CLEAR_ANIMATION_FRAME_STATS: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            status_t result = clearAnimationFrameStats();
+0 −12
Original line number Diff line number Diff line
@@ -1904,22 +1904,10 @@ status_t SurfaceComposerClient::setActiveColorMode(const sp<IBinder>& display,
    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) {
    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) {
    ComposerService::getComposerService()->setGameContentType(display, on);
}
+6 −21
Original line number Diff line number Diff line
@@ -218,33 +218,18 @@ public:
    virtual status_t setActiveColorMode(const sp<IBinder>& display,
            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
     * available. This should only be called if #getAutoLowLatencyMode returns
     * true.
     * available. This should only be called if the display supports Auto Low
     * Latency Mode as reported in #getDynamicDisplayInfo.
     * For more information, see the HDMI 2.1 specification.
     */
    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
     * ContentType=Game (if on=true). This will switch the disply to Game mode.
     * This should only be called if #getGameContentTypeSupport returns true.
     * ContentType=Game (if on=true). This should only be called if the display
     * Game Content Type as reported in #getDynamicDisplayInfo.
     * For more information, see the HDMI 1.4 specification.
     */
    virtual void setGameContentType(const sp<IBinder>& display, bool on) = 0;
@@ -563,9 +548,9 @@ public:
        CAPTURE_DISPLAY_BY_ID,
        NOTIFY_POWER_BOOST,
        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,
        GET_GAME_CONTENT_TYPE_SUPPORT,
        GET_GAME_CONTENT_TYPE_SUPPORT, // Deprecated. Use GET_DYNAMIC_DISPLAY_INFO instead.
        SET_GAME_CONTENT_TYPE,
        SET_FRAME_RATE,
        ACQUIRE_FRAME_RATE_FLEXIBILITY_TOKEN,
+0 −6
Original line number Diff line number Diff line
@@ -143,17 +143,11 @@ public:
    static status_t setActiveColorMode(const sp<IBinder>& display,
            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
    // called if the connected display supports Auto Low Latency Mode as reported by
    // #getAutoLowLatencyModeSupport
    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
    // if the display supports Game content type, as reported by #getGameContentTypeSupport
    static void setGameContentType(const sp<IBinder>& display, bool on);
+0 −8
Original line number Diff line number Diff line
@@ -757,15 +757,7 @@ public:
                            const sp<IScreenCaptureListener>& /* captureListener */) override {
        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 {}
    status_t getGameContentTypeSupport(const sp<IBinder>& /*display*/,
                                       bool* /*outSupport*/) const override {
        return NO_ERROR;
    }
    void setGameContentType(const sp<IBinder>& /*display*/, bool /*on*/) override {}
    status_t captureDisplay(uint64_t /*displayOrLayerStack*/,
                            const sp<IScreenCaptureListener>& /* captureListener */) override {
Loading