Marissa Wall | bd1ca51 | 2018-12-30 10:59:41 -0800 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2019 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@3.0; |
| 18 | |
| 19 | import android.hardware.graphics.mapper@3.0; |
| 20 | |
| 21 | interface IAllocator { |
| 22 | /** |
| 23 | * Retrieves implementation-defined debug information, which will be |
| 24 | * displayed during, for example, `dumpsys SurfaceFlinger`. |
| 25 | * |
| 26 | * @return debugInfo is a string of debug information. |
| 27 | */ |
| 28 | dumpDebugInfo() generates (string debugInfo); |
| 29 | |
| 30 | /** |
| 31 | * Allocates buffers with the properties specified by the descriptor. |
| 32 | * |
| 33 | * @param descriptor Properties of the buffers to allocate. This must be |
| 34 | * obtained from IMapper::createDescriptor(). |
| 35 | * @param count The number of buffers to allocate. |
| 36 | * @return error Error status of the call, which may be |
| 37 | * - `NONE` upon success. |
| 38 | * - `BAD_DESCRIPTOR` if the descriptor is invalid. |
| 39 | * - `NO_RESOURCES` if the allocation cannot be fulfilled at this time. |
| 40 | * - `UNSUPPORTED` if any of the properties encoded in the descriptor |
| 41 | * are not supported. |
| 42 | * @return stride The number of pixels between two consecutive rows of |
| 43 | * an allocated buffer, when the concept of consecutive rows is defined. |
| 44 | * Otherwise, it has no meaning. |
| 45 | * @return buffers Array of raw handles to the allocated buffers. |
| 46 | */ |
| 47 | allocate(BufferDescriptor descriptor, uint32_t count) |
| 48 | generates (Error error, |
| 49 | uint32_t stride, |
| 50 | vec<handle> buffers); |
| 51 | }; |
| 52 | |