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

Commit ce44a4b3 authored by Dominik Laskowski's avatar Dominik Laskowski
Browse files

composer: Add getDisplayConnectionType

Distinguish between internal and external displays, to obviate assuming
that the first display is internal and subsequent displays are external.

Note that connector types (e.g. DSI, HDMI, DisplayPort) are not enumerated,
since that information is irrelevant for internal connections, and can be
extracted from the EDID for external connections in the few cases where it
matters, e.g. gating features like daisy chaining and content protection.

Bug: 134771872
Test: Build
Change-Id: I8a27e4ef569626620711910fcbaed5a7e12e6870
parent 5d16469e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -204,7 +204,7 @@
    </hal>
    <hal format="hidl" optional="false">
        <name>android.hardware.graphics.composer</name>
        <version>2.1-3</version>
        <version>2.1-4</version>
        <interface>
            <name>IComposer</name>
            <instance>default</instance>
+0 −2
Original line number Diff line number Diff line
@@ -17,12 +17,10 @@
package android.hardware.graphics.composer@2.4;

import IComposerClient;

import @2.1::Error;
import @2.3::IComposer;

interface IComposer extends @2.3::IComposer {

    /**
     * Creates a v2.4 client of the composer. Supersedes @2.3::createClient.
     *
+25 −4
Original line number Diff line number Diff line
@@ -21,13 +21,12 @@ import @2.1::Error;
import @2.3::IComposerClient;

interface IComposerClient extends @2.3::IComposerClient {

    /**
     * Required capabilities which are supported by the display. The
     * particular set of supported capabilities for a given display may be
     * retrieved using getDisplayCapabilities.
     */
    enum DisplayCapability : uint32_t {
    enum DisplayCapability : @2.3::IComposerClient.DisplayCapability {
        /**
         * Indicates that the display supports protected contents.
         * When returned, hardware composer must be able to accept client target
@@ -36,6 +35,20 @@ interface IComposerClient extends @2.3::IComposerClient {
        PROTECTED_CONTENTS = 4,
    };

    /**
     * Supersedes {@link @2.1::IComposerClient.DisplayType}.
     */
    enum DisplayConnectionType : uint32_t {
        /**
         * Display is connected through internal port, e.g. DSI, eDP.
         */
        INTERNAL = 0,
        /**
         * Display is connected through external port, e.g. HDMI, DisplayPort.
         */
        EXTERNAL = 1,
    };

    /**
     * Provides a list of supported capabilities (as described in the
     * definition of DisplayCapability above). This list must not change after
@@ -46,6 +59,14 @@ interface IComposerClient extends @2.3::IComposerClient {
     * @return capabilities is a list of supported capabilities.
     */
    getDisplayCapabilities_2_4(Display display)
              generates (Error error,
                         vec<DisplayCapability> capabilities);
        generates (Error error, vec<DisplayCapability> capabilities);

    /**
     * Returns whether the given physical display is internal or external.
     *
     * @return error is NONE upon success. Otherwise,
     *     BAD_DISPLAY when the given display is invalid or virtual.
     * @return type is the connection type of the display.
     */
    getDisplayConnectionType(Display display) generates (Error error, DisplayConnectionType type);
};
+8 −0
Original line number Diff line number Diff line
@@ -46,6 +46,14 @@ class ComposerClientImpl : public V2_3::hal::detail::ComposerClientImpl<Interfac
        return Void();
    }

    Return<void> getDisplayConnectionType(
            Display display, IComposerClient::getDisplayConnectionType_cb hidl_cb) override {
        IComposerClient::DisplayConnectionType type;
        Error error = mHal->getDisplayConnectionType(display, &type);
        hidl_cb(error, type);
        return Void();
    }

    static std::unique_ptr<ComposerClientImpl> create(Hal* hal) {
        auto client = std::make_unique<ComposerClientImpl>(hal);
        return client->init() ? std::move(client) : nullptr;
+2 −0
Original line number Diff line number Diff line
@@ -38,6 +38,8 @@ class ComposerHal : public V2_3::hal::ComposerHal {
  public:
    virtual Error getDisplayCapabilities_2_4(
            Display display, std::vector<IComposerClient::DisplayCapability>* outCapabilities) = 0;
    virtual Error getDisplayConnectionType(Display display,
                                           IComposerClient::DisplayConnectionType* outType) = 0;
};

}  // namespace hal
Loading