1 /*
2  * Copyright (C) 2020 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 #pragma once
19 
20 #include "mali_gralloc_formats.h"
21 
22 extern mali_gralloc_format_caps cpu_runtime_caps;
23 extern mali_gralloc_format_caps dpu_runtime_caps;
24 extern mali_gralloc_format_caps vpu_runtime_caps;
25 extern mali_gralloc_format_caps gpu_runtime_caps;
26 extern mali_gralloc_format_caps cam_runtime_caps;
27 extern mali_gralloc_format_caps bo_runtime_caps;
28 extern mali_gralloc_format_caps mfc_runtime_caps;
29 
30 /*
31  * Obtains the capabilities of each media system IP that form the producers
32  * and consumers. Default capabilities are assigned (within this function) for
33  * each IP, based on CFLAGS which specify the version of each IP (or, for GPU,
34  * explicit features):
35  * - GPU: MALI_GPU_SUPPORT_*
36  * - DPU: MALI_DISPLAY_VERSION
37  * - VPU: MALI_VIDEO_VERSION
38  *
39  * See src/Android.mk for default values.
40  *
41  * These defaults can be overridden by runtime capabilities defined in the
42  * userspace drivers (*.so) loaded for each IP. The drivers should define a
43  * symbol named MALI_GRALLOC_FORMATCAPS_SYM_NAME, which contains all
44  * capabilities from set MALI_GRALLOC_FORMAT_CAPABILITY_*
45  *
46  * @return none.
47  *
48  * NOTE: although no capabilities are returned, global variables global variables
49  * named '*_runtime_caps' are updated.
50  */
51 void get_ip_capabilities(void);
52 
53 #ifdef __cplusplus
54 extern "C" {
55 #endif
56 
57 void mali_gralloc_get_caps(struct mali_gralloc_format_caps *gpu_caps,
58                            struct mali_gralloc_format_caps *vpu_caps,
59                            struct mali_gralloc_format_caps *dpu_caps,
60                            struct mali_gralloc_format_caps *cam_caps);
61 #ifdef __cplusplus
62 }
63 #endif
64