blob: b912ef65b083f759a5e536333aef8685c1596e9f [file] [log] [blame]
Chia-I Wu109571a2016-09-05 11:46:36 +08001/*
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
Chia-I Wu939e4012016-12-12 21:51:33 +080019#include <hardware/hardware.h>
Chia-I Wu109571a2016-09-05 11:46:36 +080020
21__BEGIN_DECLS
22
Chia-I Wu939e4012016-12-12 21:51:33 +080023#define GRALLOC1_ADAPTER_MODULE_API_VERSION_1_0 \
24 HARDWARE_MODULE_API_VERSION(1, 0)
Chia-I Wu109571a2016-09-05 11:46:36 +080025
Chia-I Wu939e4012016-12-12 21:51:33 +080026enum {
27 GRALLOC1_ADAPTER_PERFORM_FIRST = 10000,
Chia-I Wu109571a2016-09-05 11:46:36 +080028
Chia-I Wu939e4012016-12-12 21:51:33 +080029 // void getRealModuleApiVersionMinor(..., int* outMinorVersion);
30 GRALLOC1_ADAPTER_PERFORM_GET_REAL_MODULE_API_VERSION_MINOR =
31 GRALLOC1_ADAPTER_PERFORM_FIRST,
Chia-I Wu109571a2016-09-05 11:46:36 +080032
Chia-I Wu939e4012016-12-12 21:51:33 +080033 // void setUsages(..., buffer_handle_t buffer,
34 // int producerUsage,
35 // int consumerUsage);
36 GRALLOC1_ADAPTER_PERFORM_SET_USAGES =
37 GRALLOC1_ADAPTER_PERFORM_FIRST + 1,
Chia-I Wu109571a2016-09-05 11:46:36 +080038
Chia-I Wu939e4012016-12-12 21:51:33 +080039 // void getDimensions(..., buffer_handle_t buffer,
40 // int* outWidth,
41 // int* outHeight);
42 GRALLOC1_ADAPTER_PERFORM_GET_DIMENSIONS =
43 GRALLOC1_ADAPTER_PERFORM_FIRST + 2,
Chia-I Wu109571a2016-09-05 11:46:36 +080044
Chia-I Wu939e4012016-12-12 21:51:33 +080045 // void getFormat(..., buffer_handle_t buffer, int* outFormat);
46 GRALLOC1_ADAPTER_PERFORM_GET_FORMAT =
47 GRALLOC1_ADAPTER_PERFORM_FIRST + 3,
Chia-I Wu109571a2016-09-05 11:46:36 +080048
Chia-I Wu939e4012016-12-12 21:51:33 +080049 // void getProducerUsage(..., buffer_handle_t buffer, int* outUsage);
50 GRALLOC1_ADAPTER_PERFORM_GET_PRODUCER_USAGE =
51 GRALLOC1_ADAPTER_PERFORM_FIRST + 4,
Chia-I Wu109571a2016-09-05 11:46:36 +080052
Chia-I Wu939e4012016-12-12 21:51:33 +080053 // 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,
Chia-I Wu109571a2016-09-05 11:46:36 +080082};
83
84int 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 */