xref: /aosp_15_r20/hardware/interfaces/graphics/composer/2.1/IComposer.hal (revision 4d7e907c777eeecc4c5bd7cf640a754fac206ff7)
1*4d7e907cSAndroid Build Coastguard Worker/*
2*4d7e907cSAndroid Build Coastguard Worker * Copyright (C) 2016 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 IComposerClient;
20*4d7e907cSAndroid Build Coastguard Worker
21*4d7e907cSAndroid Build Coastguard Workerinterface IComposer {
22*4d7e907cSAndroid Build Coastguard Worker    /**
23*4d7e907cSAndroid Build Coastguard Worker     * Optional capabilities which may be supported by some devices. The
24*4d7e907cSAndroid Build Coastguard Worker     * particular set of supported capabilities for a given device may be
25*4d7e907cSAndroid Build Coastguard Worker     * retrieved using getCapabilities.
26*4d7e907cSAndroid Build Coastguard Worker     */
27*4d7e907cSAndroid Build Coastguard Worker    enum Capability : int32_t {
28*4d7e907cSAndroid Build Coastguard Worker        INVALID = 0,
29*4d7e907cSAndroid Build Coastguard Worker
30*4d7e907cSAndroid Build Coastguard Worker        /**
31*4d7e907cSAndroid Build Coastguard Worker         * Specifies that the device supports sideband stream layers, for
32*4d7e907cSAndroid Build Coastguard Worker         * which buffer content updates and other synchronization will not be
33*4d7e907cSAndroid Build Coastguard Worker         * provided through the usual validate/present cycle and must be
34*4d7e907cSAndroid Build Coastguard Worker         * handled by an external implementation-defined mechanism. Only
35*4d7e907cSAndroid Build Coastguard Worker         * changes to layer state (such as position, size, etc.) need to be
36*4d7e907cSAndroid Build Coastguard Worker         * performed through the validate/present cycle.
37*4d7e907cSAndroid Build Coastguard Worker         */
38*4d7e907cSAndroid Build Coastguard Worker        SIDEBAND_STREAM = 1,
39*4d7e907cSAndroid Build Coastguard Worker
40*4d7e907cSAndroid Build Coastguard Worker        /**
41*4d7e907cSAndroid Build Coastguard Worker         * Specifies that the device will apply a color transform even when
42*4d7e907cSAndroid Build Coastguard Worker         * either the client or the device has chosen that all layers should
43*4d7e907cSAndroid Build Coastguard Worker         * be composed by the client. This will prevent the client from
44*4d7e907cSAndroid Build Coastguard Worker         * applying the color transform during its composition step.
45*4d7e907cSAndroid Build Coastguard Worker         */
46*4d7e907cSAndroid Build Coastguard Worker        SKIP_CLIENT_COLOR_TRANSFORM = 2,
47*4d7e907cSAndroid Build Coastguard Worker
48*4d7e907cSAndroid Build Coastguard Worker        /**
49*4d7e907cSAndroid Build Coastguard Worker         * Specifies that the present fence must not be used as an accurate
50*4d7e907cSAndroid Build Coastguard Worker         * representation of the actual present time of a frame.
51*4d7e907cSAndroid Build Coastguard Worker         */
52*4d7e907cSAndroid Build Coastguard Worker        PRESENT_FENCE_IS_NOT_RELIABLE = 3,
53*4d7e907cSAndroid Build Coastguard Worker    };
54*4d7e907cSAndroid Build Coastguard Worker
55*4d7e907cSAndroid Build Coastguard Worker    /**
56*4d7e907cSAndroid Build Coastguard Worker     * Provides a list of supported capabilities (as described in the
57*4d7e907cSAndroid Build Coastguard Worker     * definition of Capability above). This list must not change after
58*4d7e907cSAndroid Build Coastguard Worker     * initialization.
59*4d7e907cSAndroid Build Coastguard Worker     *
60*4d7e907cSAndroid Build Coastguard Worker     * @return capabilities is a list of supported capabilities.
61*4d7e907cSAndroid Build Coastguard Worker     */
62*4d7e907cSAndroid Build Coastguard Worker    @entry
63*4d7e907cSAndroid Build Coastguard Worker    @exit
64*4d7e907cSAndroid Build Coastguard Worker    @callflow(next="*")
65*4d7e907cSAndroid Build Coastguard Worker    getCapabilities() generates (vec<Capability> capabilities);
66*4d7e907cSAndroid Build Coastguard Worker
67*4d7e907cSAndroid Build Coastguard Worker    /**
68*4d7e907cSAndroid Build Coastguard Worker     * Retrieves implementation-defined debug information, which will be
69*4d7e907cSAndroid Build Coastguard Worker     * displayed during, for example, `dumpsys SurfaceFlinger`.
70*4d7e907cSAndroid Build Coastguard Worker     *
71*4d7e907cSAndroid Build Coastguard Worker     * @return debugInfo is a string of debug information.
72*4d7e907cSAndroid Build Coastguard Worker     */
73*4d7e907cSAndroid Build Coastguard Worker    @entry
74*4d7e907cSAndroid Build Coastguard Worker    @exit
75*4d7e907cSAndroid Build Coastguard Worker    @callflow(next="*")
76*4d7e907cSAndroid Build Coastguard Worker    dumpDebugInfo() generates (string debugInfo);
77*4d7e907cSAndroid Build Coastguard Worker
78*4d7e907cSAndroid Build Coastguard Worker    /**
79*4d7e907cSAndroid Build Coastguard Worker     * Creates a client of the composer. All resources created by the client
80*4d7e907cSAndroid Build Coastguard Worker     * are owned by the client and are only visible to the client.
81*4d7e907cSAndroid Build Coastguard Worker     *
82*4d7e907cSAndroid Build Coastguard Worker     * There can only be one client at any time.
83*4d7e907cSAndroid Build Coastguard Worker     *
84*4d7e907cSAndroid Build Coastguard Worker     * @return error is NONE upon success. Otherwise,
85*4d7e907cSAndroid Build Coastguard Worker     *         NO_RESOURCES when no more client can be created currently.
86*4d7e907cSAndroid Build Coastguard Worker     * @return client is the newly created client.
87*4d7e907cSAndroid Build Coastguard Worker     */
88*4d7e907cSAndroid Build Coastguard Worker    @entry
89*4d7e907cSAndroid Build Coastguard Worker    @callflow(next="*")
90*4d7e907cSAndroid Build Coastguard Worker    createClient() generates (Error error, IComposerClient client);
91*4d7e907cSAndroid Build Coastguard Worker};
92