• 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
21ir3_nir_trig_c = custom_target(
22  'ir3_nir_trig.c',
23  input : 'ir3/ir3_nir_trig.py',
24  output : 'ir3_nir_trig.c',
25  command : [
26    prog_python2, '@INPUT@',
27    '-p', join_paths(meson.source_root(), 'src/compiler/nir/'),
28  ],
29  capture : true,
30  depend_files : nir_algebraic_py,
31)
32
33files_libfreedreno = files(
34  'adreno_common.xml.h',
35  'adreno_pm4.xml.h',
36  'disasm.h',
37  'freedreno_batch.c',
38  'freedreno_batch.h',
39  'freedreno_batch_cache.c',
40  'freedreno_batch_cache.h',
41  'freedreno_blitter.c',
42  'freedreno_blitter.h',
43  'freedreno_context.c',
44  'freedreno_context.h',
45  'freedreno_draw.c',
46  'freedreno_draw.h',
47  'freedreno_fence.c',
48  'freedreno_fence.h',
49  'freedreno_gmem.c',
50  'freedreno_gmem.h',
51  'freedreno_program.c',
52  'freedreno_program.h',
53  'freedreno_query.c',
54  'freedreno_query.h',
55  'freedreno_query_acc.c',
56  'freedreno_query_acc.h',
57  'freedreno_query_hw.c',
58  'freedreno_query_hw.h',
59  'freedreno_query_sw.c',
60  'freedreno_query_sw.h',
61  'freedreno_resource.c',
62  'freedreno_resource.h',
63  'freedreno_screen.c',
64  'freedreno_screen.h',
65  'freedreno_state.c',
66  'freedreno_state.h',
67  'freedreno_surface.c',
68  'freedreno_surface.h',
69  'freedreno_texture.c',
70  'freedreno_texture.h',
71  'freedreno_util.c',
72  'freedreno_util.h',
73  'a2xx/a2xx.xml.h',
74  'a2xx/disasm-a2xx.c',
75  'a2xx/fd2_blend.c',
76  'a2xx/fd2_blend.h',
77  'a2xx/fd2_compiler.c',
78  'a2xx/fd2_compiler.h',
79  'a2xx/fd2_context.c',
80  'a2xx/fd2_context.h',
81  'a2xx/fd2_draw.c',
82  'a2xx/fd2_draw.h',
83  'a2xx/fd2_emit.c',
84  'a2xx/fd2_emit.h',
85  'a2xx/fd2_gmem.c',
86  'a2xx/fd2_gmem.h',
87  'a2xx/fd2_program.c',
88  'a2xx/fd2_program.h',
89  'a2xx/fd2_rasterizer.c',
90  'a2xx/fd2_rasterizer.h',
91  'a2xx/fd2_screen.c',
92  'a2xx/fd2_screen.h',
93  'a2xx/fd2_texture.c',
94  'a2xx/fd2_texture.h',
95  'a2xx/fd2_util.c',
96  'a2xx/fd2_util.h',
97  'a2xx/fd2_zsa.c',
98  'a2xx/fd2_zsa.h',
99  'a2xx/instr-a2xx.h',
100  'a2xx/ir-a2xx.c',
101  'a2xx/ir-a2xx.h',
102  'a3xx/a3xx.xml.h',
103  'a3xx/fd3_blend.c',
104  'a3xx/fd3_blend.h',
105  'a3xx/fd3_context.c',
106  'a3xx/fd3_context.h',
107  'a3xx/fd3_draw.c',
108  'a3xx/fd3_draw.h',
109  'a3xx/fd3_emit.c',
110  'a3xx/fd3_emit.h',
111  'a3xx/fd3_format.c',
112  'a3xx/fd3_format.h',
113  'a3xx/fd3_gmem.c',
114  'a3xx/fd3_gmem.h',
115  'a3xx/fd3_program.c',
116  'a3xx/fd3_program.h',
117  'a3xx/fd3_query.c',
118  'a3xx/fd3_query.h',
119  'a3xx/fd3_rasterizer.c',
120  'a3xx/fd3_rasterizer.h',
121  'a3xx/fd3_screen.c',
122  'a3xx/fd3_screen.h',
123  'a3xx/fd3_texture.c',
124  'a3xx/fd3_texture.h',
125  'a3xx/fd3_zsa.c',
126  'a3xx/fd3_zsa.h',
127  'a4xx/a4xx.xml.h',
128  'a4xx/fd4_blend.c',
129  'a4xx/fd4_blend.h',
130  'a4xx/fd4_context.c',
131  'a4xx/fd4_context.h',
132  'a4xx/fd4_draw.c',
133  'a4xx/fd4_draw.h',
134  'a4xx/fd4_emit.c',
135  'a4xx/fd4_emit.h',
136  'a4xx/fd4_format.c',
137  'a4xx/fd4_format.h',
138  'a4xx/fd4_gmem.c',
139  'a4xx/fd4_gmem.h',
140  'a4xx/fd4_program.c',
141  'a4xx/fd4_program.h',
142  'a4xx/fd4_query.c',
143  'a4xx/fd4_query.h',
144  'a4xx/fd4_rasterizer.c',
145  'a4xx/fd4_rasterizer.h',
146  'a4xx/fd4_screen.c',
147  'a4xx/fd4_screen.h',
148  'a4xx/fd4_texture.c',
149  'a4xx/fd4_texture.h',
150  'a4xx/fd4_zsa.c',
151  'a4xx/fd4_zsa.h',
152  'a5xx/a5xx.xml.h',
153  'a5xx/fd5_blend.c',
154  'a5xx/fd5_blend.h',
155  'a5xx/fd5_blitter.c',
156  'a5xx/fd5_blitter.h',
157  'a5xx/fd5_compute.c',
158  'a5xx/fd5_compute.h',
159  'a5xx/fd5_context.c',
160  'a5xx/fd5_context.h',
161  'a5xx/fd5_draw.c',
162  'a5xx/fd5_draw.h',
163  'a5xx/fd5_emit.c',
164  'a5xx/fd5_emit.h',
165  'a5xx/fd5_format.c',
166  'a5xx/fd5_format.h',
167  'a5xx/fd5_gmem.c',
168  'a5xx/fd5_gmem.h',
169  'a5xx/fd5_image.c',
170  'a5xx/fd5_image.h',
171  'a5xx/fd5_program.c',
172  'a5xx/fd5_program.h',
173  'a5xx/fd5_query.c',
174  'a5xx/fd5_query.h',
175  'a5xx/fd5_rasterizer.c',
176  'a5xx/fd5_rasterizer.h',
177  'a5xx/fd5_resource.c',
178  'a5xx/fd5_resource.h',
179  'a5xx/fd5_screen.c',
180  'a5xx/fd5_screen.h',
181  'a5xx/fd5_texture.c',
182  'a5xx/fd5_texture.h',
183  'a5xx/fd5_zsa.c',
184  'a5xx/fd5_zsa.h',
185  'ir3/disasm-a3xx.c',
186  'ir3/instr-a3xx.h',
187  'ir3/ir3.c',
188  'ir3/ir3_compiler_nir.c',
189  'ir3/ir3_compiler.c',
190  'ir3/ir3_compiler.h',
191  'ir3/ir3_cp.c',
192  'ir3/ir3_depth.c',
193  'ir3/ir3_group.c',
194  'ir3/ir3.h',
195  'ir3/ir3_legalize.c',
196  'ir3/ir3_nir.c',
197  'ir3/ir3_nir.h',
198  'ir3/ir3_nir_lower_if_else.c',
199  'ir3/ir3_nir_lower_tg4_to_tex.c',
200  'ir3/ir3_print.c',
201  'ir3/ir3_ra.c',
202  'ir3/ir3_sched.c',
203  'ir3/ir3_shader.c',
204  'ir3/ir3_shader.h',
205)
206
207freedreno_includes = [
208  inc_src, inc_include, inc_gallium, inc_gallium_aux,
209  include_directories('ir3')
210]
211
212freedreno_c_args = []
213if cc.has_argument('-Wpacked-bitfield-compat')
214  freedreno_c_args += '-Wno-packed-bitfield-compat'
215endif
216
217freedreno_cpp_args = []
218if cpp.has_argument('-Wpacked-bitfield-compat')
219  freedreno_cpp_args += '-Wno-packed-bitfield-compat'
220endif
221
222libfreedreno = static_library(
223  'freedreno',
224  [files_libfreedreno, ir3_nir_trig_c],
225  include_directories : freedreno_includes,
226  c_args : [freedreno_c_args, c_vis_args],
227  cpp_args : [freedreno_cpp_args, cpp_vis_args],
228  dependencies : [dep_libdrm, dep_libdrm_freedreno, idep_nir_headers],
229)
230
231driver_freedreno = declare_dependency(
232  compile_args : '-DGALLIUM_FREEDRENO',
233  link_with : [libfreedrenowinsys, libfreedreno],
234  dependencies : idep_nir,
235)
236
237ir3_compiler = executable(
238  'ir3_compiler',
239  'ir3/ir3_cmdline.c',
240  include_directories : freedreno_includes,
241  dependencies : [
242    dep_libdrm,
243    dep_libdrm_freedreno,
244    dep_thread,
245    idep_nir,
246  ],
247  link_with : [
248    libfreedreno,
249    libgallium,
250    libglsl_standalone,
251    libmesa_util,
252  ],
253  build_by_default : true,
254)
255