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') 23 24pixel_format_versions = ['6', '7', '9'] 25libpanfrost_pixel_format = [] 26 27foreach ver : pixel_format_versions 28 libpanfrost_pixel_format += static_library( 29 'pan-format-v' + ver, 30 ['pan_format.c', pan_packers], 31 include_directories : [ 32 inc_src, inc_include, inc_gallium, inc_mesa, inc_panfrost_hw, inc_gallium_aux, inc_panfrost_hw 33 ], 34 c_args : ['-DPAN_ARCH=' + ver], 35 gnu_symbol_visibility : 'hidden', 36 dependencies : [idep_pan_packers, dep_libdrm], 37) 38endforeach 39 40libpanfrost_per_arch = [] 41 42foreach ver : ['4', '5', '6', '7', '9'] 43 libpanfrost_per_arch += static_library( 44 'pan-arch-v' + ver, 45 [ 46 'pan_blend.c', 47 'pan_blitter.c', 48 'pan_cs.c', 49 'pan_shader.c', 50 'pan_texture.c', 51 ], 52 include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_panfrost_hw], 53 c_args : ['-DPAN_ARCH=' + ver], 54 gnu_symbol_visibility : 'hidden', 55 dependencies : [dep_libdrm, idep_pan_packers, idep_nir], 56 ) 57endforeach 58 59foreach ver : ['7'] 60 libpanfrost_per_arch += static_library( 61 'pan-arch-indirect-v' + ver, 62 [ 63 'pan_indirect_dispatch.c', 64 'pan_indirect_draw.c', 65 ], 66 include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_panfrost_hw], 67 c_args : ['-DPAN_ARCH=' + ver], 68 gnu_symbol_visibility : 'hidden', 69 dependencies : [dep_libdrm, idep_pan_packers, idep_nir], 70 ) 71endforeach 72 73libpanfrost_lib_files = files( 74 'pan_encoder.h', 75 76 'pan_afbc.c', 77 'pan_attributes.c', 78 'pan_bo.c', 79 'pan_blend.c', 80 'pan_clear.c', 81 'pan_earlyzs.c', 82 'pan_samples.c', 83 'pan_tiler.c', 84 'pan_layout.c', 85 'pan_scratch.c', 86 'pan_props.c', 87 'pan_util.c', 88) 89 90libpanfrost_lib = static_library( 91 'panfrost_lib', 92 [libpanfrost_lib_files, pan_packers], 93 include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_panfrost_hw], 94 c_args : [no_override_init_args], 95 gnu_symbol_visibility : 'hidden', 96 dependencies: [dep_libdrm, idep_nir], 97 build_by_default : false, 98 link_with: [libpanfrost_pixel_format, libpanfrost_per_arch], 99) 100 101libpanfrost_dep = declare_dependency( 102 link_with: [libpanfrost_lib, libpanfrost_decode, libpanfrost_midgard, libpanfrost_bifrost, libpanfrost_pixel_format, libpanfrost_per_arch], 103 include_directories: [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_panfrost_hw, inc_panfrost], 104 dependencies: [dep_libdrm, idep_nir, idep_pan_packers], 105) 106 107if with_tests 108 test( 109 'panfrost_blend', 110 executable( 111 'panfrost_blend_test', 112 files('tests/test-blend.c'), 113 c_args : [c_msvc_compat_args, no_override_init_args], 114 gnu_symbol_visibility : 'hidden', 115 include_directories : [inc_include, inc_src, inc_mesa], 116 dependencies: [libpanfrost_dep], 117 ), 118 suite : ['panfrost'], 119 ) 120 121 test( 122 'panfrost_clear', 123 executable( 124 'panfrost_clear_test', 125 files('tests/test-clear.c'), 126 c_args : [c_msvc_compat_args, no_override_init_args], 127 gnu_symbol_visibility : 'hidden', 128 include_directories : [inc_include, inc_src, inc_mesa], 129 dependencies: [libpanfrost_dep], 130 ), 131 suite : ['panfrost'], 132 ) 133 134 test( 135 'panfrost_tests', 136 executable( 137 'panfrost_tests', 138 files( 139 'tests/test-earlyzs.cpp', 140 'tests/test-layout.cpp', 141 ), 142 c_args : [c_msvc_compat_args, no_override_init_args], 143 gnu_symbol_visibility : 'hidden', 144 include_directories : [inc_include, inc_src, inc_mesa, inc_panfrost, inc_gallium], 145 dependencies: [idep_gtest, libpanfrost_dep], 146 ), 147 suite : ['panfrost'], 148 protocol : gtest_test_protocol, 149 ) 150endif 151