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_allocator_cc_defaults",
24	module_type: "cc_defaults",
25	config_namespace: "arm_gralloc",
26	variables: [
27		"gralloc_use_ion_dma_heap",
28		"gralloc_use_ion_compound_page_heap",
29		"gralloc_init_afbc",
30		"gralloc_use_ion_dmabuf_sync",
31	],
32	properties: [
33		"cflags",
34	],
35}
36
37soong_config_bool_variable {
38	name: "gralloc_use_ion_dma_heap",
39}
40soong_config_bool_variable {
41	name: "gralloc_use_ion_compound_page_heap",
42}
43soong_config_bool_variable {
44	name: "gralloc_init_afbc",
45}
46soong_config_bool_variable {
47	name: "gralloc_use_ion_dmabuf_sync",
48}
49
50arm_gralloc_allocator_cc_defaults {
51	name: "arm_gralloc_allocator_defaults",
52	defaults: [
53		"arm_gralloc_defaults",
54		"android.hardware.graphics.common-ndk_shared",
55	],
56	soong_config_variables: {
57		gralloc_use_ion_dma_heap: {
58			cflags: [
59				"-DGRALLOC_USE_ION_DMA_HEAP=1",
60			],
61		},
62		gralloc_use_ion_compound_page_heap: {
63			cflags: [
64				"-DGRALLOC_USE_ION_COMPOUND_PAGE_HEAP=1",
65			],
66		},
67		gralloc_init_afbc: {
68			cflags: [
69				"-DGRALLOC_INIT_AFBC=1",
70			],
71		},
72		gralloc_use_ion_dmabuf_sync: {
73			cflags: [
74				"-DGRALLOC_USE_ION_DMABUF_SYNC=1",
75			],
76		},
77	},
78	srcs: [
79		"mali_gralloc_ion.cpp",
80	],
81	static_libs: [
82		"libarect",
83	],
84	shared_libs: [
85		"libhardware",
86		"liblog",
87		"libcutils",
88		"libdmabufheap",
89		"libsync",
90		"libutils",
91		"libnativewindow",
92		"android.hardware.graphics.common@1.2",
93	],
94	header_libs: [
95		"libnativebase_headers",
96	],
97}
98
99cc_library_static {
100	name: "libgralloc_allocator",
101	defaults: [
102		"arm_gralloc_allocator_defaults",
103		"arm_gralloc_version_defaults",
104	],
105}
106