Home | History | Annotate | Download | only in default
      1 /*
      2  * Copyright 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 #ifndef ANDROID_HARDWARE_GRALLOC1_ADAPTER_H
     17 #define ANDROID_HARDWARE_GRALLOC1_ADAPTER_H
     18 
     19 #include <hardware/hardware.h>
     20 
     21 __BEGIN_DECLS
     22 
     23 #define GRALLOC1_ADAPTER_MODULE_API_VERSION_1_0 \
     24     HARDWARE_MODULE_API_VERSION(1, 0)
     25 
     26 enum {
     27     GRALLOC1_ADAPTER_PERFORM_FIRST = 10000,
     28 
     29     // void getRealModuleApiVersionMinor(..., int* outMinorVersion);
     30     GRALLOC1_ADAPTER_PERFORM_GET_REAL_MODULE_API_VERSION_MINOR =
     31         GRALLOC1_ADAPTER_PERFORM_FIRST,
     32 
     33     // void setUsages(..., buffer_handle_t buffer,
     34     //                     int producerUsage,
     35     //                     int consumerUsage);
     36     GRALLOC1_ADAPTER_PERFORM_SET_USAGES =
     37         GRALLOC1_ADAPTER_PERFORM_FIRST + 1,
     38 
     39     // void getDimensions(..., buffer_handle_t buffer,
     40     //                         int* outWidth,
     41     //                         int* outHeight);
     42     GRALLOC1_ADAPTER_PERFORM_GET_DIMENSIONS =
     43         GRALLOC1_ADAPTER_PERFORM_FIRST + 2,
     44 
     45     // void getFormat(..., buffer_handle_t buffer, int* outFormat);
     46     GRALLOC1_ADAPTER_PERFORM_GET_FORMAT =
     47         GRALLOC1_ADAPTER_PERFORM_FIRST + 3,
     48 
     49     // void getProducerUsage(..., buffer_handle_t buffer, int* outUsage);
     50     GRALLOC1_ADAPTER_PERFORM_GET_PRODUCER_USAGE =
     51         GRALLOC1_ADAPTER_PERFORM_FIRST + 4,
     52 
     53     // void getConsumerUsage(..., buffer_handle_t buffer, int* outUsage);
     54     GRALLOC1_ADAPTER_PERFORM_GET_CONSUMER_USAGE =
     55         GRALLOC1_ADAPTER_PERFORM_FIRST + 5,
     56 
     57     // void getBackingStore(..., buffer_handle_t buffer,
     58     //                           uint64_t* outBackingStore);
     59     GRALLOC1_ADAPTER_PERFORM_GET_BACKING_STORE =
     60         GRALLOC1_ADAPTER_PERFORM_FIRST + 6,
     61 
     62     // void getNumFlexPlanes(..., buffer_handle_t buffer,
     63     //                            int* outNumFlexPlanes);
     64     GRALLOC1_ADAPTER_PERFORM_GET_NUM_FLEX_PLANES =
     65         GRALLOC1_ADAPTER_PERFORM_FIRST + 7,
     66 
     67     // void getStride(..., buffer_handle_t buffer, int* outStride);
     68     GRALLOC1_ADAPTER_PERFORM_GET_STRIDE =
     69         GRALLOC1_ADAPTER_PERFORM_FIRST + 8,
     70 
     71     // void lockFlex(..., buffer_handle_t buffer,
     72     //                    int producerUsage,
     73     //                    int consumerUsage,
     74     //                    int left,
     75     //                    int top,
     76     //                    int width,
     77     //                    int height,
     78     //                    android_flex_layout* outLayout,
     79     //                    int acquireFence);
     80     GRALLOC1_ADAPTER_PERFORM_LOCK_FLEX =
     81         GRALLOC1_ADAPTER_PERFORM_FIRST + 9,
     82 };
     83 
     84 int gralloc1_adapter_device_open(const struct hw_module_t* module,
     85         const char* id, struct hw_device_t** device);
     86 
     87 __END_DECLS
     88 
     89 #endif /* ANDROID_HARDWARE_GRALLOC1_ADAPTER_H */
     90