Chia-I Wu | e78aa1b | 2016-09-05 11:46:36 +0800 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package android.hardware.graphics.allocator@2.0; |
| 18 | |
Chia-I Wu | a7f234c | 2016-11-22 11:37:04 +0800 | [diff] [blame^] | 19 | import IAllocatorClient; |
Chia-I Wu | 1c45727 | 2016-11-17 10:11:32 +0800 | [diff] [blame] | 20 | |
Chia-I Wu | e78aa1b | 2016-09-05 11:46:36 +0800 | [diff] [blame] | 21 | interface IAllocator { |
| 22 | enum Capability : int32_t { |
| 23 | /* reserved */ |
| 24 | INVALID = 0, |
| 25 | |
| 26 | /* |
Chia-I Wu | a7f234c | 2016-11-22 11:37:04 +0800 | [diff] [blame^] | 27 | * IAllocatorClient::testAllocate must always return UNDEFINED unless |
| 28 | * this capability is supported. |
Chia-I Wu | e78aa1b | 2016-09-05 11:46:36 +0800 | [diff] [blame] | 29 | */ |
| 30 | TEST_ALLOCATE = 1, |
Craig Donner | 0b00adf | 2016-10-20 17:12:58 -0700 | [diff] [blame] | 31 | |
| 32 | /* |
Chia-I Wu | a7f234c | 2016-11-22 11:37:04 +0800 | [diff] [blame^] | 33 | * IAllocatorClient::BufferDescriptorInfo::layerCount must be 1 unless |
| 34 | * this capability is supported. |
Craig Donner | 0b00adf | 2016-10-20 17:12:58 -0700 | [diff] [blame] | 35 | */ |
| 36 | LAYERED_BUFFERS = 2, |
Chia-I Wu | e78aa1b | 2016-09-05 11:46:36 +0800 | [diff] [blame] | 37 | }; |
| 38 | |
Chia-I Wu | e78aa1b | 2016-09-05 11:46:36 +0800 | [diff] [blame] | 39 | /* |
| 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 Wu | bc46dac | 2016-11-22 06:36:43 +0800 | [diff] [blame] | 46 | @entry |
| 47 | @exit |
| 48 | @callflow(next="*") |
Chia-I Wu | e78aa1b | 2016-09-05 11:46:36 +0800 | [diff] [blame] | 49 | 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 Wu | bc46dac | 2016-11-22 06:36:43 +0800 | [diff] [blame] | 57 | @entry |
| 58 | @exit |
| 59 | @callflow(next="*") |
Chia-I Wu | e78aa1b | 2016-09-05 11:46:36 +0800 | [diff] [blame] | 60 | dumpDebugInfo() generates (string debugInfo); |
| 61 | |
| 62 | /* |
Chia-I Wu | a7f234c | 2016-11-22 11:37:04 +0800 | [diff] [blame^] | 63 | * 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 Wu | e78aa1b | 2016-09-05 11:46:36 +0800 | [diff] [blame] | 66 | * |
Chia-I Wu | e78aa1b | 2016-09-05 11:46:36 +0800 | [diff] [blame] | 67 | * @return error is NONE upon success. Otherwise, |
Chia-I Wu | a7f234c | 2016-11-22 11:37:04 +0800 | [diff] [blame^] | 68 | * NO_RESOURCES when no more client can currently be created. |
| 69 | * @return client is the newly created client. |
Chia-I Wu | e78aa1b | 2016-09-05 11:46:36 +0800 | [diff] [blame] | 70 | */ |
Chia-I Wu | bc46dac | 2016-11-22 06:36:43 +0800 | [diff] [blame] | 71 | @entry |
| 72 | @callflow(next="*") |
Chia-I Wu | a7f234c | 2016-11-22 11:37:04 +0800 | [diff] [blame^] | 73 | createClient() generates (Error error, IAllocatorClient client); |
Chia-I Wu | e78aa1b | 2016-09-05 11:46:36 +0800 | [diff] [blame] | 74 | }; |