1 /*
2  * Copyright (C) 2017 ARM Limited. All rights reserved.
3  *
4  * Copyright (C) 2008 The Android Open Source Project
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * You may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *      http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 
19 #ifndef MALI_GRALLOC_PRIVATE_INTERFACE_H_
20 #define MALI_GRALLOC_PRIVATE_INTERFACE_H_
21 
22 #include "mali_gralloc_private_interface_types.h"
23 
24 typedef enum
25 {
26 
27 	MALI_GRALLOC1_LAST_PUBLIC_FUNCTION = GRALLOC1_LAST_FUNCTION,
28 
29 	MALI_GRALLOC1_FUNCTION_GET_BUFF_INT_FMT = MALI_GRALLOC1_LAST_PUBLIC_FUNCTION + 100,
30 	MALI_GRALLOC1_FUNCTION_GET_BUFF_FD,
31 	MALI_GRALLOC1_FUNCTION_GET_BUFF_INTERNAL_DIMS,
32 	MALI_GRALLOC1_FUNCTION_GET_BUFF_OFFSET,
33 	MALI_GRALLOC1_FUNCTION_GET_BUFF_BYTESTRIDE,
34 	MALI_GRALLOC1_FUNCTION_GET_BUFF_YUVINFO,
35 	MALI_GRALLOC1_FUNCTION_GET_BUFF_SIZE,
36 	MALI_GRALLOC1_FUNCTION_GET_BUFF_FLAGS,
37 	MALI_GRALLOC1_FUNCTION_GET_BUFF_MIN_PAGESIZE,
38 	MALI_GRALLOC1_FUNCTION_SET_PRIV_FMT,
39 
40 	/* API related to the shared attribute region */
41 	MALI_GRALLOC1_FUNCTION_GET_ATTR_PARAM,
42 	MALI_GRALLOC1_FUNCTION_SET_ATTR_PARAM,
43 
44 	MALI_GRALLOC1_LAST_PRIVATE_FUNCTION
45 } mali_gralloc1_function_descriptor_t;
46 
47 typedef int32_t (*GRALLOC1_PFN_PRIVATE_GET_BUFF_INT_FMT)(gralloc1_device_t *device, buffer_handle_t handle,
48                                                          uint64_t *internal_format);
49 typedef int32_t (*GRALLOC1_PFN_PRIVATE_GET_BUFF_FD)(gralloc1_device_t *device, buffer_handle_t handle, int *fd);
50 typedef int32_t (*GRALLOC1_PFN_PRIVATE_GET_BUFF_INTERNAL_DIMS)(gralloc1_device_t *device, buffer_handle_t handle,
51                                                                int *internalWidth, int *internalHeight);
52 typedef int32_t (*GRALLOC1_PFN_PRIVATE_GET_BUFF_OFFSET)(gralloc1_device_t *device, buffer_handle_t handle,
53                                                         int64_t *offset);
54 typedef int32_t (*GRALLOC1_PFN_PRIVATE_GET_BUFF_BYTESTRIDE)(gralloc1_device_t *device, buffer_handle_t handle,
55                                                             int *bytestride);
56 typedef int32_t (*GRALLOC1_PFN_PRIVATE_GET_BUFF_YUVINFO)(gralloc1_device_t *device, buffer_handle_t handle,
57                                                          mali_gralloc_yuv_info *yuvinfo);
58 typedef int32_t (*GRALLOC1_PFN_PRIVATE_GET_BUFF_SIZE)(gralloc1_device_t *device, buffer_handle_t handle, int *size);
59 typedef int32_t (*GRALLOC1_PFN_PRIVATE_GET_BUFF_FLAGS)(gralloc1_device_t *device, buffer_handle_t handle, int *flags);
60 typedef int32_t (*GRALLOC1_PFN_PRIVATE_GET_BUFF_MIN_PAGESIZE)(gralloc1_device_t *device, buffer_handle_t handle,
61                                                               int *min_pgsz);
62 typedef int32_t (*GRALLOC1_PFN_PRIVATE_GET_ATTR_PARAM)(gralloc1_device_t *device, buffer_handle_t handle, buf_attr attr,
63                                                        int32_t *val, int32_t last_call);
64 typedef int32_t (*GRALLOC1_PFN_PRIVATE_SET_ATTR_PARAM)(gralloc1_device_t *device, buffer_handle_t handle, buf_attr attr,
65                                                        int32_t *val, int32_t last_call);
66 typedef int32_t (*GRALLOC1_PFN_PRIVATE_SET_PRIV_FMT)(gralloc1_device_t *device, gralloc1_buffer_descriptor_t desc,
67                                                      uint64_t internal_format);
68 
69 #if defined(GRALLOC_LIBRARY_BUILD)
70 gralloc1_function_pointer_t mali_gralloc_private_interface_getFunction(int32_t descriptor);
71 #endif
72 
73 #endif /* MALI_GRALLOC_PRIVATE_INTERFACE_H_ */
74