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'] 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'] 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_indirect_dispatch.c', 50 'pan_indirect_draw.c', 51 'pan_shader.c', 52 'pan_texture.c', 53 ], 54 include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_panfrost_hw], 55 c_args : ['-DPAN_ARCH=' + ver], 56 gnu_symbol_visibility : 'hidden', 57 dependencies : [dep_libdrm, idep_pan_packers, idep_nir], 58 ) 59endforeach 60 61libpanfrost_lib_files = files( 62 'pan_encoder.h', 63 64 'pan_afbc.c', 65 'pan_attributes.c', 66 'pan_bo.c', 67 'pan_blend.c', 68 'pan_clear.c', 69 'pan_samples.c', 70 'pan_tiler.c', 71 'pan_texture.c', 72 'pan_scratch.c', 73 'pan_props.c', 74 'pan_util.c', 75) 76 77libpanfrost_lib = static_library( 78 'panfrost_lib', 79 [libpanfrost_lib_files, pan_packers], 80 include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_panfrost_hw], 81 c_args : [no_override_init_args], 82 gnu_symbol_visibility : 'hidden', 83 dependencies: [dep_libdrm, idep_nir], 84 build_by_default : false, 85 link_with: [libpanfrost_pixel_format, libpanfrost_per_arch], 86) 87 88libpanfrost_dep = declare_dependency( 89 link_with: [libpanfrost_lib, libpanfrost_decode, libpanfrost_midgard, libpanfrost_bifrost, libpanfrost_pixel_format, libpanfrost_per_arch], 90 include_directories: [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_panfrost_hw, inc_panfrost], 91 dependencies: [dep_libdrm, idep_nir, idep_pan_packers], 92) 93 94if with_tests 95 test( 96 'panfrost_blend', 97 executable( 98 'panfrost_blend_test', 99 files('tests/test-blend.c'), 100 c_args : [c_msvc_compat_args, no_override_init_args], 101 gnu_symbol_visibility : 'hidden', 102 include_directories : [inc_include, inc_src, inc_mesa], 103 dependencies: [libpanfrost_dep], 104 ), 105 suite : ['panfrost'], 106 ) 107 108 test( 109 'panfrost_clear', 110 executable( 111 'panfrost_clear_test', 112 files('tests/test-clear.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 ) 120endif 121