1# Copyright © 2017 Dylan Baker 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 21si_tracepoints = custom_target( 22 'si_tracepoints.[ch]', 23 input: 'si_tracepoints.py', 24 output: ['si_tracepoints.c', 'si_tracepoints_perfetto.h', 'si_tracepoints.h'], 25 command: [ 26 prog_python, '@INPUT@', 27 '-p', join_paths(dir_source_root, 'src/util/perf/'), 28 '-C', '@OUTPUT0@', 29 '--perfetto-hdr', '@OUTPUT1@', 30 '-H', '@OUTPUT2@' 31 ], 32 depend_files: u_trace_py, 33) 34 35idep_si_tracepoints = declare_dependency( 36 sources: si_tracepoints, 37) 38 39files_libradeonsi = files( 40 'driinfo_radeonsi.h', 41 'gfx10_shader_ngg.c', 42 'gfx11_query.c', 43 'si_blit.c', 44 'si_buffer.c', 45 'si_build_pm4.h', 46 'si_clear.c', 47 'si_compute.c', 48 'si_compute_blit.c', 49 'si_cp_dma.c', 50 'si_cp_reg_shadowing.c', 51 'si_debug.c', 52 'si_descriptors.c', 53 'si_fence.c', 54 'si_get.c', 55 'si_gfx_cs.c', 56 'si_gpu_load.c', 57 'si_perfcounter.c', 58 'si_pipe.c', 59 'si_pipe.h', 60 'si_pm4.c', 61 'si_pm4.h', 62 'si_public.h', 63 'si_query.c', 64 'si_query.h', 65 'si_nir_lower_abi.c', 66 'si_nir_lower_resource.c', 67 'si_nir_lower_vs_inputs.c', 68 'si_nir_optim.c', 69 'si_sdma_copy_image.c', 70 'si_shader.c', 71 'si_shader.h', 72 'si_shader_aco.c', 73 'si_shader_info.c', 74 'si_shader_internal.h', 75 'si_shader_nir.c', 76 'si_shaderlib_nir.c', 77 'si_sqtt.c', 78 'si_state.c', 79 'si_state.h', 80 'si_state_binning.c', 81 'si_state_msaa.c', 82 'si_state_shaders.cpp', 83 'si_state_streamout.c', 84 'si_state_viewport.c', 85 'si_test_image_copy_region.c', 86 'si_test_dma_perf.c', 87 'si_texture.c', 88 'si_utrace.c', 89 'si_utrace.h', 90 'si_uvd.c', 91 'si_vpe.c', 92 'si_vpe.h', 93 'pspdecryptionparam.h', 94 'radeon_temporal.h', 95 'radeon_uvd.c', 96 'radeon_uvd.h', 97 'radeon_uvd_enc.c', 98 'radeon_uvd_enc.h', 99 'radeon_uvd_enc_1_1.c', 100 'radeon_vce.c', 101 'radeon_vce.h', 102 'radeon_vce_40_2_2.c', 103 'radeon_vce_50.c', 104 'radeon_vce_52.c', 105 'radeon_vcn.h', 106 'radeon_vcn.c', 107 'radeon_vcn_dec.c', 108 'radeon_vcn_dec.h', 109 'radeon_vcn_dec_jpeg.c', 110 'radeon_vcn_enc.c', 111 'radeon_vcn_enc.h', 112 'radeon_vcn_enc_1_2.c', 113 'radeon_vcn_enc_2_0.c', 114 'radeon_vcn_enc_3_0.c', 115 'radeon_vcn_enc_4_0.c', 116 'radeon_video.c', 117 'radeon_video.h', 118) 119 120radeonsi_include_dirs = [inc_src, inc_include, inc_gallium, inc_gallium_aux, inc_amd_common, 121 inc_amd_common_llvm, inc_gallium_drivers, inc_compiler, inc_amd, inc_amd_vpe] 122radeonsi_deps = [dep_llvm, dep_clock, dep_libdrm_radeon, idep_nir_headers, idep_amdgfxregs_h, idep_mesautil, idep_aco, idep_u_tracepoints, idep_si_tracepoints] 123 124if with_perfetto 125 radeonsi_deps += dep_perfetto 126endif 127 128files_libradeonsi += ['si_perfetto.cpp', 'si_perfetto.h'] 129 130amd_common_libs = [libamd_common] 131 132if with_llvm 133 files_libradeonsi += files( 134 'si_shader_llvm.c', 135 'si_shader_llvm.h', 136 'si_shader_llvm_gs.c', 137 'si_shader_llvm_ps.c', 138 'si_shader_llvm_tess.c', 139 ) 140 141 radeonsi_include_dirs += [inc_amd_common_llvm] 142 radeonsi_deps += [dep_llvm] 143 amd_common_libs += [libamd_common_llvm] 144endif 145 146radeonsi_gfx_libs = [] 147foreach ver : ['6', '7', '8', '9', '10', '103', '11', '115'] 148 radeonsi_gfx_libs += static_library( 149 'radeonsi_gfx@0@'.format(ver), 150 ['si_state_draw.cpp'], 151 include_directories : radeonsi_include_dirs, 152 cpp_args : ['-DGFX_VER=@0@'.format(ver)], 153 gnu_symbol_visibility : 'hidden', 154 dependencies : radeonsi_deps, 155 ) 156endforeach 157 158libradeonsi = static_library( 159 'radeonsi', 160 [files_libradeonsi, sid_tables_h], 161 include_directories : radeonsi_include_dirs, 162 gnu_symbol_visibility : 'hidden', 163 dependencies : radeonsi_deps, 164) 165 166driver_radeonsi = declare_dependency( 167 compile_args : '-DGALLIUM_RADEONSI', 168 link_with : radeonsi_gfx_libs + [ 169 libradeonsi, libradeonwinsys, libamdgpuwinsys, libamd_common, libamd_common_llvm, libgalliumvl, libvpe 170 ], 171 dependencies : idep_nir, 172) 173