| 1 |
# Copyright © 2022 Imagination Technologies Ltd. |
| 2 |
# SPDX-License-Identifier: MIT |
| 3 |
|
| 4 |
subdir('pds') |
| 5 |
|
| 6 |
pvr_entrypoints = custom_target( |
| 7 |
'pvr_entrypoints', |
| 8 |
input : [vk_entrypoints_gen, vk_api_xml], |
| 9 |
output : ['pvr_entrypoints.h', 'pvr_entrypoints.c'], |
| 10 |
command : [ |
| 11 |
prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--proto', '--weak', |
| 12 |
'--out-h', '@OUTPUT0@', '--out-c', '@OUTPUT1@', '--prefix', 'pvr', |
| 13 |
'--device-prefix', 'pvr_rogue', |
| 14 |
'--beta', with_vulkan_beta.to_string() |
| 15 |
], |
| 16 |
depend_files : vk_entrypoints_gen_depend_files, |
| 17 |
) |
| 18 |
|
| 19 |
pvr_files = files( |
| 20 |
'winsys/powervr/pvr_drm.c', |
| 21 |
'winsys/powervr/pvr_drm_bo.c', |
| 22 |
'winsys/powervr/pvr_drm_job_compute.c', |
| 23 |
'winsys/powervr/pvr_drm_job_null.c', |
| 24 |
'winsys/powervr/pvr_drm_job_render.c', |
| 25 |
'winsys/powervr/pvr_drm_job_transfer.c', |
| 26 |
'winsys/pvr_winsys.c', |
| 27 |
'winsys/pvr_winsys_helper.c', |
| 28 |
'pvr_bo.c', |
| 29 |
'pvr_csb.c', |
| 30 |
'pvr_descriptor_set.c', |
| 31 |
'pvr_device.c', |
| 32 |
'pvr_dump_bo.c', |
| 33 |
'pvr_free_list.c', |
| 34 |
'pvr_formats.c', |
| 35 |
'pvr_image.c', |
| 36 |
'pvr_instance.c', |
| 37 |
'pvr_nir_lower_ycbcr.c', |
| 38 |
'pvr_physical_device.c', |
| 39 |
'pvr_transfer_frag_store.c', |
| 40 |
'pvr_query.c', |
| 41 |
'pvr_robustness.c', |
| 42 |
'pvr_rt_dataset.c', |
| 43 |
'pvr_spm.c', |
| 44 |
'pvr_usc.c', |
| 45 |
'pvr_wsi.c', |
| 46 |
) |
| 47 |
|
| 48 |
pvr_includes = [ |
| 49 |
include_directories('winsys'), |
| 50 |
libpowervr_pds_includes, |
| 51 |
] |
| 52 |
|
| 53 |
pvr_deps = [ |
| 54 |
dep_csbgen, |
| 55 |
dep_libdrm, |
| 56 |
dep_valgrind, |
| 57 |
idep_mesautil, |
| 58 |
idep_pco_uscgen_programs, |
| 59 |
idep_vulkan_runtime, |
| 60 |
idep_vulkan_util, |
| 61 |
idep_vulkan_wsi, |
| 62 |
] |
| 63 |
|
| 64 |
pvr_flags = [ |
| 65 |
imagination_c_args, |
| 66 |
no_override_init_args, |
| 67 |
] |
| 68 |
|
| 69 |
common_per_arch_files = [ |
| 70 |
pvr_entrypoints[0], |
| 71 |
sha1_h, |
| 72 |
] |
| 73 |
|
| 74 |
common_per_arch_files += files( |
| 75 |
'pvr_arch_border.c', |
| 76 |
'pvr_arch_cmd_buffer.c', |
| 77 |
'pvr_arch_cmd_query.c', |
| 78 |
'pvr_arch_csb.c', |
| 79 |
'pvr_arch_descriptor_set.c', |
| 80 |
'pvr_arch_device.c', |
| 81 |
'pvr_arch_formats.c', |
| 82 |
'pvr_arch_framebuffer.c', |
| 83 |
'pvr_arch_hw_pass.c', |
| 84 |
'pvr_arch_pass.c', |
| 85 |
'pvr_arch_pipeline.c', |
| 86 |
'pvr_arch_image.c', |
| 87 |
'pvr_arch_job_common.c', |
| 88 |
'pvr_arch_job_compute.c', |
| 89 |
'pvr_arch_job_context.c', |
| 90 |
'pvr_arch_job_render.c', |
| 91 |
'pvr_arch_job_transfer.c', |
| 92 |
'pvr_arch_mrt.c', |
| 93 |
'pvr_arch_queue.c', |
| 94 |
'pvr_arch_query_compute.c', |
| 95 |
'pvr_arch_sampler.c', |
| 96 |
'pvr_arch_spm.c', |
| 97 |
'pvr_arch_tex_state.c', |
| 98 |
) |
| 99 |
|
| 100 |
if with_imagination_srv |
| 101 |
pvr_files += files( |
| 102 |
'winsys/pvrsrvkm/pvr_srv.c', |
| 103 |
'winsys/pvrsrvkm/pvr_srv_bo.c', |
| 104 |
'winsys/pvrsrvkm/pvr_srv_bridge.c', |
| 105 |
'winsys/pvrsrvkm/pvr_srv_job_common.c', |
| 106 |
'winsys/pvrsrvkm/pvr_srv_job_compute.c', |
| 107 |
'winsys/pvrsrvkm/pvr_srv_job_null.c', |
| 108 |
'winsys/pvrsrvkm/pvr_srv_job_render.c', |
| 109 |
'winsys/pvrsrvkm/pvr_srv_job_transfer.c', |
| 110 |
'winsys/pvrsrvkm/pvr_srv_sync.c', |
| 111 |
'winsys/pvrsrvkm/pvr_srv_sync_prim.c', |
| 112 |
) |
| 113 |
common_per_arch_files += files( |
| 114 |
'winsys/pvrsrvkm/pvr_arch_srv_job_compute.c', |
| 115 |
'winsys/pvrsrvkm/pvr_arch_srv_job_render.c', |
| 116 |
'winsys/pvrsrvkm/pvr_arch_srv_job_transfer.c', |
| 117 |
) |
| 118 |
pvr_flags += '-DPVR_SUPPORT_SERVICES_DRIVER' |
| 119 |
endif |
| 120 |
|
| 121 |
rogue_files = files( |
| 122 |
'rogue/pvr_blit.c', |
| 123 |
'rogue/pvr_clear.c', |
| 124 |
'rogue/pvr_dump_csb.c', |
| 125 |
) |
| 126 |
|
| 127 |
powervr_per_arch_libs = [] |
| 128 |
|
| 129 |
foreach arch : ['rogue'] |
| 130 |
per_arch_files = common_per_arch_files |
| 131 |
|
| 132 |
if arch == 'rogue' |
| 133 |
per_arch_files += rogue_files |
| 134 |
endif |
| 135 |
|
| 136 |
powervr_per_arch_libs += static_library( |
| 137 |
'powervr_@0@'.format(arch), |
| 138 |
per_arch_files, |
| 139 |
include_directories : [ |
| 140 |
pvr_includes, |
| 141 |
inc_imagination, |
| 142 |
inc_include, |
| 143 |
inc_src, |
| 144 |
], |
| 145 |
dependencies : [ |
| 146 |
dep_valgrind, |
| 147 |
idep_nir_headers, |
| 148 |
idep_pco_uscgen_programs_headers, |
| 149 |
idep_vulkan_runtime_headers, |
| 150 |
idep_vulkan_util_headers, |
| 151 |
idep_vulkan_wsi_headers, |
| 152 |
], |
| 153 |
c_args : [pvr_flags, '-DPVR_BUILD_ARCH_@0@'.format(arch.to_upper())], |
| 154 |
gnu_symbol_visibility : 'hidden', |
| 155 |
) |
| 156 |
endforeach |
| 157 |
|
| 158 |
|
| 159 |
libvulkan_powervr_mesa = shared_library( |
| 160 |
'vulkan_powervr_mesa', |
| 161 |
[pvr_files, pvr_entrypoints, u_format_pack_h], |
| 162 |
include_directories : [ |
| 163 |
pvr_includes, |
| 164 |
inc_imagination, |
| 165 |
inc_include, |
| 166 |
inc_src, |
| 167 |
], |
| 168 |
link_whole : [powervr_per_arch_libs], |
| 169 |
link_with : [ |
| 170 |
libpowervr_common, |
| 171 |
libpowervr_compiler, |
| 172 |
libpowervr_pds, |
| 173 |
libpowervr_uscgen, |
| 174 |
libvulkan_wsi, |
| 175 |
], |
| 176 |
dependencies : [ |
| 177 |
pvr_deps, |
| 178 |
idep_nir_headers, |
| 179 |
], |
| 180 |
c_args : pvr_flags, |
| 181 |
link_args : [ |
| 182 |
vulkan_icd_link_args, |
| 183 |
ld_args_build_id, |
| 184 |
ld_args_bsymbolic, |
| 185 |
ld_args_gc_sections |
| 186 |
], |
| 187 |
gnu_symbol_visibility : 'hidden', |
| 188 |
install : true, |
| 189 |
) |
| 190 |
|
| 191 |
if with_symbols_check |
| 192 |
test( |
| 193 |
'pvr symbols check', |
| 194 |
symbols_check, |
| 195 |
args : [ |
| 196 |
'--lib', libvulkan_powervr_mesa, |
| 197 |
'--symbols-file', vulkan_icd_symbols, |
| 198 |
symbols_check_args, |
| 199 |
], |
| 200 |
suite : ['imagination'], |
| 201 |
) |
| 202 |
endif |
| 203 |
|
| 204 |
icd_file_name = libname_prefix + 'vulkan_powervr_mesa.' + libname_suffix |
| 205 |
|
| 206 |
powervr_mesa_icd = custom_target( |
| 207 |
'powervr_mesa_icd', |
| 208 |
input : [vk_icd_gen, vk_api_xml], |
| 209 |
output : 'powervr_mesa_icd.' + vulkan_manifest_suffix, |
| 210 |
command : [ |
| 211 |
prog_python, '@INPUT0@', |
| 212 |
'--api-version', '1.4', '--xml', '@INPUT1@', |
| 213 |
'--sizeof-pointer', sizeof_pointer, |
| 214 |
'--icd-lib-path', vulkan_icd_lib_path, |
| 215 |
'--icd-filename', icd_file_name, |
| 216 |
'--out', '@OUTPUT@', |
| 217 |
], |
| 218 |
build_by_default : true, |
| 219 |
install_dir : with_vulkan_icd_dir, |
| 220 |
install_tag : 'runtime', |
| 221 |
install : true, |
| 222 |
) |
| 223 |
|
| 224 |
_dev_icd = custom_target( |
| 225 |
'powervr_mesa_devenv_icd', |
| 226 |
input : [vk_icd_gen, vk_api_xml], |
| 227 |
output : 'powervr_mesa_devenv_icd.@[email protected]'.format(host_machine.cpu()), |
| 228 |
command : [ |
| 229 |
prog_python, '@INPUT0@', |
| 230 |
'--api-version', '1.4', '--xml', '@INPUT1@', |
| 231 |
'--sizeof-pointer', sizeof_pointer, |
| 232 |
'--icd-lib-path', meson.current_build_dir(), |
| 233 |
'--icd-filename', icd_file_name, |
| 234 |
'--out', '@OUTPUT@', |
| 235 |
], |
| 236 |
build_by_default : true, |
| 237 |
) |
| 238 |
|
| 239 |
devenv.append('VK_DRIVER_FILES', _dev_icd.full_path()) |