1// Use of this source code is governed by a BSD-style license that can be 2// found in the LICENSE file. 3 4package { 5 default_applicable_licenses: ["external_minigbm_license"], 6} 7 8// Added automatically by a large-scale-change that took the approach of 9// 'apply every license found to every target'. While this makes sure we respect 10// every license restriction, it may not be entirely correct. 11// 12// e.g. GPL in an MIT project might only apply to the contrib/ directory. 13// 14// Please consider splitting the single license below into multiple licenses, 15// taking care not to lose any license_kind information, and overriding the 16// default license using the 'licenses: [...]' property on targets as needed. 17// 18// For unused files, consider creating a 'fileGroup' with "//visibility:private" 19// to attach the license to, and including a comment whether the files may be 20// used in the current project. 21// See: http://go/android-license-faq 22license { 23 name: "external_minigbm_license", 24 visibility: [":__subpackages__"], 25 license_kinds: [ 26 "SPDX-license-identifier-Apache-2.0", 27 "SPDX-license-identifier-BSD", 28 "SPDX-license-identifier-MIT", 29 ], 30 license_text: [ 31 "LICENSE", 32 ], 33} 34 35filegroup { 36 name: "minigbm_core_files", 37 38 srcs: [ 39 "amdgpu.c", 40 "drv.c", 41 "drv_array_helpers.c", 42 "drv_helpers.c", 43 "dumb_driver.c", 44 "i915.c", 45 "mediatek.c", 46 "msm.c", 47 "rockchip.c", 48 "vc4.c", 49 "virtgpu.c", 50 "virtgpu_cross_domain.c", 51 "virtgpu_virgl.c", 52 ], 53} 54 55filegroup { 56 name: "minigbm_gralloc_common_files", 57 58 srcs: [ 59 "cros_gralloc/cros_gralloc_buffer.cc", 60 "cros_gralloc/cros_gralloc_helpers.cc", 61 "cros_gralloc/cros_gralloc_driver.cc", 62 ], 63} 64 65filegroup { 66 name: "minigbm_gralloc0_files", 67 srcs: ["cros_gralloc/gralloc0/gralloc0.cc"], 68} 69 70cc_defaults { 71 name: "minigbm_defaults", 72 73 cflags: [ 74 "-D_GNU_SOURCE=1", 75 "-D_FILE_OFFSET_BITS=64", 76 "-Wall", 77 "-Wsign-compare", 78 "-Wpointer-arith", 79 "-Wcast-qual", 80 "-Wcast-align", 81 "-Wno-unused-parameter", 82 ], 83 84 product_variables: { 85 platform_sdk_version: { 86 cflags: ["-DANDROID_API_LEVEL=%d"], 87 }, 88 }, 89} 90 91cc_library_headers { 92 name: "minigbm_headers", 93 host_supported: true, 94 vendor_available: true, 95 export_include_dirs: ["."], 96} 97 98cc_defaults { 99 name: "minigbm_cros_gralloc_defaults", 100 101 defaults: ["minigbm_defaults"], 102 103 header_libs: [ 104 "libhardware_headers", 105 "libnativebase_headers", 106 "libsystem_headers", 107 "minigbm_headers", 108 ], 109 110 static_libs: ["libarect"], 111 112 vendor: true, 113 114 shared_libs: [ 115 "libcutils", 116 "libdmabufheap", 117 "libdrm", 118 "libnativewindow", 119 "libsync", 120 "liblog", 121 ], 122} 123 124cc_defaults { 125 name: "minigbm_cros_gralloc_library_defaults", 126 127 defaults: ["minigbm_cros_gralloc_defaults"], 128 srcs: [ 129 ":minigbm_core_files", 130 ":minigbm_gralloc_common_files", 131 ], 132} 133 134cc_defaults { 135 name: "minigbm_cros_gralloc0_defaults", 136 137 defaults: ["minigbm_cros_gralloc_defaults"], 138 relative_install_path: "hw", 139 140 srcs: [":minigbm_gralloc0_files"], 141} 142 143cc_library { 144 name: "libgbm", 145 defaults: ["minigbm_defaults"], 146 host_supported: true, 147 148 srcs: [ 149 ":minigbm_core_files", 150 "gbm.c", 151 "gbm_helpers.c", 152 ], 153 154 target: { 155 host: { 156 // Avoid linking to another host copy of libdrm; this library will cause 157 // binary GPU drivers to be loaded from the host, which might be linked 158 // to a system copy of libdrm, which conflicts with the AOSP one 159 allow_undefined_symbols: true, 160 header_libs: ["libdrm_headers"], 161 }, 162 android: { 163 shared_libs: [ 164 "libdrm", 165 "liblog" 166 ], 167 }, 168 }, 169 apex_available: [ 170 "//apex_available:platform", 171 "com.android.virt", 172 ], 173 174 export_include_dirs: ["."], 175} 176 177// Generic 178cc_library_shared { 179 name: "libminigbm_gralloc", 180 defaults: ["minigbm_cros_gralloc_library_defaults"], 181 cflags: ["-DHAS_DMABUF_SYSTEM_HEAP"], 182} 183 184cc_library_shared { 185 name: "gralloc.minigbm", 186 defaults: ["minigbm_cros_gralloc0_defaults"], 187 shared_libs: ["libminigbm_gralloc"], 188} 189 190// Intel 191cc_library_shared { 192 name: "libminigbm_gralloc_intel", 193 defaults: ["minigbm_cros_gralloc_library_defaults"], 194 cflags: ["-DDRV_I915"], 195 enabled: false, 196 arch: { 197 x86: { 198 enabled: true, 199 }, 200 x86_64: { 201 enabled: true, 202 }, 203 }, 204} 205 206cc_library_shared { 207 name: "gralloc.minigbm_intel", 208 defaults: ["minigbm_cros_gralloc0_defaults"], 209 shared_libs: ["libminigbm_gralloc_intel"], 210 enabled: false, 211 arch: { 212 x86: { 213 enabled: true, 214 }, 215 x86_64: { 216 enabled: true, 217 }, 218 }, 219} 220 221// Meson 222cc_library_shared { 223 name: "libminigbm_gralloc_meson", 224 defaults: ["minigbm_cros_gralloc_library_defaults"], 225 cflags: ["-DDRV_MESON"], 226} 227 228cc_library_shared { 229 name: "gralloc.minigbm_meson", 230 defaults: ["minigbm_cros_gralloc0_defaults"], 231 shared_libs: ["libminigbm_gralloc_meson"], 232} 233 234// MSM 235cc_library_shared { 236 name: "libminigbm_gralloc_msm", 237 defaults: ["minigbm_cros_gralloc_library_defaults"], 238 cflags: [ 239 "-DDRV_MSM", 240 "-DQCOM_DISABLE_COMPRESSED_NV12", 241 "-DHAS_DMABUF_SYSTEM_HEAP", 242 ], 243} 244 245cc_library_shared { 246 name: "gralloc.minigbm_msm", 247 defaults: ["minigbm_cros_gralloc0_defaults"], 248 shared_libs: ["libminigbm_gralloc_msm"], 249} 250 251// ARCVM 252cc_library_shared { 253 name: "libminigbm_gralloc_arcvm", 254 defaults: ["minigbm_cros_gralloc_library_defaults"], 255 cflags: ["-DVIRTIO_GPU_NEXT"], 256} 257 258cc_library_shared { 259 name: "gralloc.minigbm_arcvm", 260 defaults: ["minigbm_cros_gralloc0_defaults"], 261 shared_libs: ["libminigbm_gralloc_arcvm"], 262} 263