xref: /aosp_15_r20/hardware/interfaces/graphics/composer/2.4/IComposerClient.hal (revision 4d7e907c777eeecc4c5bd7cf640a754fac206ff7)
1*4d7e907cSAndroid Build Coastguard Worker/*
2*4d7e907cSAndroid Build Coastguard Worker * Copyright 2019 The Android Open Source Project
3*4d7e907cSAndroid Build Coastguard Worker *
4*4d7e907cSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License");
5*4d7e907cSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License.
6*4d7e907cSAndroid Build Coastguard Worker * You may obtain a copy of the License at
7*4d7e907cSAndroid Build Coastguard Worker *
8*4d7e907cSAndroid Build Coastguard Worker *      http://www.apache.org/licenses/LICENSE-2.0
9*4d7e907cSAndroid Build Coastguard Worker *
10*4d7e907cSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software
11*4d7e907cSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS,
12*4d7e907cSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*4d7e907cSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and
14*4d7e907cSAndroid Build Coastguard Worker * limitations under the License.
15*4d7e907cSAndroid Build Coastguard Worker */
16*4d7e907cSAndroid Build Coastguard Worker
17*4d7e907cSAndroid Build Coastguard Workerpackage [email protected];
18*4d7e907cSAndroid Build Coastguard Worker
19*4d7e907cSAndroid Build Coastguard Workerimport [email protected]::PixelFormat;
20*4d7e907cSAndroid Build Coastguard Workerimport [email protected]::Dataspace;
21*4d7e907cSAndroid Build Coastguard Workerimport [email protected]::IComposerClient.Command;
22*4d7e907cSAndroid Build Coastguard Workerimport IComposerCallback;
23*4d7e907cSAndroid Build Coastguard Workerimport @2.1::Config;
24*4d7e907cSAndroid Build Coastguard Workerimport @2.1::Display;
25*4d7e907cSAndroid Build Coastguard Workerimport @2.1::Error;
26*4d7e907cSAndroid Build Coastguard Workerimport @2.1::IComposerClient;
27*4d7e907cSAndroid Build Coastguard Workerimport @2.3::IComposerClient;
28*4d7e907cSAndroid Build Coastguard Worker
29*4d7e907cSAndroid Build Coastguard Workerinterface IComposerClient extends @2.3::IComposerClient {
30*4d7e907cSAndroid Build Coastguard Worker    /**
31*4d7e907cSAndroid Build Coastguard Worker     * Display attributes queryable through getDisplayAttribute_2_4.
32*4d7e907cSAndroid Build Coastguard Worker     */
33*4d7e907cSAndroid Build Coastguard Worker    enum Attribute : @2.1::IComposerClient.Attribute {
34*4d7e907cSAndroid Build Coastguard Worker        /**
35*4d7e907cSAndroid Build Coastguard Worker         * The configuration group ID (as int32_t) this config is associated to.
36*4d7e907cSAndroid Build Coastguard Worker         * Switching between configurations within the same group may be done seamlessly
37*4d7e907cSAndroid Build Coastguard Worker         * in some conditions via setActiveConfigWithConstraints.
38*4d7e907cSAndroid Build Coastguard Worker         */
39*4d7e907cSAndroid Build Coastguard Worker        CONFIG_GROUP = 7,
40*4d7e907cSAndroid Build Coastguard Worker    };
41*4d7e907cSAndroid Build Coastguard Worker
42*4d7e907cSAndroid Build Coastguard Worker    /**
43*4d7e907cSAndroid Build Coastguard Worker     * Required capabilities which are supported by the display. The
44*4d7e907cSAndroid Build Coastguard Worker     * particular set of supported capabilities for a given display may be
45*4d7e907cSAndroid Build Coastguard Worker     * retrieved using getDisplayCapabilities.
46*4d7e907cSAndroid Build Coastguard Worker     */
47*4d7e907cSAndroid Build Coastguard Worker    enum DisplayCapability : @2.3::IComposerClient.DisplayCapability {
48*4d7e907cSAndroid Build Coastguard Worker        /**
49*4d7e907cSAndroid Build Coastguard Worker         * Indicates that the display supports protected contents.
50*4d7e907cSAndroid Build Coastguard Worker         * When returned, hardware composer must be able to accept client target
51*4d7e907cSAndroid Build Coastguard Worker         * with protected buffers.
52*4d7e907cSAndroid Build Coastguard Worker         */
53*4d7e907cSAndroid Build Coastguard Worker        PROTECTED_CONTENTS = 4,
54*4d7e907cSAndroid Build Coastguard Worker
55*4d7e907cSAndroid Build Coastguard Worker        /**
56*4d7e907cSAndroid Build Coastguard Worker         * Indicates that both the composer HAL implementation and the given display
57*4d7e907cSAndroid Build Coastguard Worker         * support a low latency mode, such as HDMI 2.1 Auto Low Latency Mode.
58*4d7e907cSAndroid Build Coastguard Worker         */
59*4d7e907cSAndroid Build Coastguard Worker        AUTO_LOW_LATENCY_MODE = 5,
60*4d7e907cSAndroid Build Coastguard Worker    };
61*4d7e907cSAndroid Build Coastguard Worker
62*4d7e907cSAndroid Build Coastguard Worker    enum Command : @2.3::IComposerClient.Command {
63*4d7e907cSAndroid Build Coastguard Worker        /**
64*4d7e907cSAndroid Build Coastguard Worker         * SET_CLIENT_TARGET_PROPERTY has this pseudo prototype
65*4d7e907cSAndroid Build Coastguard Worker         *
66*4d7e907cSAndroid Build Coastguard Worker         * This command has the following binary layout in bytes:
67*4d7e907cSAndroid Build Coastguard Worker         *
68*4d7e907cSAndroid Build Coastguard Worker         *     0 - 3: clientTargetProperty.pixelFormat
69*4d7e907cSAndroid Build Coastguard Worker         *     4 - 7: clientTargetProperty.dataspace
70*4d7e907cSAndroid Build Coastguard Worker         *
71*4d7e907cSAndroid Build Coastguard Worker         *   setClientTargetProperty(ClientTargetProperty clientTargetProperty);
72*4d7e907cSAndroid Build Coastguard Worker         */
73*4d7e907cSAndroid Build Coastguard Worker         SET_CLIENT_TARGET_PROPERTY = 0x105 << @2.1::IComposerClient.Command:OPCODE_SHIFT,
74*4d7e907cSAndroid Build Coastguard Worker
75*4d7e907cSAndroid Build Coastguard Worker        /**
76*4d7e907cSAndroid Build Coastguard Worker         * SET_LAYER_GENERIC_METADATA has this pseudo prototype
77*4d7e907cSAndroid Build Coastguard Worker         *
78*4d7e907cSAndroid Build Coastguard Worker         *   setLayerGenericMetadata(string key, bool mandatory, vec<uint8_t> value);
79*4d7e907cSAndroid Build Coastguard Worker         *
80*4d7e907cSAndroid Build Coastguard Worker         * Sets a piece of generic metadata for the given layer. If this
81*4d7e907cSAndroid Build Coastguard Worker         * function is called twice with the same key but different values, the
82*4d7e907cSAndroid Build Coastguard Worker         * newer value must override the older one. Calling this function with a
83*4d7e907cSAndroid Build Coastguard Worker         * 0-length value must reset that key's metadata as if it had not been
84*4d7e907cSAndroid Build Coastguard Worker         * set.
85*4d7e907cSAndroid Build Coastguard Worker         *
86*4d7e907cSAndroid Build Coastguard Worker         * A given piece of metadata may either be mandatory or a hint
87*4d7e907cSAndroid Build Coastguard Worker         * (non-mandatory) as indicated by the second parameter. Mandatory
88*4d7e907cSAndroid Build Coastguard Worker         * metadata may affect the composition result, which is to say that it
89*4d7e907cSAndroid Build Coastguard Worker         * may cause a visible change in the final image. By contrast, hints may
90*4d7e907cSAndroid Build Coastguard Worker         * only affect the composition strategy, such as which layers are
91*4d7e907cSAndroid Build Coastguard Worker         * composited by the client, but must not cause a visible change in the
92*4d7e907cSAndroid Build Coastguard Worker         * final image. The value of the mandatory flag shall match the value
93*4d7e907cSAndroid Build Coastguard Worker         * returned from getLayerGenericMetadataKeys for the given key.
94*4d7e907cSAndroid Build Coastguard Worker         *
95*4d7e907cSAndroid Build Coastguard Worker         * Only keys which have been returned from getLayerGenericMetadataKeys()
96*4d7e907cSAndroid Build Coastguard Worker         * shall be accepted. Any other keys must result in an UNSUPPORTED error.
97*4d7e907cSAndroid Build Coastguard Worker         *
98*4d7e907cSAndroid Build Coastguard Worker         * The value passed into this function shall be the binary
99*4d7e907cSAndroid Build Coastguard Worker         * representation of a HIDL type corresponding to the given key. For
100*4d7e907cSAndroid Build Coastguard Worker         * example, a key of 'com.example.V1_3.Foo' shall be paired with a
101*4d7e907cSAndroid Build Coastguard Worker         * value of type [email protected]::Foo, which would be defined in a
102*4d7e907cSAndroid Build Coastguard Worker         * vendor HAL extension.
103*4d7e907cSAndroid Build Coastguard Worker         *
104*4d7e907cSAndroid Build Coastguard Worker         * This function will be encoded in the command buffer in this order:
105*4d7e907cSAndroid Build Coastguard Worker         *   1) The key length, stored as a uint32_t
106*4d7e907cSAndroid Build Coastguard Worker         *   2) The key itself, padded to a uint32_t boundary if necessary
107*4d7e907cSAndroid Build Coastguard Worker         *   3) The mandatory flag, stored as a uint32_t
108*4d7e907cSAndroid Build Coastguard Worker         *   4) The value length in bytes, stored as a uint32_t
109*4d7e907cSAndroid Build Coastguard Worker         *   5) The value itself, padded to a uint32_t boundary if necessary
110*4d7e907cSAndroid Build Coastguard Worker         *
111*4d7e907cSAndroid Build Coastguard Worker         * @param key indicates which metadata value should be set on this layer
112*4d7e907cSAndroid Build Coastguard Worker         * @param mandatory indicates whether this particular key represents
113*4d7e907cSAndroid Build Coastguard Worker         *        mandatory metadata or a hint (non-mandatory metadata), as
114*4d7e907cSAndroid Build Coastguard Worker         *        described above
115*4d7e907cSAndroid Build Coastguard Worker         * @param value is a binary representation of a HIDL struct
116*4d7e907cSAndroid Build Coastguard Worker         *        corresponding to the key as described above
117*4d7e907cSAndroid Build Coastguard Worker         */
118*4d7e907cSAndroid Build Coastguard Worker        SET_LAYER_GENERIC_METADATA = 0x40e << @2.1::IComposerClient.Command:OPCODE_SHIFT,
119*4d7e907cSAndroid Build Coastguard Worker    };
120*4d7e907cSAndroid Build Coastguard Worker
121*4d7e907cSAndroid Build Coastguard Worker    /**
122*4d7e907cSAndroid Build Coastguard Worker     * Supersedes {@link @2.1::IComposerClient.DisplayType}.
123*4d7e907cSAndroid Build Coastguard Worker     */
124*4d7e907cSAndroid Build Coastguard Worker    enum DisplayConnectionType : uint32_t {
125*4d7e907cSAndroid Build Coastguard Worker        /**
126*4d7e907cSAndroid Build Coastguard Worker         * Display is connected through internal port, e.g. DSI, eDP.
127*4d7e907cSAndroid Build Coastguard Worker         */
128*4d7e907cSAndroid Build Coastguard Worker        INTERNAL = 0,
129*4d7e907cSAndroid Build Coastguard Worker        /**
130*4d7e907cSAndroid Build Coastguard Worker         * Display is connected through external port, e.g. HDMI, DisplayPort.
131*4d7e907cSAndroid Build Coastguard Worker         */
132*4d7e907cSAndroid Build Coastguard Worker        EXTERNAL = 1,
133*4d7e907cSAndroid Build Coastguard Worker    };
134*4d7e907cSAndroid Build Coastguard Worker
135*4d7e907cSAndroid Build Coastguard Worker    enum ContentType : uint32_t {
136*4d7e907cSAndroid Build Coastguard Worker        NONE = 0,
137*4d7e907cSAndroid Build Coastguard Worker
138*4d7e907cSAndroid Build Coastguard Worker        /**
139*4d7e907cSAndroid Build Coastguard Worker         * These modes correspond to those found in the HDMI 1.4 specification.
140*4d7e907cSAndroid Build Coastguard Worker         */
141*4d7e907cSAndroid Build Coastguard Worker        GRAPHICS = 1,
142*4d7e907cSAndroid Build Coastguard Worker        PHOTO = 2,
143*4d7e907cSAndroid Build Coastguard Worker        CINEMA = 3,
144*4d7e907cSAndroid Build Coastguard Worker        GAME = 4,
145*4d7e907cSAndroid Build Coastguard Worker    };
146*4d7e907cSAndroid Build Coastguard Worker
147*4d7e907cSAndroid Build Coastguard Worker    /**
148*4d7e907cSAndroid Build Coastguard Worker     * Constraints for changing vsync period.
149*4d7e907cSAndroid Build Coastguard Worker     */
150*4d7e907cSAndroid Build Coastguard Worker    struct VsyncPeriodChangeConstraints {
151*4d7e907cSAndroid Build Coastguard Worker        /**
152*4d7e907cSAndroid Build Coastguard Worker         * Time in CLOCK_MONOTONIC after which the vsync period may change
153*4d7e907cSAndroid Build Coastguard Worker         * (i.e., the vsync period must not change before this time).
154*4d7e907cSAndroid Build Coastguard Worker         */
155*4d7e907cSAndroid Build Coastguard Worker        int64_t desiredTimeNanos;
156*4d7e907cSAndroid Build Coastguard Worker
157*4d7e907cSAndroid Build Coastguard Worker        /**
158*4d7e907cSAndroid Build Coastguard Worker         * If true, requires that the vsync period change must happen seamlessly without
159*4d7e907cSAndroid Build Coastguard Worker         * a noticeable visual artifact.
160*4d7e907cSAndroid Build Coastguard Worker         */
161*4d7e907cSAndroid Build Coastguard Worker        bool seamlessRequired;
162*4d7e907cSAndroid Build Coastguard Worker    };
163*4d7e907cSAndroid Build Coastguard Worker
164*4d7e907cSAndroid Build Coastguard Worker    struct ClientTargetProperty {
165*4d7e907cSAndroid Build Coastguard Worker        PixelFormat pixelFormat;
166*4d7e907cSAndroid Build Coastguard Worker        Dataspace dataspace;
167*4d7e907cSAndroid Build Coastguard Worker    };
168*4d7e907cSAndroid Build Coastguard Worker
169*4d7e907cSAndroid Build Coastguard Worker    /**
170*4d7e907cSAndroid Build Coastguard Worker     * Provides a IComposerCallback object for the device to call.
171*4d7e907cSAndroid Build Coastguard Worker     *
172*4d7e907cSAndroid Build Coastguard Worker     * This function must be called only once.
173*4d7e907cSAndroid Build Coastguard Worker     *
174*4d7e907cSAndroid Build Coastguard Worker     * @param callback is the IComposerCallback object.
175*4d7e907cSAndroid Build Coastguard Worker     */
176*4d7e907cSAndroid Build Coastguard Worker    registerCallback_2_4(IComposerCallback callback);
177*4d7e907cSAndroid Build Coastguard Worker
178*4d7e907cSAndroid Build Coastguard Worker    /**
179*4d7e907cSAndroid Build Coastguard Worker     * Provides a list of supported capabilities (as described in the
180*4d7e907cSAndroid Build Coastguard Worker     * definition of DisplayCapability above). This list must not change after
181*4d7e907cSAndroid Build Coastguard Worker     * initialization.
182*4d7e907cSAndroid Build Coastguard Worker     *
183*4d7e907cSAndroid Build Coastguard Worker     * @return error is NONE upon success. Otherwise,
184*4d7e907cSAndroid Build Coastguard Worker     *     BAD_DISPLAY when an invalid display handle was passed in.
185*4d7e907cSAndroid Build Coastguard Worker     * @return capabilities is a list of supported capabilities.
186*4d7e907cSAndroid Build Coastguard Worker     */
187*4d7e907cSAndroid Build Coastguard Worker    getDisplayCapabilities_2_4(Display display)
188*4d7e907cSAndroid Build Coastguard Worker        generates (Error error, vec<DisplayCapability> capabilities);
189*4d7e907cSAndroid Build Coastguard Worker
190*4d7e907cSAndroid Build Coastguard Worker    /**
191*4d7e907cSAndroid Build Coastguard Worker     * Returns whether the given physical display is internal or external.
192*4d7e907cSAndroid Build Coastguard Worker     *
193*4d7e907cSAndroid Build Coastguard Worker     * @return error is NONE upon success. Otherwise,
194*4d7e907cSAndroid Build Coastguard Worker     *     BAD_DISPLAY when the given display is invalid or virtual.
195*4d7e907cSAndroid Build Coastguard Worker     * @return type is the connection type of the display.
196*4d7e907cSAndroid Build Coastguard Worker     */
197*4d7e907cSAndroid Build Coastguard Worker    getDisplayConnectionType(Display display) generates (Error error, DisplayConnectionType type);
198*4d7e907cSAndroid Build Coastguard Worker
199*4d7e907cSAndroid Build Coastguard Worker    /**
200*4d7e907cSAndroid Build Coastguard Worker     * Returns a display attribute value for a particular display
201*4d7e907cSAndroid Build Coastguard Worker     * configuration.
202*4d7e907cSAndroid Build Coastguard Worker     *
203*4d7e907cSAndroid Build Coastguard Worker     * @param display is the display to query.
204*4d7e907cSAndroid Build Coastguard Worker     * @param config is the display configuration for which to return
205*4d7e907cSAndroid Build Coastguard Worker     *        attribute values.
206*4d7e907cSAndroid Build Coastguard Worker     * @return error is NONE upon success. Otherwise,
207*4d7e907cSAndroid Build Coastguard Worker     *         BAD_DISPLAY when an invalid display handle was passed in.
208*4d7e907cSAndroid Build Coastguard Worker     *         BAD_CONFIG when config does not name a valid configuration for
209*4d7e907cSAndroid Build Coastguard Worker     *                    this display.
210*4d7e907cSAndroid Build Coastguard Worker     *         BAD_PARAMETER when attribute is unrecognized.
211*4d7e907cSAndroid Build Coastguard Worker     *         UNSUPPORTED when attribute cannot be queried for the config.
212*4d7e907cSAndroid Build Coastguard Worker     * @return value is the value of the attribute.
213*4d7e907cSAndroid Build Coastguard Worker     */
214*4d7e907cSAndroid Build Coastguard Worker    getDisplayAttribute_2_4(Display display, Config config, Attribute attribute)
215*4d7e907cSAndroid Build Coastguard Worker        generates (Error error, int32_t value);
216*4d7e907cSAndroid Build Coastguard Worker
217*4d7e907cSAndroid Build Coastguard Worker    /**
218*4d7e907cSAndroid Build Coastguard Worker     * Retrieves which vsync period the display is currently using.
219*4d7e907cSAndroid Build Coastguard Worker     *
220*4d7e907cSAndroid Build Coastguard Worker     * If no display configuration is currently active, this function must
221*4d7e907cSAndroid Build Coastguard Worker     * return BAD_CONFIG. If the vsync period is about to change due to a
222*4d7e907cSAndroid Build Coastguard Worker     * setActiveConfigWithConstraints call, this function must return the current vsync period
223*4d7e907cSAndroid Build Coastguard Worker     * until the change takes place.
224*4d7e907cSAndroid Build Coastguard Worker     *
225*4d7e907cSAndroid Build Coastguard Worker     * @param display is the display for which the vsync period is queried.
226*4d7e907cSAndroid Build Coastguard Worker     * @return error is NONE upon success. Otherwise,
227*4d7e907cSAndroid Build Coastguard Worker     *         BAD_DISPLAY when an invalid display handle was passed in.
228*4d7e907cSAndroid Build Coastguard Worker     *         BAD_CONFIG when no configuration is currently active.
229*4d7e907cSAndroid Build Coastguard Worker     * @return vsyncPeriodNanos is the current vsync period of the display.
230*4d7e907cSAndroid Build Coastguard Worker     */
231*4d7e907cSAndroid Build Coastguard Worker    getDisplayVsyncPeriod(Display display)
232*4d7e907cSAndroid Build Coastguard Worker        generates (Error error, VsyncPeriodNanos vsyncPeriodNanos);
233*4d7e907cSAndroid Build Coastguard Worker
234*4d7e907cSAndroid Build Coastguard Worker    /**
235*4d7e907cSAndroid Build Coastguard Worker     * Sets the active configuration and the refresh rate for this display.
236*4d7e907cSAndroid Build Coastguard Worker     * If the new config shares the same config group as the current config,
237*4d7e907cSAndroid Build Coastguard Worker     * only the vsync period shall change.
238*4d7e907cSAndroid Build Coastguard Worker     * Upon returning, the given display configuration, except vsync period, must be active and
239*4d7e907cSAndroid Build Coastguard Worker     * remain so until either this function is called again or the display is disconnected.
240*4d7e907cSAndroid Build Coastguard Worker     * When the display starts to refresh at the new vsync period, onVsync_2_4 callback must be
241*4d7e907cSAndroid Build Coastguard Worker     * called with the new vsync period.
242*4d7e907cSAndroid Build Coastguard Worker     *
243*4d7e907cSAndroid Build Coastguard Worker     * @param display is the display for which the active config is set.
244*4d7e907cSAndroid Build Coastguard Worker     * @param config is the new display configuration.
245*4d7e907cSAndroid Build Coastguard Worker     * @param vsyncPeriodChangeConstraints are the constraints required for changing vsync period.
246*4d7e907cSAndroid Build Coastguard Worker     *
247*4d7e907cSAndroid Build Coastguard Worker     * @return error is NONE upon success. Otherwise,
248*4d7e907cSAndroid Build Coastguard Worker     *         BAD_DISPLAY when an invalid display handle was passed in.
249*4d7e907cSAndroid Build Coastguard Worker     *         BAD_CONFIG when the configuration handle passed in is not valid
250*4d7e907cSAndroid Build Coastguard Worker     *                    for this display.
251*4d7e907cSAndroid Build Coastguard Worker     *         SEAMLESS_NOT_ALLOWED when seamlessRequired was true but config provided doesn't
252*4d7e907cSAndroid Build Coastguard Worker     *                              share the same config group as the current config.
253*4d7e907cSAndroid Build Coastguard Worker     *         SEAMLESS_NOT_POSSIBLE when seamlessRequired was true but the display cannot achieve
254*4d7e907cSAndroid Build Coastguard Worker     *                               the vsync period change without a noticeable visual artifact.
255*4d7e907cSAndroid Build Coastguard Worker     *                               When the conditions change and it may be possible to change
256*4d7e907cSAndroid Build Coastguard Worker     *                               the vsync period seamlessly, onSeamlessPossible callback
257*4d7e907cSAndroid Build Coastguard Worker     *                               must be called to indicate that caller should retry.
258*4d7e907cSAndroid Build Coastguard Worker     * @return timeline is the timeline for the vsync period change.
259*4d7e907cSAndroid Build Coastguard Worker     */
260*4d7e907cSAndroid Build Coastguard Worker    setActiveConfigWithConstraints(Display display, Config config,
261*4d7e907cSAndroid Build Coastguard Worker        VsyncPeriodChangeConstraints vsyncPeriodChangeConstraints)
262*4d7e907cSAndroid Build Coastguard Worker        generates (Error error, VsyncPeriodChangeTimeline timeline);
263*4d7e907cSAndroid Build Coastguard Worker
264*4d7e907cSAndroid Build Coastguard Worker    /**
265*4d7e907cSAndroid Build Coastguard Worker     * Requests the display to enable/disable its low latency mode.
266*4d7e907cSAndroid Build Coastguard Worker     *
267*4d7e907cSAndroid Build Coastguard Worker     * If the display is connected via HDMI 2.1, then Auto Low Latency Mode should be triggered. If
268*4d7e907cSAndroid Build Coastguard Worker     * the display is internally connected and a custom low latency mode is available, that should
269*4d7e907cSAndroid Build Coastguard Worker     * be triggered.
270*4d7e907cSAndroid Build Coastguard Worker     *
271*4d7e907cSAndroid Build Coastguard Worker     * This function should only be called if the display reports support for
272*4d7e907cSAndroid Build Coastguard Worker     * DisplayCapability::AUTO_LOW_LATENCY_MODE from getDisplayCapabilities_2_4.
273*4d7e907cSAndroid Build Coastguard Worker     *
274*4d7e907cSAndroid Build Coastguard Worker     * @return error is NONE upon success. Otherwise,
275*4d7e907cSAndroid Build Coastguard Worker     *     BAD_DISPLAY when an invalid display handle was passed in.
276*4d7e907cSAndroid Build Coastguard Worker     *     UNSUPPORTED when AUTO_LOW_LATENCY_MODE is not supported by the composer
277*4d7e907cSAndroid Build Coastguard Worker     *         implementation or the given display
278*4d7e907cSAndroid Build Coastguard Worker     */
279*4d7e907cSAndroid Build Coastguard Worker    setAutoLowLatencyMode(Display display, bool on)
280*4d7e907cSAndroid Build Coastguard Worker        generates (Error error);
281*4d7e907cSAndroid Build Coastguard Worker
282*4d7e907cSAndroid Build Coastguard Worker    /**
283*4d7e907cSAndroid Build Coastguard Worker     * Provides a list of all the content types supported by this display (any of
284*4d7e907cSAndroid Build Coastguard Worker     * ContentType::{GRAPHICS, PHOTO, CINEMA, GAME}). This list must not change after
285*4d7e907cSAndroid Build Coastguard Worker     * initialization.
286*4d7e907cSAndroid Build Coastguard Worker     *
287*4d7e907cSAndroid Build Coastguard Worker     * Content types are introduced in HDMI 1.4 and supporting them is optional. The
288*4d7e907cSAndroid Build Coastguard Worker     * ContentType::NONE is always supported and will not be returned by this method..
289*4d7e907cSAndroid Build Coastguard Worker     *
290*4d7e907cSAndroid Build Coastguard Worker     * @return error is NONE upon success. Otherwise,
291*4d7e907cSAndroid Build Coastguard Worker     *     BAD_DISPLAY when an invalid display handle was passed in.
292*4d7e907cSAndroid Build Coastguard Worker     * @return supportedContentTypes is a list of supported content types.
293*4d7e907cSAndroid Build Coastguard Worker     */
294*4d7e907cSAndroid Build Coastguard Worker    getSupportedContentTypes(Display display)
295*4d7e907cSAndroid Build Coastguard Worker        generates(Error error, vec<ContentType> supportedContentTypes);
296*4d7e907cSAndroid Build Coastguard Worker
297*4d7e907cSAndroid Build Coastguard Worker    /**
298*4d7e907cSAndroid Build Coastguard Worker     * Instructs the connected display that the content being shown is of the given type - one of
299*4d7e907cSAndroid Build Coastguard Worker     * GRAPHICS, PHOTO, CINEMA, GAME.
300*4d7e907cSAndroid Build Coastguard Worker     *
301*4d7e907cSAndroid Build Coastguard Worker     * Content types are introduced in HDMI 1.4 and supporting them is optional. If they are
302*4d7e907cSAndroid Build Coastguard Worker     * supported, this signal should switch the display to a mode that is optimal for the given
303*4d7e907cSAndroid Build Coastguard Worker     * type of content. See HDMI 1.4 specification for more information.
304*4d7e907cSAndroid Build Coastguard Worker     *
305*4d7e907cSAndroid Build Coastguard Worker     * If the display is internally connected (not through HDMI), and such modes are available,
306*4d7e907cSAndroid Build Coastguard Worker     * this method should trigger them.
307*4d7e907cSAndroid Build Coastguard Worker     *
308*4d7e907cSAndroid Build Coastguard Worker     * This function can be called for a content type even if no support for it is
309*4d7e907cSAndroid Build Coastguard Worker     * reported from getSupportedContentTypes.
310*4d7e907cSAndroid Build Coastguard Worker     *
311*4d7e907cSAndroid Build Coastguard Worker     * @return error is NONE upon success. Otherwise,
312*4d7e907cSAndroid Build Coastguard Worker     *     BAD_DISPLAY when an invalid display handle was passed in.
313*4d7e907cSAndroid Build Coastguard Worker     *     UNSUPPORTED when the given content type is not supported by the composer
314*4d7e907cSAndroid Build Coastguard Worker     *         implementation or the given display
315*4d7e907cSAndroid Build Coastguard Worker     */
316*4d7e907cSAndroid Build Coastguard Worker    setContentType(Display display, ContentType type)
317*4d7e907cSAndroid Build Coastguard Worker        generates (Error error);
318*4d7e907cSAndroid Build Coastguard Worker
319*4d7e907cSAndroid Build Coastguard Worker    struct LayerGenericMetadataKey {
320*4d7e907cSAndroid Build Coastguard Worker        /**
321*4d7e907cSAndroid Build Coastguard Worker         * Key names must comply with the requirements specified for
322*4d7e907cSAndroid Build Coastguard Worker         * getLayerGenericMetadataKeys below
323*4d7e907cSAndroid Build Coastguard Worker         */
324*4d7e907cSAndroid Build Coastguard Worker        string name;
325*4d7e907cSAndroid Build Coastguard Worker
326*4d7e907cSAndroid Build Coastguard Worker        /**
327*4d7e907cSAndroid Build Coastguard Worker         * The mandatory flag is defined in the description of
328*4d7e907cSAndroid Build Coastguard Worker         * setLayerGenericMetadata above
329*4d7e907cSAndroid Build Coastguard Worker         */
330*4d7e907cSAndroid Build Coastguard Worker        bool mandatory;
331*4d7e907cSAndroid Build Coastguard Worker    };
332*4d7e907cSAndroid Build Coastguard Worker
333*4d7e907cSAndroid Build Coastguard Worker    /**
334*4d7e907cSAndroid Build Coastguard Worker     * Retrieves the set of keys that may be passed into setLayerGenericMetadata
335*4d7e907cSAndroid Build Coastguard Worker     *
336*4d7e907cSAndroid Build Coastguard Worker     * Key names must meet the following requirements:
337*4d7e907cSAndroid Build Coastguard Worker     * - Must be specified in reverse domain name notation
338*4d7e907cSAndroid Build Coastguard Worker     * - Must not start with 'com.android' or 'android'
339*4d7e907cSAndroid Build Coastguard Worker     * - Must be unique within the returned vector
340*4d7e907cSAndroid Build Coastguard Worker     * - Must correspond to a matching HIDL struct type, which defines the
341*4d7e907cSAndroid Build Coastguard Worker     *   structure of its values. For example, the key 'com.example.V1-3.Foo'
342*4d7e907cSAndroid Build Coastguard Worker     *   should correspond to a value of type [email protected]::Foo, which is
343*4d7e907cSAndroid Build Coastguard Worker     *   defined in a vendor HAL extension
344*4d7e907cSAndroid Build Coastguard Worker     */
345*4d7e907cSAndroid Build Coastguard Worker    getLayerGenericMetadataKeys()
346*4d7e907cSAndroid Build Coastguard Worker        generates(Error error, vec<LayerGenericMetadataKey> keys);
347*4d7e907cSAndroid Build Coastguard Worker};
348