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