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
22cc_defaults {
23	name: "arm_gralloc_version_defaults",
24	target: {
25		android: {
26			shared_libs: [
27				"android.hardware.graphics.common@1.2",
28			],
29		},
30	},
31	cflags: [
32		"-DLOG_TAG=\"gralloc4\"",
33		"-DGRALLOC_VERSION_MAJOR=4",
34		"-DHIDL_ALLOCATOR_VERSION_SCALED=400",
35		"-DHIDL_MAPPER_VERSION_SCALED=400",
36		"-DHIDL_COMMON_VERSION_SCALED=120",
37	],
38}
39
40cc_defaults {
41	name: "arm_gralloc_api_4x_defaults",
42	defaults: [
43		"arm_gralloc_defaults",
44		"arm_gralloc_version_defaults",
45	],
46	compile_multilib: "both",
47	relative_install_path: "hw/",
48	shared_libs: [
49		"libhardware",
50		"liblog",
51		"libcutils",
52		"libdmabufheap",
53		"libion_google",
54		"libsync",
55		"libutils",
56		"libnativewindow",
57		"libhidlbase",
58		"libgralloctypes",
59	],
60	static_libs: [
61		"libarect",
62		"libgralloc_core",
63		"libgralloc_allocator",
64		"libgralloc_capabilities",
65		"libdrm",
66	],
67	header_libs: [
68		"libnativebase_headers",
69	],
70	export_shared_lib_headers: [
71		"libhidlbase",
72	],
73}
74
75cc_library_shared {
76	name: "android.hardware.graphics.allocator@4.0-impl",
77	defaults: [
78		"arm_gralloc_api_4x_defaults",
79	],
80	shared_libs: [
81		"android.hardware.graphics.allocator@4.0",
82		"android.hardware.graphics.mapper@4.0",
83	],
84	srcs: [
85		"GrallocAllocator.cpp",
86		":libgralloc_hidl_common_allocator",
87		":libgralloc_hidl_common_shared_metadata",
88	],
89	include_dirs: [
90		"hardware/google/gchips/include",
91	],
92}
93
94cc_library_shared {
95	name: "android.hardware.graphics.mapper@4.0-impl",
96	defaults: [
97		"arm_gralloc_api_4x_defaults",
98	],
99	static_libs: [
100		"libgralloc_drmutils",
101	],
102	shared_libs: [
103		"arm.graphics-V1-ndk_platform",
104		"android.hardware.graphics.mapper@4.0",
105	],
106	srcs: [
107		"GrallocMapper.cpp",
108		":libgralloc_hidl_common_mapper",
109		":libgralloc_hidl_common_mapper_metadata",
110		":libgralloc_hidl_common_shared_metadata",
111	],
112	include_dirs: [
113		"hardware/google/gchips/include",
114	],
115}
116