1# Copyright © 2017 Rob Clark 2# SPDX-License-Identifier: MIT 3 4files_libfreedreno = files( 5 'driinfo_freedreno.h', 6 'freedreno_autotune.c', 7 'freedreno_autotune.h', 8 'freedreno_batch.c', 9 'freedreno_batch.h', 10 'freedreno_batch_cache.c', 11 'freedreno_batch_cache.h', 12 'freedreno_blitter.c', 13 'freedreno_blitter.h', 14 'freedreno_context.c', 15 'freedreno_context.h', 16 'freedreno_draw.c', 17 'freedreno_draw.h', 18 'freedreno_fence.c', 19 'freedreno_fence.h', 20 'freedreno_gmem.c', 21 'freedreno_gmem.h', 22 'freedreno_program.c', 23 'freedreno_program.h', 24 'freedreno_query.c', 25 'freedreno_query.h', 26 'freedreno_query_acc.c', 27 'freedreno_query_acc.h', 28 'freedreno_query_hw.c', 29 'freedreno_query_hw.h', 30 'freedreno_query_sw.c', 31 'freedreno_query_sw.h', 32 'freedreno_resource.c', 33 'freedreno_resource.h', 34 'freedreno_screen.c', 35 'freedreno_screen.h', 36 'freedreno_state.c', 37 'freedreno_state.h', 38 'freedreno_surface.c', 39 'freedreno_surface.h', 40 'freedreno_texture.c', 41 'freedreno_texture.h', 42 'freedreno_util.c', 43 'freedreno_util.h', 44 'a2xx/fd2_blend.c', 45 'a2xx/fd2_blend.h', 46 'a2xx/fd2_context.c', 47 'a2xx/fd2_context.h', 48 'a2xx/fd2_draw.c', 49 'a2xx/fd2_draw.h', 50 'a2xx/fd2_emit.c', 51 'a2xx/fd2_emit.h', 52 'a2xx/fd2_gmem.c', 53 'a2xx/fd2_gmem.h', 54 'a2xx/fd2_program.c', 55 'a2xx/fd2_program.h', 56 'a2xx/fd2_query.c', 57 'a2xx/fd2_query.h', 58 'a2xx/fd2_rasterizer.c', 59 'a2xx/fd2_rasterizer.h', 60 'a2xx/fd2_resource.c', 61 'a2xx/fd2_resource.h', 62 'a2xx/fd2_screen.c', 63 'a2xx/fd2_screen.h', 64 'a2xx/fd2_texture.c', 65 'a2xx/fd2_texture.h', 66 'a2xx/fd2_util.c', 67 'a2xx/fd2_util.h', 68 'a2xx/fd2_zsa.c', 69 'a2xx/fd2_zsa.h', 70 'a2xx/ir2.c', 71 'a2xx/ir2.h', 72 'a2xx/ir2_assemble.c', 73 'a2xx/ir2_cp.c', 74 'a2xx/ir2_nir.c', 75 'a2xx/ir2_private.h', 76 'a2xx/ir2_ra.c', 77 'a3xx/fd3_blend.c', 78 'a3xx/fd3_blend.h', 79 'a3xx/fd3_context.c', 80 'a3xx/fd3_context.h', 81 'a3xx/fd3_draw.c', 82 'a3xx/fd3_draw.h', 83 'a3xx/fd3_emit.c', 84 'a3xx/fd3_emit.h', 85 'a3xx/fd3_format.c', 86 'a3xx/fd3_format.h', 87 'a3xx/fd3_gmem.c', 88 'a3xx/fd3_gmem.h', 89 'a3xx/fd3_program.c', 90 'a3xx/fd3_program.h', 91 'a3xx/fd3_query.c', 92 'a3xx/fd3_query.h', 93 'a3xx/fd3_rasterizer.c', 94 'a3xx/fd3_rasterizer.h', 95 'a3xx/fd3_resource.c', 96 'a3xx/fd3_resource.h', 97 'a3xx/fd3_screen.c', 98 'a3xx/fd3_screen.h', 99 'a3xx/fd3_texture.c', 100 'a3xx/fd3_texture.h', 101 'a3xx/fd3_zsa.c', 102 'a3xx/fd3_zsa.h', 103 'a4xx/fd4_blend.c', 104 'a4xx/fd4_blend.h', 105 'a4xx/fd4_compute.c', 106 'a4xx/fd4_compute.h', 107 'a4xx/fd4_context.c', 108 'a4xx/fd4_context.h', 109 'a4xx/fd4_draw.c', 110 'a4xx/fd4_draw.h', 111 'a4xx/fd4_emit.c', 112 'a4xx/fd4_emit.h', 113 'a4xx/fd4_format.c', 114 'a4xx/fd4_format.h', 115 'a4xx/fd4_gmem.c', 116 'a4xx/fd4_gmem.h', 117 'a4xx/fd4_image.c', 118 'a4xx/fd4_image.h', 119 'a4xx/fd4_program.c', 120 'a4xx/fd4_program.h', 121 'a4xx/fd4_query.c', 122 'a4xx/fd4_query.h', 123 'a4xx/fd4_rasterizer.c', 124 'a4xx/fd4_rasterizer.h', 125 'a4xx/fd4_resource.c', 126 'a4xx/fd4_resource.h', 127 'a4xx/fd4_screen.c', 128 'a4xx/fd4_screen.h', 129 'a4xx/fd4_texture.c', 130 'a4xx/fd4_texture.h', 131 'a4xx/fd4_zsa.c', 132 'a4xx/fd4_zsa.h', 133 'a5xx/fd5_blend.c', 134 'a5xx/fd5_blend.h', 135 'a5xx/fd5_blitter.c', 136 'a5xx/fd5_blitter.h', 137 'a5xx/fd5_compute.c', 138 'a5xx/fd5_compute.h', 139 'a5xx/fd5_context.c', 140 'a5xx/fd5_context.h', 141 'a5xx/fd5_draw.c', 142 'a5xx/fd5_draw.h', 143 'a5xx/fd5_emit.c', 144 'a5xx/fd5_emit.h', 145 'a5xx/fd5_format.c', 146 'a5xx/fd5_format.h', 147 'a5xx/fd5_gmem.c', 148 'a5xx/fd5_gmem.h', 149 'a5xx/fd5_image.c', 150 'a5xx/fd5_image.h', 151 'a5xx/fd5_program.c', 152 'a5xx/fd5_program.h', 153 'a5xx/fd5_query.c', 154 'a5xx/fd5_query.h', 155 'a5xx/fd5_rasterizer.c', 156 'a5xx/fd5_rasterizer.h', 157 'a5xx/fd5_resource.c', 158 'a5xx/fd5_resource.h', 159 'a5xx/fd5_screen.c', 160 'a5xx/fd5_screen.h', 161 'a5xx/fd5_texture.c', 162 'a5xx/fd5_texture.h', 163 'a5xx/fd5_zsa.c', 164 'a5xx/fd5_zsa.h', 165 'a6xx/fd6_barrier.cc', 166 'a6xx/fd6_barrier.h', 167 'a6xx/fd6_blend.cc', 168 'a6xx/fd6_blend.h', 169 'a6xx/fd6_blitter.cc', 170 'a6xx/fd6_blitter.h', 171 'a6xx/fd6_compute.cc', 172 'a6xx/fd6_compute.h', 173 'a6xx/fd6_const.cc', 174 'a6xx/fd6_const.h', 175 'a6xx/fd6_context.cc', 176 'a6xx/fd6_context.h', 177 'a6xx/fd6_draw.cc', 178 'a6xx/fd6_draw.h', 179 'a6xx/fd6_emit.cc', 180 'a6xx/fd6_emit.h', 181 'a6xx/fd6_gmem.cc', 182 'a6xx/fd6_gmem.h', 183 'a6xx/fd6_image.cc', 184 'a6xx/fd6_image.h', 185 'a6xx/fd6_program.cc', 186 'a6xx/fd6_program.h', 187 'a6xx/fd6_query.cc', 188 'a6xx/fd6_query.h', 189 'a6xx/fd6_rasterizer.cc', 190 'a6xx/fd6_rasterizer.h', 191 'a6xx/fd6_resource.cc', 192 'a6xx/fd6_resource.h', 193 'a6xx/fd6_screen.cc', 194 'a6xx/fd6_screen.h', 195 'a6xx/fd6_texture.cc', 196 'a6xx/fd6_texture.h', 197 'a6xx/fd6_vsc.cc', 198 'a6xx/fd6_vsc.h', 199 'a6xx/fd6_zsa.cc', 200 'a6xx/fd6_zsa.h', 201 'ir3/ir3_cache.c', 202 'ir3/ir3_cache.h', 203 'ir3/ir3_const.h', 204 'ir3/ir3_descriptor.c', 205 'ir3/ir3_descriptor.h', 206 'ir3/ir3_gallium.c', 207 'ir3/ir3_gallium.h', 208) 209 210freedreno_tracepoints = custom_target( 211 'freedreno_tracepoints.[ch]', 212 input: 'freedreno_tracepoints.py', 213 output: ['freedreno_tracepoints.c', 'freedreno_tracepoints.h'], 214 command: [ 215 prog_python, '@INPUT@', 216 '-p', join_paths(dir_source_root, 'src/util/perf/'), 217 '-C', '@OUTPUT0@', 218 '-H', '@OUTPUT1@', 219 ], 220 depend_files: u_trace_py, 221) 222 223files_libfreedreno += freedreno_tracepoints 224 225freedreno_includes = [ 226 inc_mesa, inc_mapi, 227 inc_src, inc_include, inc_gallium, inc_gallium_aux, 228 inc_freedreno, include_directories('ir3'), 229] 230 231freedreno_c_args = [no_override_init_args] 232freedreno_c_args += cc.get_supported_arguments([ 233 '-Wno-packed-bitfield-compat', 234 '-Wno-array-bounds', 235]) 236 237freedreno_cpp_args = [] 238freedreno_cpp_args += cpp.get_supported_arguments([ 239 '-fno-exceptions', 240 '-fno-rtti', 241 '-Wno-packed-bitfield-compat', 242 '-Wno-c99-designator', 243 '-Wno-reorder-init-list', 244 '-Wno-address-of-temporary', 245 '-Wno-c++11-narrowing', 246 '-Wno-narrowing', 247 '-Wno-sign-compare', 248 '-Wno-missing-field-initializers', 249 '-Wno-reorder', 250 '-Wno-array-bounds', 251 '-Wno-overflow', 252 '-Wno-c++11-narrowing', 253 '-Wno-vla-cxx-extension', 254 '-Wno-address-of-packed-member', 255]) 256 257# HACK compiler.get_supported_arguments()/has_argument() do not seem 258# to be reliable for cross builds (!?!) so just jam in some args we 259# need and hope for the best 260if meson.is_cross_build() 261 freedreno_cpp_args += '-Wno-array-bounds' 262 freedreno_cpp_args += '-Wno-c++11-narrowing' 263 freedreno_cpp_args += '-Wno-c99-designator' 264endif 265 266libfreedreno_dependencies = [ 267 dep_libdrm, 268 idep_mesautil, 269 idep_nir_headers, 270 idep_libfreedreno_common, 271 idep_u_tracepoints, 272] 273 274if with_perfetto 275 libfreedreno_dependencies += dep_perfetto 276 files_libfreedreno += 'freedreno_perfetto.cc' 277endif 278 279# The header file ends up part of the build (but just a stub) 280# in either case: 281files_libfreedreno += 'freedreno_perfetto.h' 282 283libfreedreno = static_library( 284 'freedreno', 285 [files_libfreedreno, freedreno_xml_header_files], 286 include_directories : freedreno_includes, 287 c_args : [freedreno_c_args], 288 cpp_args : [freedreno_cpp_args], 289 gnu_symbol_visibility : 'hidden', 290 dependencies : libfreedreno_dependencies, 291) 292 293driver_freedreno = declare_dependency( 294 compile_args : '-DGALLIUM_FREEDRENO', 295 link_with : [ 296 libfreedrenowinsys, 297 libfreedreno, 298 libfreedreno_drm, 299 libfreedreno_ir2, 300 libfreedreno_ir3, 301 libfreedreno_layout, 302 libfreedreno_perfcntrs 303 ], 304 dependencies : [ 305 idep_nir, 306 idep_xmlconfig, 307 ], 308) 309 310ir3_compiler = executable( 311 'ir3_compiler', 312 ['ir3/ir3_cmdline.c', freedreno_xml_header_files], 313 include_directories : freedreno_includes, 314 dependencies : [ 315 idep_nir, 316 idep_vtn, 317 idep_mesautil, 318 ], 319 link_with : [ 320 libfreedreno, 321 libfreedreno_drm, 322 libfreedreno_ir3, 323 libfreedreno_layout, 324 libgallium, 325 libglsl_standalone, 326 ], 327 build_by_default : with_tools.contains('freedreno'), 328 install : false, 329) 330 331gmemtool = executable( 332 'gmemtool', 333 [ 334 'gmemtool.c', 335 freedreno_tracepoints[1] 336 ], 337 include_directories : freedreno_includes, 338 dependencies : [ 339 idep_nir, 340 idep_mesautil, 341 idep_u_tracepoints, 342 idep_xmlconfig, 343 ], 344 link_with : [ 345 libfreedreno, 346 libfreedreno_drm, 347 libfreedreno_ir2, 348 libfreedreno_ir3, 349 libfreedreno_layout, 350 libgallium, 351 libglsl_standalone, 352 libfreedreno_perfcntrs, 353 ], 354 build_by_default : with_tools.contains('freedreno'), 355 install : false, 356) 357