1# Copyright © 2018 Rob Clark 2# Copyright © 2019 Collabora 3 4# Permission is hereby granted, free of charge, to any person obtaining a copy 5# of this software and associated documentation files (the "Software"), to deal 6# in the Software without restriction, including without limitation the rights 7# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8# copies of the Software, and to permit persons to whom the Software is 9# furnished to do so, subject to the following conditions: 10 11# The above copyright notice and this permission notice shall be included in 12# all copies or substantial portions of the 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('genxml') 23subdir('kmod') 24 25pixel_format_versions = ['5', '6', '7', '9'] 26libpanfrost_pixel_format = [] 27 28foreach ver : pixel_format_versions 29 libpanfrost_pixel_format += static_library( 30 'pan-format-v' + ver, 31 ['pan_format.c', pan_packers], 32 include_directories : [ 33 inc_src, inc_include, inc_gallium, inc_mesa, inc_panfrost_hw, inc_gallium_aux, inc_panfrost_hw 34 ], 35 c_args : ['-DPAN_ARCH=' + ver], 36 gnu_symbol_visibility : 'hidden', 37 dependencies : [idep_pan_packers, dep_libdrm, dep_valgrind], 38) 39endforeach 40 41libpanfrost_per_arch = [] 42 43foreach ver : ['4', '5', '6', '7', '9'] 44 libpanfrost_per_arch += static_library( 45 'pan-arch-v' + ver, 46 [ 47 'pan_blend.c', 48 'pan_blitter.c', 49 'pan_desc.c', 50 'pan_shader.c', 51 'pan_texture.c', 52 ], 53 include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_panfrost_hw], 54 c_args : ['-DPAN_ARCH=' + ver], 55 gnu_symbol_visibility : 'hidden', 56 dependencies : [dep_libdrm, idep_pan_packers, idep_nir], 57 ) 58endforeach 59 60foreach ver : ['7'] 61 libpanfrost_per_arch += static_library( 62 'pan-arch-indirect-v' + ver, 63 'pan_indirect_dispatch.c', 64 include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_panfrost_hw], 65 c_args : ['-DPAN_ARCH=' + ver], 66 gnu_symbol_visibility : 'hidden', 67 dependencies : [dep_libdrm, idep_pan_packers, idep_nir], 68 ) 69endforeach 70 71libpanfrost_lib_files = files( 72 'pan_encoder.h', 73 74 'pan_afbc.c', 75 'pan_attributes.c', 76 'pan_blend.c', 77 'pan_clear.c', 78 'pan_earlyzs.c', 79 'pan_samples.c', 80 'pan_tiler.c', 81 'pan_layout.c', 82 'pan_scratch.c', 83 'pan_props.c', 84 'pan_util.c', 85) 86 87libpanfrost_lib = static_library( 88 'panfrost_lib', 89 [libpanfrost_lib_files, pan_packers], 90 include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_panfrost_hw], 91 c_args : [no_override_init_args], 92 gnu_symbol_visibility : 'hidden', 93 dependencies: [dep_libdrm, idep_nir, idep_mesautil], 94 build_by_default : false, 95 link_with: [libpanfrost_pixel_format, libpanfrost_per_arch, libpankmod_lib], 96) 97 98libpanfrost_dep = declare_dependency( 99 link_with: [libpanfrost_lib, libpanfrost_decode, libpanfrost_midgard, libpanfrost_bifrost, libpanfrost_pixel_format, libpanfrost_per_arch], 100 include_directories: [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_panfrost_hw, inc_panfrost], 101 dependencies: [dep_libdrm, libpankmod_dep, idep_nir, idep_pan_packers], 102) 103 104if with_tests 105 test( 106 'panfrost_blend', 107 executable( 108 'panfrost_blend_test', 109 files('tests/test-blend.c'), 110 c_args : [c_msvc_compat_args, no_override_init_args], 111 gnu_symbol_visibility : 'hidden', 112 include_directories : [inc_include, inc_src, inc_mesa], 113 dependencies: [libpanfrost_dep], 114 ), 115 suite : ['panfrost'], 116 ) 117 118 test( 119 'panfrost_clear', 120 executable( 121 'panfrost_clear_test', 122 files('tests/test-clear.c'), 123 c_args : [c_msvc_compat_args, no_override_init_args], 124 gnu_symbol_visibility : 'hidden', 125 include_directories : [inc_include, inc_src, inc_mesa], 126 dependencies: [libpanfrost_dep], 127 ), 128 suite : ['panfrost'], 129 ) 130 131 test( 132 'panfrost_tests', 133 executable( 134 'panfrost_tests', 135 files( 136 'tests/test-earlyzs.cpp', 137 'tests/test-layout.cpp', 138 ), 139 c_args : [c_msvc_compat_args, no_override_init_args], 140 gnu_symbol_visibility : 'hidden', 141 include_directories : [inc_include, inc_src, inc_mesa, inc_panfrost, inc_gallium], 142 dependencies: [idep_gtest, libpanfrost_dep], 143 ), 144 suite : ['panfrost'], 145 protocol : 'gtest', 146 ) 147endif 148