1b8e80941Smrg# Copyright © 2017 Intel Corporation 2b8e80941Smrg# Copyright © 2018 Alyssa Rosenzweig 3b8e80941Smrg 4b8e80941Smrg# Permission is hereby granted, free of charge, to any person obtaining a copy 5b8e80941Smrg# of this software and associated documentation files (the "Software"), to deal 6b8e80941Smrg# in the Software without restriction, including without limitation the rights 7b8e80941Smrg# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8b8e80941Smrg# copies of the Software, and to permit persons to whom the Software is 9b8e80941Smrg# furnished to do so, subject to the following conditions: 10b8e80941Smrg 11b8e80941Smrg# The above copyright notice and this permission notice shall be included in 12b8e80941Smrg# all copies or substantial portions of the Software. 13b8e80941Smrg 14b8e80941Smrg# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15b8e80941Smrg# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16b8e80941Smrg# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17b8e80941Smrg# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18b8e80941Smrg# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19b8e80941Smrg# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20b8e80941Smrg# SOFTWARE. 21b8e80941Smrg 22b8e80941Smrgfiles_panfrost = files( 23b8e80941Smrg 'pan_public.h', 24b8e80941Smrg 'pan_screen.c', 25b8e80941Smrg 'pan_screen.h', 26b8e80941Smrg 'pan_resource.c', 27b8e80941Smrg 'pan_resource.h', 28b8e80941Smrg 29b8e80941Smrg 'midgard/midgard_compile.c', 30b8e80941Smrg 'midgard/cppwrap.cpp', 31b8e80941Smrg 'midgard/disassemble.c', 32b8e80941Smrg 33b8e80941Smrg 'bifrost/disassemble.c', 34b8e80941Smrg 35b8e80941Smrg 'pan_context.c', 36b8e80941Smrg 'pan_job.c', 37b8e80941Smrg 'pan_trace.c', 38b8e80941Smrg 'pan_drm.c', 39b8e80941Smrg 'pan_allocate.c', 40b8e80941Smrg 'pan_assemble.c', 41b8e80941Smrg 'pan_format.c', 42b8e80941Smrg 'pan_swizzle.c', 43b8e80941Smrg 'pan_blending.c', 44b8e80941Smrg 'pan_blend_shaders.c', 45b8e80941Smrg 'pan_wallpaper.c', 46b8e80941Smrg 'pan_pretty_print.c', 47b8e80941Smrg 'pan_fragment.c', 48b8e80941Smrg 'pan_sfbd.c', 49b8e80941Smrg 'pan_mfbd.c' 50b8e80941Smrg) 51b8e80941Smrg 52b8e80941Smrginc_panfrost = [ 53b8e80941Smrg inc_common, 54b8e80941Smrg inc_gallium, 55b8e80941Smrg inc_gallium_aux, 56b8e80941Smrg inc_include, 57b8e80941Smrg inc_src, 58b8e80941Smrg include_directories('include'), 59b8e80941Smrg include_directories('midgard'), 60b8e80941Smrg include_directories('bifrost'), 61b8e80941Smrg] 62b8e80941Smrg 63b8e80941Smrgcompile_args_panfrost = [ 64b8e80941Smrg '-DGALLIUM_PANFROST', 65b8e80941Smrg '-Wno-pointer-arith' 66b8e80941Smrg] 67b8e80941Smrg 68b8e80941Smrgmidgard_nir_algebraic_c = custom_target( 69b8e80941Smrg 'midgard_nir_algebraic.c', 70b8e80941Smrg input : 'midgard/midgard_nir_algebraic.py', 71b8e80941Smrg output : 'midgard_nir_algebraic.c', 72b8e80941Smrg command : [ 73b8e80941Smrg prog_python, '@INPUT@', 74b8e80941Smrg '-p', join_paths(meson.source_root(), 'src/compiler/nir/'), 75b8e80941Smrg ], 76b8e80941Smrg capture : true, 77b8e80941Smrg depend_files : nir_algebraic_py, 78b8e80941Smrg) 79b8e80941Smrg 80b8e80941Smrglibpanfrost = static_library( 81b8e80941Smrg 'panfrost', 82b8e80941Smrg [files_panfrost, midgard_nir_algebraic_c], 83b8e80941Smrg dependencies: [ 84b8e80941Smrg dep_thread, 85b8e80941Smrg dep_libdrm, 86b8e80941Smrg idep_nir 87b8e80941Smrg ], 88b8e80941Smrg include_directories : inc_panfrost, 89b8e80941Smrg c_args : [c_vis_args, c_msvc_compat_args, compile_args_panfrost], 90b8e80941Smrg) 91b8e80941Smrg 92b8e80941Smrgdriver_panfrost = declare_dependency( 93b8e80941Smrg compile_args : compile_args_panfrost, 94b8e80941Smrg link_with : [libpanfrost, libpanfrostwinsys], 95b8e80941Smrg) 96b8e80941Smrg 97b8e80941Smrgfiles_midgard = files( 98b8e80941Smrg 'midgard/midgard_compile.c', 99b8e80941Smrg 'midgard/cppwrap.cpp', 100b8e80941Smrg 'midgard/disassemble.c', 101b8e80941Smrg 'midgard/cmdline.c', 102b8e80941Smrg) 103b8e80941Smrg 104b8e80941Smrgfiles_bifrost = files( 105b8e80941Smrg 'bifrost/disassemble.c', 106b8e80941Smrg 'bifrost/cmdline.c', 107b8e80941Smrg) 108b8e80941Smrg 109b8e80941Smrgmidgard_compiler = executable( 110b8e80941Smrg 'midgard_compiler', 111b8e80941Smrg [files_midgard, midgard_nir_algebraic_c], 112b8e80941Smrg include_directories : inc_panfrost, 113b8e80941Smrg dependencies : [ 114b8e80941Smrg dep_thread, 115b8e80941Smrg idep_nir 116b8e80941Smrg ], 117b8e80941Smrg link_with : [ 118b8e80941Smrg libgallium, 119b8e80941Smrg libglsl_standalone, 120b8e80941Smrg libmesa_util 121b8e80941Smrg ], 122b8e80941Smrg build_by_default : true 123b8e80941Smrg) 124b8e80941Smrg 125b8e80941Smrgbifrost_compiler = executable( 126b8e80941Smrg 'bifrost_compiler', 127b8e80941Smrg [files_bifrost], 128b8e80941Smrg include_directories : [ 129b8e80941Smrg inc_common, 130b8e80941Smrg inc_src, 131b8e80941Smrg inc_include, 132b8e80941Smrg inc_gallium, 133b8e80941Smrg inc_gallium_aux, 134b8e80941Smrg include_directories('bifrost') 135b8e80941Smrg ], 136b8e80941Smrg dependencies : [ 137b8e80941Smrg dep_thread, 138b8e80941Smrg idep_nir 139b8e80941Smrg ], 140b8e80941Smrg link_with : [ 141b8e80941Smrg libgallium, 142b8e80941Smrg libglsl_standalone, 143b8e80941Smrg libmesa_util 144b8e80941Smrg ], 145b8e80941Smrg build_by_default : true 146b8e80941Smrg) 147b8e80941Smrg 148b8e80941Smrgfiles_pandecode = files( 149b8e80941Smrg 'pandecode/cmdline.c', 150b8e80941Smrg 'pandecode/decode.c', 151b8e80941Smrg 152b8e80941Smrg 'pan_pretty_print.c', 153b8e80941Smrg 154b8e80941Smrg 'midgard/disassemble.c' 155b8e80941Smrg) 156b8e80941Smrg 157b8e80941Smrgpandecode = executable( 158b8e80941Smrg 'pandecode', 159b8e80941Smrg files_pandecode, 160b8e80941Smrg include_directories : inc_panfrost, 161b8e80941Smrg dependencies : [ 162b8e80941Smrg dep_thread, 163b8e80941Smrg ], 164b8e80941Smrg link_with : [ 165b8e80941Smrg libmesa_util 166b8e80941Smrg ], 167b8e80941Smrg build_by_default : true 168b8e80941Smrg) 169