1/*
2 * Copyright (C) 2020 Arm Limited.
3 * SPDX-License-Identifier: Apache-2.0
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 *      http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18package {
19    default_applicable_licenses: ["Android-Apache-2.0"],
20}
21
22soong_config_module_type {
23	name: "arm_gralloc_capabilities_cc_defaults",
24	module_type: "cc_defaults",
25	config_namespace: "arm_gralloc",
26	variables: [
27		"mali_gpu_support_afbc_basic",
28		"mali_gpu_support_afbc_splitblk",
29		"mali_gpu_support_afbc_wideblk",
30		"mali_gpu_support_afbc_tiled_headers",
31		"mali_gpu_support_afbc_yuv_write",
32		"gralloc_arm_no_external_afbc",
33		"dpu_support_1010102_afbc",
34		"mali_gralloc_api_tests",
35	],
36	properties: [
37		"cflags",
38	],
39}
40
41soong_config_bool_variable {
42	name: "mali_gpu_support_afbc_basic",
43}
44soong_config_bool_variable {
45	name: "mali_gpu_support_afbc_splitblk",
46}
47soong_config_bool_variable {
48	name: "mali_gpu_support_afbc_wideblk",
49}
50soong_config_bool_variable {
51	name: "mali_gpu_support_afbc_tiled_headers",
52}
53soong_config_bool_variable {
54	name: "mali_gpu_support_afbc_yuv_write",
55}
56soong_config_bool_variable {
57	name: "gralloc_arm_no_external_afbc",
58}
59soong_config_bool_variable {
60	name: "dpu_support_1010102_afbc",
61}
62soong_config_bool_variable {
63	name: "mali_gralloc_api_tests",
64}
65
66arm_gralloc_capabilities_cc_defaults {
67	name: "arm_gralloc_capabilities_defaults",
68	defaults: [
69		"arm_gralloc_defaults",
70		"android.hardware.graphics.common-ndk_shared",
71	],
72	soong_config_variables: {
73		mali_gpu_support_afbc_basic: {
74			cflags: [
75				"-DMALI_GPU_SUPPORT_AFBC_BASIC=1",
76			],
77		},
78		mali_gpu_support_afbc_splitblk: {
79			cflags: [
80				"-DMALI_GPU_SUPPORT_AFBC_SPLITBLK=1",
81			],
82		},
83		mali_gpu_support_afbc_wideblk: {
84			cflags: [
85				"-DMALI_GPU_SUPPORT_AFBC_WIDEBLK=1",
86			],
87		},
88		mali_gpu_support_afbc_tiled_headers: {
89			cflags: [
90				"-DMALI_GPU_SUPPORT_AFBC_TILED_HEADERS=1",
91			],
92		},
93		mali_gpu_support_afbc_yuv_write: {
94			cflags: [
95				"-DMALI_GPU_SUPPORT_AFBC_YUV_WRITE=1",
96			],
97		},
98		gralloc_arm_no_external_afbc: {
99			cflags: [
100				"-DGRALLOC_ARM_NO_EXTERNAL_AFBC=1",
101			],
102		},
103		dpu_support_1010102_afbc: {
104			cflags: [
105				"-DGRALLOC_DPU_SUPPORT_1010102_AFBC=1",
106			],
107		},
108		mali_gralloc_api_tests: {
109			cflags: [
110				"-DMALI_GRALLOC_VENDOR_VPU=1",
111			],
112		},
113	},
114	srcs: [
115		"src/gralloc_capabilities.cpp",
116	],
117	shared_libs: [
118		"libhardware",
119		"liblog",
120		"libcutils",
121		"libsync",
122		"libutils",
123	],
124}
125
126cc_library_static {
127	name: "libgralloc_capabilities",
128	defaults: [
129		"arm_gralloc_capabilities_defaults",
130		"arm_gralloc_version_defaults",
131	],
132}
133