• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright © 2017-2019 Intel Corporation
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
21anv_entrypoints = custom_target(
22  'anv_entrypoints',
23  input : [vk_entrypoints_gen, vk_api_xml],
24  output : ['anv_entrypoints.h', 'anv_entrypoints.c'],
25  command : [
26    prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--proto', '--weak',
27    '--out-h', '@OUTPUT0@', '--out-c', '@OUTPUT1@', '--prefix', 'anv',
28    '--device-prefix', 'gfx7', '--device-prefix', 'gfx75',
29    '--device-prefix', 'gfx8', '--device-prefix', 'gfx9',
30    '--device-prefix', 'gfx11', '--device-prefix', 'gfx12',
31    '--device-prefix', 'gfx125',
32  ],
33  depend_files : vk_entrypoints_gen_depend_files,
34)
35
36intel_icd = custom_target(
37  'intel_icd',
38  input : [vk_icd_gen, vk_api_xml],
39  output : 'intel_icd.@0@.json'.format(host_machine.cpu()),
40  command : [
41    prog_python, '@INPUT0@',
42    '--api-version', '1.2', '--xml', '@INPUT1@',
43    '--lib-path', join_paths(get_option('prefix'), get_option('libdir'),
44                             'libvulkan_intel.so'),
45    '--out', '@OUTPUT@',
46  ],
47  build_by_default : true,
48  install_dir : with_vulkan_icd_dir,
49  install : true,
50)
51
52libanv_per_hw_ver_libs = []
53anv_per_hw_ver_files = files(
54  'genX_blorp_exec.c',
55  'genX_cmd_buffer.c',
56  'genX_gpu_memcpy.c',
57  'genX_pipeline.c',
58  'genX_query.c',
59  'genX_state.c',
60)
61foreach g : [['70', ['gfx7_cmd_buffer.c']], ['75', ['gfx7_cmd_buffer.c']],
62             ['80', ['gfx8_cmd_buffer.c']], ['90', ['gfx8_cmd_buffer.c']],
63             ['110', ['gfx8_cmd_buffer.c']], ['120', ['gfx8_cmd_buffer.c']],
64             ['125', ['gfx8_cmd_buffer.c']]]
65  _gfx_ver = g[0]
66  libanv_per_hw_ver_libs += static_library(
67    'anv_per_hw_ver@0@'.format(_gfx_ver),
68    [anv_per_hw_ver_files, g[1], anv_entrypoints[0]],
69    include_directories : [
70      inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_compiler, inc_intel,
71    ],
72    c_args : [
73      no_override_init_args, c_sse2_args,
74      '-DGFX_VERx10=@0@'.format(_gfx_ver),
75    ],
76    gnu_symbol_visibility : 'hidden',
77    dependencies : [
78      dep_libdrm, dep_valgrind, idep_nir_headers, idep_genxml,
79      idep_vulkan_util_headers, idep_vulkan_wsi_headers,
80    ],
81  )
82endforeach
83
84libanv_files = files(
85  'anv_acceleration_structure.c',
86  'anv_allocator.c',
87  'anv_android.h',
88  'anv_batch_chain.c',
89  'anv_blorp.c',
90  'anv_cmd_buffer.c',
91  'anv_descriptor_set.c',
92  'anv_device.c',
93  'anv_formats.c',
94  'anv_genX.h',
95  'anv_image.c',
96  'anv_measure.c',
97  'anv_measure.h',
98  'anv_nir.h',
99  'anv_nir_add_base_work_group_id.c',
100  'anv_nir_apply_pipeline_layout.c',
101  'anv_nir_compute_push_layout.c',
102  'anv_nir_lower_multiview.c',
103  'anv_nir_lower_ubo_loads.c',
104  'anv_nir_lower_ycbcr_textures.c',
105  'anv_pass.c',
106  'anv_perf.c',
107  'anv_pipeline.c',
108  'anv_pipeline_cache.c',
109  'anv_private.h',
110  'anv_queue.c',
111  'anv_util.c',
112  'anv_wsi.c',
113)
114
115anv_deps = [
116  dep_libdrm,
117  dep_valgrind,
118  idep_genxml,
119  idep_nir_headers,
120  idep_vulkan_util_headers,
121  idep_vulkan_wsi_headers,
122]
123anv_flags = [
124  no_override_init_args,
125  c_sse2_args,
126]
127
128if with_platform_x11
129  anv_deps += dep_xcb_dri3
130endif
131
132if with_platform_wayland
133  anv_deps += dep_wayland_client
134endif
135
136if system_has_kms_drm and not with_platform_android
137  libanv_files += files('anv_wsi_display.c')
138endif
139
140if with_xlib_lease
141  anv_deps += [dep_xlib_xrandr]
142endif
143
144if with_platform_android
145  libanv_files += files('anv_android.c')
146else
147  libanv_files += files('anv_android_stubs.c')
148endif
149
150libanv_common = static_library(
151  'anv_common',
152  [
153    libanv_files, anv_entrypoints, sha1_h,
154    gen_xml_pack,
155  ],
156  include_directories : [
157    inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_intel, inc_compiler,
158    inc_util,
159  ],
160  c_args : anv_flags,
161  gnu_symbol_visibility : 'hidden',
162  dependencies : anv_deps,
163)
164
165libvulkan_intel = shared_library(
166  'vulkan_intel',
167  [files('anv_gem.c'), anv_entrypoints[0]],
168  include_directories : [
169    inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_intel, inc_compiler,
170  ],
171  link_whole : [libanv_common, libanv_per_hw_ver_libs],
172  link_with : [
173    libintel_compiler, libintel_dev, libisl, libblorp, libintel_perf,
174  ],
175  dependencies : [
176    dep_thread, dep_dl, dep_m, anv_deps, idep_libintel_common,
177    idep_nir, idep_genxml, idep_vulkan_util, idep_vulkan_wsi,
178    idep_mesautil, idep_xmlconfig,
179  ],
180  c_args : anv_flags,
181  gnu_symbol_visibility : 'hidden',
182  link_args : [ld_args_build_id, ld_args_bsymbolic, ld_args_gc_sections],
183  install : true,
184)
185
186if with_symbols_check
187  test(
188    'anv symbols check',
189    symbols_check,
190    args : [
191      '--lib', libvulkan_intel,
192      '--symbols-file', vulkan_icd_symbols,
193      symbols_check_args,
194    ],
195    suite : ['intel'],
196  )
197endif
198
199if with_tests
200  libvulkan_intel_test = static_library(
201    'vulkan_intel_test',
202    [files('anv_gem_stubs.c'), anv_entrypoints[0]],
203    include_directories : [
204      inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_intel, inc_compiler,
205    ],
206    link_whole : libanv_common,
207    link_with : [
208      libanv_per_hw_ver_libs, libintel_compiler, libintel_common, libintel_dev,
209      libisl, libblorp, libintel_perf,
210    ],
211    dependencies : [
212      dep_thread, dep_dl, dep_m, anv_deps,
213      idep_nir, idep_vulkan_util, idep_vulkan_wsi, idep_mesautil,
214    ],
215    c_args : anv_flags,
216    gnu_symbol_visibility : 'hidden',
217  )
218
219  foreach t : ['block_pool_no_free', 'block_pool_grow_first',
220               'state_pool_no_free', 'state_pool_free_list_only',
221               'state_pool', 'state_pool_padding']
222    test(
223      'anv_@0@'.format(t),
224      executable(
225        t,
226        ['tests/@0@.c'.format(t), anv_entrypoints[0]],
227        c_args : [ c_sse2_args ],
228        link_with : libvulkan_intel_test,
229        dependencies : [
230          dep_libdrm, dep_thread, dep_m, dep_valgrind,
231          idep_vulkan_util, idep_vulkan_wsi_headers,
232        ],
233        include_directories : [
234          inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_intel, inc_compiler,
235        ],
236      ),
237      suite : ['intel'],
238    )
239  endforeach
240endif
241