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_import {
23    from: "hardware/google/gchips/gralloc4/Android.bp",
24    module_types: ["gralloc_defaults"],
25}
26
27// Only to be used in pixel_gralloc_mapper because of 'stem'
28gralloc_defaults {
29    name: "gralloc_mapper_defaults",
30    soong_config_variables: {
31        mapper_version: {
32            mapper4: {
33                stem: "[email protected]",
34                defaults: ["gralloc_mapper4_defaults"],
35            },
36            mapper5: {
37                stem: "mapper.pixel",
38                defaults: ["gralloc_mapper5_defaults"],
39            },
40        },
41    },
42}
43
44cc_library_shared {
45    name: "pixel_gralloc_mapper",
46    defaults: [
47        "gralloc_mapper_defaults",
48        "pixel-gralloc-headers-dependencies",
49    ],
50}
51
52gralloc_defaults {
53    name: "arm_gralloc_version_defaults",
54    soong_config_variables: {
55        mapper_version: {
56            mapper4: {
57                cflags: [
58                    "-DLOG_TAG=\"gralloc4\"",
59                    "-DGRALLOC_VERSION_MAJOR=4",
60                    "-DHIDL_ALLOCATOR_VERSION_SCALED=400",
61                    "-DHIDL_MAPPER_VERSION_SCALED=400",
62                    "-DHIDL_COMMON_VERSION_SCALED=120",
63                    "-DGRALLOC_MAPPER_4",
64                ],
65            },
66            mapper5: {
67                cflags: [
68                    "-DGRALLOC_VERSION_MAJOR=5",
69                    "-DHIDL_MAPPER_VERSION_SCALED=500",
70                    "-DLOG_TAG=\"gralloc5\"",
71                    "-DGRALLOC_MAPPER_5",
72                ],
73            },
74        },
75    },
76}
77
78gralloc_defaults {
79    name: "arm_gralloc_api_defaults",
80    shared_libs: [
81        "liblog",
82        "libcutils",
83        "libdmabufheap",
84        "libsync",
85        "libutils",
86        "libnativewindow",
87        "libgralloctypes",
88        "libhardware",
89        "[email protected]",
90    ],
91    static_libs: [
92        "libarect",
93        "libgralloc_core",
94        "libgralloc_allocator",
95        "libgralloc_capabilities",
96        "libdrm",
97    ],
98    header_libs: [
99        "libnativebase_headers",
100    ],
101    soong_config_variables: {
102        mapper_version: {
103            mapper4: {
104                shared_libs: [
105                    "libhidlbase",
106                ],
107            },
108            mapper5: {
109                header_libs: [
110                    "libbase_headers",
111                    "libimapper_stablec",
112                    "libimapper_providerutils",
113                    "pixel-gralloc-headers",
114                ],
115            },
116        },
117    },
118}
119
120cc_library_headers {
121    name: "libgralloc_headers",
122    vendor: true,
123    export_include_dirs: [
124        ".",
125    ],
126    header_libs: [
127        "libsystem_headers",
128        "//hardware/google/graphics/common:pixel-gralloc-headers",
129    ],
130    export_header_lib_headers: [
131        "libsystem_headers",
132    ],
133}
134