• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright © 2017 Intel Corporation
2# SPDX-License-Identifier: MIT
3
4tu_entrypoints = custom_target(
5  'tu_entrypoints',
6  input : [vk_entrypoints_gen, vk_api_xml],
7  output : ['tu_entrypoints.h', 'tu_entrypoints.cc'],
8  command : [
9    prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--proto', '--weak',
10    '--out-h', '@OUTPUT0@', '--out-c', '@OUTPUT1@', '--prefix', 'tu',
11    '--include', 'adreno_common.xml.h',
12    '--tmpl-prefix', 'tu', '--tmpl-param', 'chip CHIP',
13    '--tmpl-variants', '<A6XX>', '<A7XX>',
14    '--beta', with_vulkan_beta.to_string(),
15    '--device-prefix', 'tu_rmv',
16  ],
17  depend_files : vk_entrypoints_gen_depend_files,
18)
19
20
21libtu_files = files(
22  'bvh/tu_bvh.h',
23  'bvh/tu_build_interface.h',
24  'layers/tu_rmv_layer.cc',
25  'tu_acceleration_structure.cc',
26  'tu_autotune.cc',
27  'tu_buffer.cc',
28  'tu_buffer_view.cc',
29  'tu_clear_blit.cc',
30  'tu_cmd_buffer.cc',
31  'tu_cs_breadcrumbs.cc',
32  'tu_cs.cc',
33  'tu_device.cc',
34  'tu_descriptor_set.cc',
35  'tu_dynamic_rendering.cc',
36  'tu_event.cc',
37  'tu_formats.cc',
38  'tu_image.cc',
39  'tu_knl.cc',
40  'tu_lrz.cc',
41  'tu_nir_lower_multiview.cc',
42  'tu_nir_lower_ray_query.cc',
43  'tu_pass.cc',
44  'tu_pipeline.cc',
45  'tu_sampler.cc',
46  'tu_query_pool.cc',
47  'tu_queue.cc',
48  'tu_rmv.cc',
49  'tu_shader.cc',
50  'tu_suballoc.cc',
51  'tu_util.cc',
52)
53
54subdir('bvh')
55
56libtu_includes = [
57    inc_include,
58    inc_src,
59    inc_freedreno,
60]
61
62tu_link_with = []
63tu_deps = []
64tu_flags = []
65
66tu_wsi = false
67
68if with_platform_x11
69  tu_deps += dep_xcb_dri3
70  tu_wsi = true
71endif
72
73if with_platform_wayland
74  tu_deps += dep_wayland_client
75  tu_wsi = true
76endif
77
78if system_has_kms_drm and not with_platform_android
79  tu_wsi = true
80endif
81
82if tu_wsi
83  libtu_files += 'tu_wsi.cc'
84endif
85
86if with_platform_android
87  libtu_files += files('tu_android.cc')
88  tu_deps += [dep_android]
89endif
90
91if with_xlib_lease
92  tu_deps += [dep_xlib_xrandr]
93endif
94
95if freedreno_kmds.contains('kgsl')
96  tu_flags += '-DTU_HAS_KGSL'
97  libtu_files += files('tu_knl_kgsl.cc')
98endif
99
100if freedreno_kmds.contains('msm')
101  tu_flags += '-DTU_HAS_MSM'
102  libtu_files += files('tu_knl_drm_msm.cc', 'tu_knl_drm.cc')
103  tu_deps += dep_libdrm
104endif
105
106if freedreno_kmds.contains('virtio')
107  tu_flags += '-DTU_HAS_VIRTIO'
108  libtu_files += files('tu_knl_drm_virtio.cc', 'tu_knl_drm.cc')
109  libtu_includes += [
110    inc_virtio_gpu,
111    inc_virtio_vdrm,
112  ]
113  tu_link_with += libvdrm
114  tu_deps += dep_libdrm
115endif
116
117tu_tracepoints = custom_target(
118  'tu_tracepoints.[ch]',
119  input: 'tu_tracepoints.py',
120  output: ['tu_tracepoints.cc', 'tu_tracepoints.h', 'tu_tracepoints_perfetto.h'],
121  command: [
122    prog_python, '@INPUT@',
123    '-p', join_paths(dir_source_root, 'src/util/perf/'),
124    '--utrace-src', '@OUTPUT0@',
125    '--utrace-hdr', '@OUTPUT1@',
126    '--perfetto-hdr', '@OUTPUT2@',
127  ],
128  depend_files: u_trace_py,
129)
130
131if with_perfetto
132  libtu_files += ['tu_perfetto.cc']
133  tu_deps += dep_perfetto
134endif
135
136tu_cpp_args = []
137tu_cpp_args += cpp.get_supported_arguments([
138  '-fno-exceptions',
139  '-fno-rtti',
140  '-Wno-address-of-temporary',
141  '-Wno-array-bounds',
142  '-Wno-c++11-narrowing',
143  '-Wno-c99-designator',
144  '-Wno-class-memaccess',
145  '-Wno-missing-braces',
146  '-Wno-narrowing',
147  '-Wno-pointer-arith',
148  '-Wno-reorder-init-list',
149  '-Wno-sign-compare',
150  '-Wno-switch',
151  '-Wno-unused-function',
152  '-Wno-vla-cxx-extension',
153  '-Wno-writable-strings',
154  '-Wno-write-strings',
155])
156
157libvulkan_freedreno = shared_library(
158  'vulkan_freedreno',
159  [libtu_files, tu_entrypoints, tu_tracepoints, freedreno_xml_header_files, sha1_h, u_format_pack_h, bvh_spv],
160  include_directories : libtu_includes,
161  link_with : [
162    libfreedreno_ir3,
163    libfreedreno_layout,
164    libfreedreno_perfcntrs,
165    tu_link_with,
166  ],
167  dependencies : [
168    idep_libfreedreno_common,
169    dep_dl,
170    dep_elf,
171    dep_m,
172    dep_thread,
173    dep_valgrind,
174    idep_nir,
175    tu_deps,
176    idep_vulkan_util,
177    idep_vulkan_runtime,
178    idep_vulkan_wsi,
179    idep_mesautil,
180  ],
181  c_args : [no_override_init_args, tu_flags],
182  cpp_args : [tu_cpp_args, tu_flags],
183  gnu_symbol_visibility : 'hidden',
184  link_args : [vulkan_icd_link_args, ld_args_bsymbolic, ld_args_gc_sections, ld_args_build_id],
185  link_depends : vulkan_icd_link_depends,
186  install : true,
187)
188
189if with_symbols_check
190  test(
191    'tu symbols check',
192    symbols_check,
193    args : [
194      '--lib', libvulkan_freedreno,
195      '--symbols-file', vulkan_icd_symbols,
196      symbols_check_args,
197    ],
198    suite : ['freedreno'],
199  )
200endif
201
202freedreno_icd = custom_target(
203  'freedreno_icd',
204  input : [vk_icd_gen, vk_api_xml],
205  output : 'freedreno_icd.@0@.json'.format(host_machine.cpu()),
206  command : [
207    prog_python, '@INPUT0@',
208    '--api-version', '1.4', '--xml', '@INPUT1@',
209    '--lib-path', join_paths(get_option('prefix'), get_option('libdir'),
210                             'libvulkan_freedreno.so'),
211    '--out', '@OUTPUT@',
212  ],
213  build_by_default : true,
214  install_dir : with_vulkan_icd_dir,
215  install_tag : 'runtime',
216  install : true,
217)
218
219_dev_icdname = 'freedreno_devenv_icd.@0@.json'.format(host_machine.cpu())
220_dev_icd = custom_target(
221  'freedreno_devenv_icd',
222  input : [vk_icd_gen, vk_api_xml],
223  output : _dev_icdname,
224  command : [
225    prog_python, '@INPUT0@',
226    '--api-version', '1.4', '--xml', '@INPUT1@',
227    '--lib-path', meson.current_build_dir() / 'libvulkan_freedreno.so',
228    '--out', '@OUTPUT@',
229  ],
230  build_by_default : true,
231)
232
233devenv.append('VK_DRIVER_FILES', _dev_icd.full_path())
234# Deprecated: replaced by VK_DRIVER_FILES above
235devenv.append('VK_ICD_FILENAMES', _dev_icd.full_path())
236