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

Commit 517ac2ec authored by Hansong Zhang's avatar Hansong Zhang
Browse files

Revert submission

Based on Forrest run with earlier base build 6069142, the build with this submission failed apct/bluetooth/instrumentation_test 

Reason for revert: Break tests

Change-Id: I4f59a7e3d5c5f401a260f3c8ab3457cf4e2fe386
parent 2bd7d433
Loading
Loading
Loading
Loading
+0 −74
Original line number Diff line number Diff line
@@ -48,12 +48,6 @@ interface IComposerClient extends @2.3::IComposerClient {
         * with protected buffers.
         */
        PROTECTED_CONTENTS = 4,

        /**
         * Indicates that both the composer HAL implementation and the given display
         * support a low latency mode, such as HDMI 2.1 Auto Low Latency Mode.
         */
        AUTO_LOW_LATENCY_MODE = 5,
    };

    /**
@@ -70,18 +64,6 @@ interface IComposerClient extends @2.3::IComposerClient {
        EXTERNAL = 1,
    };

    enum ContentType : uint32_t {
        NONE = 0,

        /**
         * These modes correspond to those found in the HDMI 1.4 specification.
         */
        GRAPHICS = 1,
        PHOTO = 2,
        CINEMA = 3,
        GAME = 4,
    };

    /**
     * Constraints for changing vsync period.
     */
@@ -190,60 +172,4 @@ interface IComposerClient extends @2.3::IComposerClient {
    setActiveConfigWithConstraints(Display display, Config config,
        VsyncPeriodChangeConstraints vsyncPeriodChangeConstraints)
        generates (Error error, VsyncPeriodChangeTimeline timeline);

    /**
     * Requests the display to enable/disable its low latency mode.
     *
     * If the display is connected via HDMI 2.1, then Auto Low Latency Mode should be triggered. If
     * the display is internally connected and a custom low latency mode is available, that should
     * be triggered.
     *
     * This function should only be called if the display reports support for
     * DisplayCapability::AUTO_LOW_LATENCY_MODE from getDisplayCapabilities_2_4.
     *
     * @return error is NONE upon success. Otherwise,
     *     BAD_DISPLAY when an invalid display handle was passed in.
     *     UNSUPPORTED when AUTO_LOW_LATENCY_MODE is not supported by the composer
     *         implementation or the given display
     */
    setAutoLowLatencyMode(Display display, bool on)
        generates (Error error);

    /**
     * Provides a list of all the content types supported by this display (any of
     * ContentType::{GRAPHICS, PHOTO, CINEMA, GAME}). This list must not change after
     * initialization.
     *
     * Content types are introduced in HDMI 1.4 and supporting them is optional. The
     * ContentType::NONE is always supported and will not be returned by this method..
     *
     * @return error is NONE upon success. Otherwise,
     *     BAD_DISPLAY when an invalid display handle was passed in.
     * @return supportedContentTypes is a list of supported content types.
     */
    getSupportedContentTypes(Display display)
        generates(Error error, vec<ContentType> supportedContentTypes);

    /**
     * Instructs the connected display that the content being shown is of the given type - one of
     * GRAPHICS, PHOTO, CINEMA, GAME.
     *
     * Content types are introduced in HDMI 1.4 and supporting them is optional. If they are
     * supported, this signal should switch the display to a mode that is optimal for the given
     * type of content. See HDMI 1.4 specification for more information.
     *
     * If the display is internally connected (not through HDMI), and such modes are available,
     * this method should trigger them.
     *
     * This function should only be called if the display reports support for the corresponding
     * content type (ContentType::{GRAPHICS, PHOTO, CINEMA, GAME}) from getSupportedContentTypes.
     * ContentType::NONE is supported by default and can always be set.
     *
     * @return error is NONE upon success. Otherwise,
     *     BAD_DISPLAY when an invalid display handle was passed in.
     *     UNSUPPORTED when the given content type is not supported by the composer
     *         implementation or the given display
     */
    setContentType(Display display, ContentType type)
        generates (Error error);
};
+0 −18
Original line number Diff line number Diff line
@@ -139,24 +139,6 @@ class ComposerClientImpl : public V2_3::hal::detail::ComposerClientImpl<Interfac
        return Void();
    }

    Return<Error> setAutoLowLatencyMode(Display display, bool on) override {
        return mHal->setAutoLowLatencyMode(display, on);
    }

    Return<void> getSupportedContentTypes(
            Display display, IComposerClient::getSupportedContentTypes_cb hidl_cb) override {
        std::vector<IComposerClient::ContentType> supportedContentTypes;
        Error error = mHal->getSupportedContentTypes(display, &supportedContentTypes);

        hidl_cb(error, supportedContentTypes);
        return Void();
    }

    Return<Error> setContentType(Display display,
                                 IComposerClient::ContentType contentType) override {
        return mHal->setContentType(display, contentType);
    }

    static std::unique_ptr<ComposerClientImpl> create(Hal* hal) {
        auto client = std::make_unique<ComposerClientImpl>(hal);
        return client->init() ? std::move(client) : nullptr;
+0 −5
Original line number Diff line number Diff line
@@ -67,11 +67,6 @@ class ComposerHal : public V2_3::hal::ComposerHal {
            Display display, Config config,
            const IComposerClient::VsyncPeriodChangeConstraints& vsyncPeriodChangeConstraints,
            VsyncPeriodChangeTimeline* timeline) = 0;
    virtual Error setAutoLowLatencyMode(Display display, bool on) = 0;
    virtual Error getSupportedContentTypes(
            Display display,
            std::vector<IComposerClient::ContentType>* outSupportedContentTypes) = 0;
    virtual Error setContentType(Display display, IComposerClient::ContentType contentType) = 0;
};

}  // namespace hal
+0 −59
Original line number Diff line number Diff line
@@ -167,57 +167,6 @@ class HwcHalImpl : public V2_3::passthrough::detail::HwcHalImpl<Hal> {
        return Error::NONE;
    }

    Error setAutoLowLatencyMode(Display display, bool on) override {
        if (!mDispatch.setAutoLowLatencyMode) {
            return Error::UNSUPPORTED;
        }

        int32_t error = mDispatch.setAutoLowLatencyMode(mDevice, display, on);
        if (error != HWC2_ERROR_NONE) {
            return static_cast<Error>(error);
        }
        return Error::NONE;
    }

    Error getSupportedContentTypes(
            Display display,
            std::vector<IComposerClient::ContentType>* outSupportedContentTypes) override {
        if (!mDispatch.getSupportedContentTypes) {
            return Error::UNSUPPORTED;
        }

        uint32_t count = 0;
        int32_t error = mDispatch.getSupportedContentTypes(mDevice, display, &count, nullptr);
        if (error != HWC2_ERROR_NONE) {
            return static_cast<Error>(error);
        }

        outSupportedContentTypes->resize(count);

        error = mDispatch.getSupportedContentTypes(
                mDevice, display, &count,
                reinterpret_cast<std::underlying_type<IComposerClient::ContentType>::type*>(
                        outSupportedContentTypes->data()));
        if (error != HWC2_ERROR_NONE) {
            *outSupportedContentTypes = std::vector<IComposerClient::ContentType>();
            return static_cast<Error>(error);
        }
        return Error::NONE;
    }

    Error setContentType(Display display, IComposerClient::ContentType contentType) override {
        if (!mDispatch.setContentType) {
            return Error::UNSUPPORTED;
        }

        int32_t error =
                mDispatch.setContentType(mDevice, display, static_cast<int32_t>(contentType));
        if (error != HWC2_ERROR_NONE) {
            return static_cast<Error>(error);
        }
        return Error::NONE;
    }

  protected:
    bool initDispatch() override {
        if (!BaseType2_3::initDispatch()) {
@@ -230,11 +179,6 @@ class HwcHalImpl : public V2_3::passthrough::detail::HwcHalImpl<Hal> {
                                   &mDispatch.getDisplayVsyncPeriod);
        this->initOptionalDispatch(HWC2_FUNCTION_SET_ACTIVE_CONFIG_WITH_CONSTRAINTS,
                                   &mDispatch.setActiveConfigWithConstraints);
        this->initOptionalDispatch(HWC2_FUNCTION_SET_AUTO_LOW_LATENCY_MODE,
                                   &mDispatch.setAutoLowLatencyMode);
        this->initOptionalDispatch(HWC2_FUNCTION_GET_SUPPORTED_CONTENT_TYPES,
                                   &mDispatch.getSupportedContentTypes);
        this->initOptionalDispatch(HWC2_FUNCTION_SET_CONTENT_TYPE, &mDispatch.setContentType);
        return true;
    }

@@ -278,9 +222,6 @@ class HwcHalImpl : public V2_3::passthrough::detail::HwcHalImpl<Hal> {
        HWC2_PFN_GET_DISPLAY_CONNECTION_TYPE getDisplayConnectionType;
        HWC2_PFN_GET_DISPLAY_VSYNC_PERIOD getDisplayVsyncPeriod;
        HWC2_PFN_SET_ACTIVE_CONFIG_WITH_CONSTRAINTS setActiveConfigWithConstraints;
        HWC2_PFN_SET_AUTO_LOW_LATENCY_MODE setAutoLowLatencyMode;
        HWC2_PFN_GET_SUPPORTED_CONTENT_TYPES getSupportedContentTypes;
        HWC2_PFN_SET_CONTENT_TYPE setContentType;
    } mDispatch = {};

    hal::ComposerHal::EventCallback_2_4* mEventCallback_2_4 = nullptr;
+0 −19
Original line number Diff line number Diff line
@@ -106,25 +106,6 @@ Error ComposerClient::setActiveConfigWithConstraints(
    return error;
}

Error ComposerClient::setAutoLowLatencyMode(Display display, bool on) {
    return mClient->setAutoLowLatencyMode(display, on);
}

Error ComposerClient::getSupportedContentTypes(
        Display display, std::vector<IComposerClient::ContentType>* outSupportedContentTypes) {
    Error error = Error::NONE;
    mClient->getSupportedContentTypes(
            display, [&](const auto& tmpError, const auto& tmpSupportedContentTypes) {
                error = tmpError;
                *outSupportedContentTypes = tmpSupportedContentTypes;
            });
    return error;
}

Error ComposerClient::setContentType(Display display, IComposerClient::ContentType contentType) {
    return mClient->setContentType(display, contentType);
}

}  // namespace vts
}  // namespace V2_4
}  // namespace composer
Loading