• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright © 2017-2018 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
21pipe_loader_link_args = [ld_args_gc_sections, ld_args_build_id]
22pipe_loader_link_deps = []
23pipe_loader_link_with = [libgallium]
24pipe_loader_comp_args = []
25pipe_loader_incs = [
26  inc_include, inc_src, inc_util, inc_gallium, inc_gallium_drivers,
27  inc_gallium_winsys, inc_gallium_aux,
28]
29
30if (with_gallium_va or with_gallium_vdpau or with_gallium_omx != 'disabled' or
31    with_dri or with_gallium_radeonsi)
32  pipe_loader_link_with += libgalliumvl
33else
34  pipe_loader_link_with += libgalliumvl_stub
35endif
36if (with_gallium_va or with_gallium_vdpau or with_gallium_omx != 'disabled')
37  pipe_loader_link_with += libgalliumvlwinsys
38endif
39
40pipe_loader_install_dir = join_paths(get_option('libdir'), 'gallium-pipe')
41
42_kmsro_targets = [
43   driver_kmsro, driver_v3d, driver_vc4, driver_freedreno, driver_etnaviv,
44   driver_panfrost, driver_lima, driver_asahi,
45]
46
47if with_gallium_v3d
48   _kmsro_targets += [idep_xmlconfig, dep_expat]
49endif
50
51pipe_loaders = [
52  [with_gallium_i915, 'i915', driver_i915, []],
53  [with_gallium_crocus, 'crocus', [driver_crocus, idep_xmlconfig], []],
54  [with_gallium_iris, 'iris', [driver_iris, idep_xmlconfig], []],
55  [with_gallium_nouveau, 'nouveau', driver_nouveau, []],
56  [with_gallium_r300, 'r300', driver_r300, []],
57  [with_gallium_r600, 'r600', driver_r600, []],
58  [with_gallium_radeonsi, 'radeonsi', [driver_radeonsi, idep_xmlconfig], []],
59  [with_gallium_freedreno, 'msm', driver_freedreno, []],
60  [with_gallium_kmsro, 'kmsro', _kmsro_targets, [libpipe_loader_dynamic]],
61  [with_gallium_svga, 'vmwgfx', driver_svga, []],
62  [with_gallium_softpipe, 'swrast', driver_swrast, [libwsw, libws_null, libswdri, libswkmsdri]],
63]
64
65foreach x : pipe_loaders
66  if not x[0]
67    continue
68  endif
69
70  pipe_sym_config = configuration_data()
71
72  foreach d : [[x[1] in ['r300', 'r600', 'radeonsi'], 'radeon_drm_winsys_create'],
73               [x[1] == 'radeonsi', 'amdgpu_winsys_create'],
74               [x[1] == 'radeonsi' and with_llvm, 'ac_init_shared_llvm_once'],
75               [x[1] != 'swrast', 'driver_descriptor'],
76               [x[1] == 'swrast', 'swrast_driver_descriptor']]
77    if d[0]
78      pipe_sym_config.set(d[1], d[1] + ';')
79    else
80      pipe_sym_config.set(d[1], '')
81    endif
82  endforeach
83
84  pipe_sym = configure_file(input : 'pipe.sym.in', output : 'pipe_@0@.sym'.format(x[1]), configuration : pipe_sym_config)
85
86  cur_pipe_loader_link_args = pipe_loader_link_args
87  cur_pipe_loader_link_deps = pipe_loader_link_deps
88  if with_ld_version_script
89    cur_pipe_loader_link_args += [
90      '-Wl,--version-script', join_paths(meson.current_build_dir(), 'pipe_@0@.sym'.format(x[1]))
91    ]
92    cur_pipe_loader_link_deps += pipe_sym
93  endif
94
95  shared_library(
96    'pipe_@0@'.format(x[1]),
97    'pipe_@0@.c'.format(x[1]),
98    c_args : [pipe_loader_comp_args, '-DPIPE_LOADER_DYNAMIC=1'],
99    cpp_args : [pipe_loader_comp_args],
100    gnu_symbol_visibility : 'hidden',
101    link_args : cur_pipe_loader_link_args,
102    link_depends : cur_pipe_loader_link_deps,
103    include_directories : pipe_loader_incs,
104    link_with : [pipe_loader_link_with, x[3]],
105    dependencies : [idep_mesautil, idep_nir, dep_thread, x[2]],
106    name_prefix : '',
107    install : true,
108    install_dir : pipe_loader_install_dir,
109  )
110endforeach
111