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 17package android.hardware.graphics.allocator@3.0; 18 19import android.hardware.graphics.mapper@3.0; 20 21interface 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 * Allocations should be optimized for usage bits provided in the 34 * descriptor. 35 * 36 * @param descriptor Properties of the buffers to allocate. This must be 37 * obtained from IMapper::createDescriptor(). 38 * @param count The number of buffers to allocate. 39 * @return error Error status of the call, which may be 40 * - `NONE` upon success. 41 * - `BAD_DESCRIPTOR` if the descriptor is invalid. 42 * - `NO_RESOURCES` if the allocation cannot be fulfilled at this time. 43 * - `UNSUPPORTED` if any of the properties encoded in the descriptor 44 * are not supported. 45 * @return stride The number of pixels between two consecutive rows of 46 * an allocated buffer, when the concept of consecutive rows is defined. 47 * Otherwise, it has no meaning. 48 * @return buffers Array of raw handles to the allocated buffers. 49 */ 50 allocate(BufferDescriptor descriptor, uint32_t count) 51 generates (Error error, 52 uint32_t stride, 53 vec<handle> buffers); 54}; 55 56