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 ], 32 depend_files : vk_entrypoints_gen_depend_files, 33) 34 35pvr_files = files( 36 'winsys/powervr/pvr_drm.c', 37 'winsys/pvr_winsys.c', 38 'winsys/pvr_winsys_helper.c', 39 'pvr_blit.c', 40 'pvr_bo.c', 41 'pvr_cmd_buffer.c', 42 'pvr_csb.c', 43 'pvr_descriptor_set.c', 44 'pvr_device.c', 45 'pvr_formats.c', 46 'pvr_hardcode.c', 47 'pvr_hw_pass.c', 48 'pvr_image.c', 49 'pvr_job_common.c', 50 'pvr_job_compute.c', 51 'pvr_job_context.c', 52 'pvr_job_render.c', 53 'pvr_job_transfer.c', 54 'pvr_pass.c', 55 'pvr_pipeline.c', 56 'pvr_pipeline_cache.c', 57 'pvr_query.c', 58 'pvr_queue.c', 59 'pvr_shader.c', 60 'pvr_tex_state.c', 61 'pvr_wsi.c', 62) 63 64pvr_includes = [ 65 include_directories('usc/programs'), 66 include_directories('winsys'), 67 libpowervr_pds_includes, 68] 69 70pvr_deps = [ 71 dep_csbgen, 72 dep_libdrm, 73 dep_valgrind, 74 idep_vulkan_runtime, 75 idep_vulkan_util, 76 idep_vulkan_wsi, 77] 78 79pvr_flags = [ 80 no_override_init_args, 81] 82 83if with_imagination_srv 84 pvr_files += files( 85 'winsys/pvrsrvkm/pvr_srv.c', 86 'winsys/pvrsrvkm/pvr_srv_bo.c', 87 'winsys/pvrsrvkm/pvr_srv_bridge.c', 88 'winsys/pvrsrvkm/pvr_srv_job_common.c', 89 'winsys/pvrsrvkm/pvr_srv_job_compute.c', 90 'winsys/pvrsrvkm/pvr_srv_job_null.c', 91 'winsys/pvrsrvkm/pvr_srv_job_render.c', 92 'winsys/pvrsrvkm/pvr_srv_job_transfer.c', 93 'winsys/pvrsrvkm/pvr_srv_sync.c', 94 ) 95 pvr_flags += '-DPVR_SUPPORT_SERVICES_DRIVER' 96endif 97 98libvulkan_powervr_mesa = shared_library( 99 'vulkan_powervr_mesa', 100 [pvr_files, pvr_entrypoints], 101 include_directories : [ 102 pvr_includes, 103 inc_gallium_aux, 104 inc_imagination, 105 inc_include, 106 inc_src, 107 inc_mesa, 108 inc_gallium, 109 inc_compiler, 110 ], 111 link_with : [ 112 libpowervr_common, 113 libpowervr_pds, 114 libpowervr_rogue, 115 libvulkan_wsi, 116 ], 117 dependencies : [ 118 pvr_deps, 119 idep_nir, 120 ], 121 c_args : pvr_flags, 122 link_args : [ 123 ld_args_build_id, 124 ld_args_bsymbolic, 125 ld_args_gc_sections 126 ], 127 gnu_symbol_visibility : 'hidden', 128 install : true, 129) 130 131if with_symbols_check 132 test( 133 'pvr symbols check', 134 symbols_check, 135 args : [ 136 '--lib', libvulkan_powervr_mesa, 137 '--symbols-file', vulkan_icd_symbols, 138 symbols_check_args, 139 ], 140 suite : ['imagination'], 141 ) 142endif 143 144powervr_mesa_icd = custom_target( 145 'powervr_mesa_icd', 146 input : [vk_icd_gen, vk_api_xml], 147 output : 'powervr_mesa_icd.@0@.json'.format(host_machine.cpu()), 148 command : [ 149 prog_python, '@INPUT0@', 150 '--api-version', '1.0', '--xml', '@INPUT1@', 151 '--lib-path', join_paths(get_option('prefix'), get_option('libdir'), 152 'libvulkan_powervr_mesa.so'), 153 '--out', '@OUTPUT@', 154 ], 155 build_by_default : true, 156 install_dir : with_vulkan_icd_dir, 157 install : true, 158) 159 160if meson.version().version_compare('>= 0.58') 161 _dev_icdname = 'powervr_mesa_devenv_icd.@0@.json'.format(host_machine.cpu()) 162 custom_target( 163 'powervr_mesa_devenv_icd', 164 input : [vk_icd_gen, vk_api_xml], 165 output : _dev_icdname, 166 command : [ 167 prog_python, '@INPUT0@', 168 '--api-version', '1.0', '--xml', '@INPUT1@', 169 '--lib-path', meson.current_build_dir() / 'libvulkan_powervr_mesa.so', 170 '--out', '@OUTPUT@', 171 ], 172 build_by_default : true, 173 ) 174 175 devenv.append('VK_ICD_FILENAMES', meson.current_build_dir() / _dev_icdname) 176endif 177