1# Copyright © 2017 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 21tu_entrypoints = custom_target( 22 'tu_entrypoints', 23 input : [vk_entrypoints_gen, vk_api_xml], 24 output : ['tu_entrypoints.h', 'tu_entrypoints.c'], 25 command : [ 26 prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--proto', '--weak', 27 '--out-h', '@OUTPUT0@', '--out-c', '@OUTPUT1@', '--prefix', 'tu', 28 ], 29 depend_files : vk_entrypoints_gen_depend_files, 30) 31 32 33libtu_files = files( 34 'tu_clear_blit.c', 35 'tu_cmd_buffer.c', 36 'tu_cs.c', 37 'tu_cs.h', 38 'tu_device.c', 39 'tu_descriptor_set.c', 40 'tu_descriptor_set.h', 41 'tu_formats.c', 42 'tu_image.c', 43 'tu_legacy.c', 44 'tu_nir_lower_multiview.c', 45 'tu_pass.c', 46 'tu_pipeline.c', 47 'tu_pipeline_cache.c', 48 'tu_private.h', 49 'tu_query.c', 50 'tu_shader.c', 51 'tu_util.c', 52 'tu_util.h', 53 'tu_perfetto.h', 54 'vk_format.h', 55) 56 57tu_deps = [] 58tu_flags = [] 59 60tu_wsi = false 61 62if with_platform_x11 63 tu_deps += dep_xcb_dri3 64 tu_wsi = true 65endif 66 67if with_platform_wayland 68 tu_deps += dep_wayland_client 69 tu_wsi = true 70endif 71 72if system_has_kms_drm and not with_platform_android 73 libtu_files += files('tu_wsi_display.c') 74 tu_wsi = true 75endif 76 77if tu_wsi 78 libtu_files += 'tu_wsi.c' 79endif 80 81if with_platform_android 82 libtu_files += files('tu_android.c') 83 tu_deps += [dep_android] 84endif 85 86if with_xlib_lease 87 tu_deps += [dep_xlib_xrandr] 88endif 89 90if with_freedreno_kgsl 91 tu_flags += '-DTU_USE_KGSL' 92 libtu_files += files('tu_kgsl.c') 93else 94 libtu_files += files('tu_drm.c') 95 tu_deps += dep_libdrm 96endif 97 98tu_tracepoints = custom_target( 99 'tu_tracepoints.[ch]', 100 input: 'tu_tracepoints.py', 101 output: ['tu_tracepoints.c', 'tu_tracepoints.h', 'tu_tracepoints_perfetto.h'], 102 command: [ 103 prog_python, '@INPUT@', 104 '-p', join_paths(meson.source_root(), 'src/util/perf/'), 105 '--utrace-src', '@OUTPUT0@', 106 '--utrace-hdr', '@OUTPUT1@', 107 '--perfetto-hdr', '@OUTPUT2@', 108 ], 109 depend_files: u_trace_py, 110) 111 112if with_perfetto 113 libtu_files += ['tu_perfetto.cc', 'tu_perfetto_util.c'] 114 tu_deps += dep_perfetto 115endif 116 117libvulkan_freedreno = shared_library( 118 'vulkan_freedreno', 119 [libtu_files, tu_entrypoints, tu_tracepoints, freedreno_xml_header_files, sha1_h], 120 include_directories : [ 121 inc_include, 122 inc_src, 123 inc_mapi, 124 inc_mesa, 125 inc_gallium, 126 inc_gallium_aux, 127 inc_compiler, 128 inc_freedreno, 129 ], 130 link_with : [ 131 libfreedreno_ir3, 132 libfreedreno_layout, 133 libfreedreno_perfcntrs, 134 ], 135 dependencies : [ 136 idep_libfreedreno_common, 137 dep_dl, 138 dep_elf, 139 dep_m, 140 dep_thread, 141 dep_valgrind, 142 idep_nir, 143 tu_deps, 144 idep_vulkan_util, 145 idep_vulkan_wsi, 146 idep_mesautil, 147 ], 148 c_args : [no_override_init_args, tu_flags], 149 gnu_symbol_visibility : 'hidden', 150 link_args : [ld_args_bsymbolic, ld_args_gc_sections, ld_args_build_id], 151 install : true, 152) 153 154if with_symbols_check 155 test( 156 'tu symbols check', 157 symbols_check, 158 args : [ 159 '--lib', libvulkan_freedreno, 160 '--symbols-file', vulkan_icd_symbols, 161 symbols_check_args, 162 ], 163 suite : ['freedreno'], 164 ) 165endif 166 167freedreno_icd = custom_target( 168 'freedreno_icd', 169 input : [vk_icd_gen, vk_api_xml], 170 output : 'freedreno_icd.@0@.json'.format(host_machine.cpu()), 171 command : [ 172 prog_python, '@INPUT0@', 173 '--api-version', '1.1', '--xml', '@INPUT1@', 174 '--lib-path', join_paths(get_option('prefix'), get_option('libdir'), 175 'libvulkan_freedreno.so'), 176 '--out', '@OUTPUT@', 177 ], 178 build_by_default : true, 179 install_dir : with_vulkan_icd_dir, 180 install : true, 181) 182