• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright © 2022 Imagination Technologies Ltd.
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 (including the next
11# paragraph) shall be included in all copies or substantial portions of the
12# Software.
13
14# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20# SOFTWARE.
21
22subdir('pds')
23
24pvr_entrypoints = custom_target(
25  'pvr_entrypoints',
26  input : [vk_entrypoints_gen, vk_api_xml],
27  output : ['pvr_entrypoints.h', 'pvr_entrypoints.c'],
28  command : [
29    prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--proto', '--weak',
30    '--out-h', '@OUTPUT0@', '--out-c', '@OUTPUT1@', '--prefix', 'pvr',
31    '--beta', with_vulkan_beta.to_string()
32  ],
33  depend_files : vk_entrypoints_gen_depend_files,
34)
35
36pvr_files = files(
37  'winsys/powervr/pvr_drm.c',
38  'winsys/powervr/pvr_drm_bo.c',
39  'winsys/powervr/pvr_drm_job_compute.c',
40  'winsys/powervr/pvr_drm_job_null.c',
41  'winsys/powervr/pvr_drm_job_render.c',
42  'winsys/powervr/pvr_drm_job_transfer.c',
43  'winsys/pvr_winsys.c',
44  'winsys/pvr_winsys_helper.c',
45  'pvr_blit.c',
46  'pvr_bo.c',
47  'pvr_border.c',
48  'pvr_clear.c',
49  'pvr_cmd_buffer.c',
50  'pvr_csb.c',
51  'pvr_descriptor_set.c',
52  'pvr_device.c',
53  'pvr_dump_bo.c',
54  'pvr_dump_csb.c',
55  'pvr_formats.c',
56  'pvr_hardcode.c',
57  'pvr_hw_pass.c',
58  'pvr_image.c',
59  'pvr_job_common.c',
60  'pvr_job_compute.c',
61  'pvr_job_context.c',
62  'pvr_job_render.c',
63  'pvr_job_transfer.c',
64  'pvr_pass.c',
65  'pvr_pipeline.c',
66  'pvr_transfer_frag_store.c',
67  'pvr_query.c',
68  'pvr_query_compute.c',
69  'pvr_queue.c',
70  'pvr_robustness.c',
71  'pvr_shader.c',
72  'pvr_spm.c',
73  'pvr_tex_state.c',
74  'pvr_wsi.c',
75
76  'usc/pvr_uscgen.c',
77  'usc/pvr_uscgen_tq.c',
78)
79
80pvr_includes = [
81  include_directories('usc/programs'),
82  include_directories('usc'),
83  include_directories('winsys'),
84  libpowervr_pds_includes,
85]
86
87pvr_deps = [
88  dep_csbgen,
89  dep_libdrm,
90  dep_valgrind,
91  idep_mesautil,
92  idep_vulkan_runtime,
93  idep_vulkan_util,
94  idep_vulkan_wsi,
95]
96
97pvr_flags = [
98  imagination_c_args,
99  no_override_init_args,
100]
101
102if with_imagination_srv
103  pvr_files += files(
104    'winsys/pvrsrvkm/pvr_srv.c',
105    'winsys/pvrsrvkm/pvr_srv_bo.c',
106    'winsys/pvrsrvkm/pvr_srv_bridge.c',
107    'winsys/pvrsrvkm/pvr_srv_job_common.c',
108    'winsys/pvrsrvkm/pvr_srv_job_compute.c',
109    'winsys/pvrsrvkm/pvr_srv_job_null.c',
110    'winsys/pvrsrvkm/pvr_srv_job_render.c',
111    'winsys/pvrsrvkm/pvr_srv_job_transfer.c',
112    'winsys/pvrsrvkm/pvr_srv_sync.c',
113    'winsys/pvrsrvkm/pvr_srv_sync_prim.c',
114  )
115  pvr_flags += '-DPVR_SUPPORT_SERVICES_DRIVER'
116endif
117
118libvulkan_powervr_mesa = shared_library(
119  'vulkan_powervr_mesa',
120  [pvr_files, pvr_entrypoints, u_format_pack_h],
121  include_directories : [
122    pvr_includes,
123    inc_imagination,
124    inc_include,
125    inc_src,
126  ],
127  link_with : [
128    libpowervr_common,
129    libpowervr_pds,
130    libpowervr_rogue,
131    libvulkan_wsi,
132  ],
133  dependencies : [
134    pvr_deps,
135    idep_nir,
136  ],
137  c_args : pvr_flags,
138  link_args : [
139    ld_args_build_id,
140    ld_args_bsymbolic,
141    ld_args_gc_sections
142  ],
143  gnu_symbol_visibility : 'hidden',
144  install : true,
145)
146
147if with_symbols_check
148  test(
149    'pvr symbols check',
150    symbols_check,
151    args : [
152      '--lib', libvulkan_powervr_mesa,
153      '--symbols-file', vulkan_icd_symbols,
154      symbols_check_args,
155    ],
156    suite : ['imagination'],
157  )
158endif
159
160powervr_mesa_icd = custom_target(
161  'powervr_mesa_icd',
162  input : [vk_icd_gen, vk_api_xml],
163  output : 'powervr_mesa_icd.@0@.json'.format(host_machine.cpu()),
164  command : [
165    prog_python, '@INPUT0@',
166    '--api-version', '1.0', '--xml', '@INPUT1@',
167    '--lib-path', get_option('prefix') / get_option('libdir') / 'libvulkan_powervr_mesa.so',
168    '--out', '@OUTPUT@',
169  ],
170  build_by_default : true,
171  install_dir : with_vulkan_icd_dir,
172  install_tag : 'runtime',
173  install : true,
174)
175
176_dev_icd = custom_target(
177  'powervr_mesa_devenv_icd',
178  input : [vk_icd_gen, vk_api_xml],
179  output : 'powervr_mesa_devenv_icd.@0@.json'.format(host_machine.cpu()),
180  command : [
181    prog_python, '@INPUT0@',
182    '--api-version', '1.0', '--xml', '@INPUT1@',
183    '--lib-path', meson.current_build_dir() / 'libvulkan_powervr_mesa.so',
184    '--out', '@OUTPUT@',
185  ],
186  build_by_default : true,
187)
188
189devenv.append('VK_ICD_FILENAMES', _dev_icd.full_path())
190