blob: 00d07d534611413e9f9c4b10f07a7f4129bc473d [file] [log] [blame]
Chia-I Wue78aa1b2016-09-05 11:46:36 +08001/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.hardware.graphics.allocator@2.0;
18
Chia-I Wua7f234c2016-11-22 11:37:04 +080019import IAllocatorClient;
Chia-I Wu1c457272016-11-17 10:11:32 +080020
Chia-I Wue78aa1b2016-09-05 11:46:36 +080021interface IAllocator {
22 enum Capability : int32_t {
23 /* reserved */
24 INVALID = 0,
25
26 /*
Chia-I Wua7f234c2016-11-22 11:37:04 +080027 * IAllocatorClient::testAllocate must always return UNDEFINED unless
28 * this capability is supported.
Chia-I Wue78aa1b2016-09-05 11:46:36 +080029 */
30 TEST_ALLOCATE = 1,
Craig Donner0b00adf2016-10-20 17:12:58 -070031
32 /*
Chia-I Wua7f234c2016-11-22 11:37:04 +080033 * IAllocatorClient::BufferDescriptorInfo::layerCount must be 1 unless
34 * this capability is supported.
Craig Donner0b00adf2016-10-20 17:12:58 -070035 */
36 LAYERED_BUFFERS = 2,
Chia-I Wue78aa1b2016-09-05 11:46:36 +080037 };
38
Chia-I Wue78aa1b2016-09-05 11:46:36 +080039 /*
40 * Provides a list of supported capabilities (as described in the
41 * definition of Capability above). This list must not change after
42 * initialization.
43 *
44 * @return capabilities is a list of supported capabilities.
45 */
Chia-I Wubc46dac2016-11-22 06:36:43 +080046 @entry
47 @exit
48 @callflow(next="*")
Chia-I Wue78aa1b2016-09-05 11:46:36 +080049 getCapabilities() generates (vec<Capability> capabilities);
50
51 /*
52 * Retrieves implementation-defined debug information, which will be
53 * displayed during, for example, `dumpsys SurfaceFlinger`.
54 *
55 * @return debugInfo is a string of debug information.
56 */
Chia-I Wubc46dac2016-11-22 06:36:43 +080057 @entry
58 @exit
59 @callflow(next="*")
Chia-I Wue78aa1b2016-09-05 11:46:36 +080060 dumpDebugInfo() generates (string debugInfo);
61
62 /*
Chia-I Wua7f234c2016-11-22 11:37:04 +080063 * Creates a client of the allocator. All resources created by the client
64 * are owned by the client and are only visible to the client, unless they
65 * are exported by exportHandle.
Chia-I Wue78aa1b2016-09-05 11:46:36 +080066 *
Chia-I Wue78aa1b2016-09-05 11:46:36 +080067 * @return error is NONE upon success. Otherwise,
Chia-I Wua7f234c2016-11-22 11:37:04 +080068 * NO_RESOURCES when no more client can currently be created.
69 * @return client is the newly created client.
Chia-I Wue78aa1b2016-09-05 11:46:36 +080070 */
Chia-I Wubc46dac2016-11-22 06:36:43 +080071 @entry
72 @callflow(next="*")
Chia-I Wua7f234c2016-11-22 11:37:04 +080073 createClient() generates (Error error, IAllocatorClient client);
Chia-I Wue78aa1b2016-09-05 11:46:36 +080074};