1b8e80941Smrg# Copyright © 2017 Broadcom 2b8e80941Smrg# 3b8e80941Smrg# Permission is hereby granted, free of charge, to any person obtaining a copy 4b8e80941Smrg# of this software and associated documentation files (the "Software"), to deal 5b8e80941Smrg# in the Software without restriction, including without limitation the rights 6b8e80941Smrg# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7b8e80941Smrg# copies of the Software, and to permit persons to whom the Software is 8b8e80941Smrg# furnished to do so, subject to the following conditions: 9b8e80941Smrg# 10b8e80941Smrg# The above copyright notice and this permission notice shall be included in 11b8e80941Smrg# all copies or substantial portions of the Software. 12b8e80941Smrg# 13b8e80941Smrg# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14b8e80941Smrg# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15b8e80941Smrg# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16b8e80941Smrg# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17b8e80941Smrg# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18b8e80941Smrg# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19b8e80941Smrg# SOFTWARE. 20b8e80941Smrg 21b8e80941Smrgfiles_libv3d = files( 22b8e80941Smrg 'v3d_blit.c', 23b8e80941Smrg 'v3d_bufmgr.c', 24b8e80941Smrg 'v3d_bufmgr.h', 25b8e80941Smrg 'v3d_cl.c', 26b8e80941Smrg 'v3d_cl.h', 27b8e80941Smrg 'v3d_context.c', 28b8e80941Smrg 'v3d_context.h', 29b8e80941Smrg 'v3d_fence.c', 30b8e80941Smrg 'v3d_formats.c', 31b8e80941Smrg 'v3d_job.c', 32b8e80941Smrg 'v3d_program.c', 33b8e80941Smrg 'v3d_query.c', 34b8e80941Smrg 'v3d_resource.c', 35b8e80941Smrg 'v3d_resource.h', 36b8e80941Smrg 'v3d_screen.c', 37b8e80941Smrg 'v3d_screen.h', 38b8e80941Smrg 'v3d_simulator.c', 39b8e80941Smrg 'v3d_simulator_wrapper.cpp', 40b8e80941Smrg 'v3d_uniforms.c', 41b8e80941Smrg) 42b8e80941Smrg 43b8e80941Smrgfiles_per_version = files( 44b8e80941Smrg 'v3dx_draw.c', 45b8e80941Smrg 'v3dx_emit.c', 46b8e80941Smrg 'v3dx_format_table.c', 47b8e80941Smrg 'v3dx_job.c', 48b8e80941Smrg 'v3dx_rcl.c', 49b8e80941Smrg 'v3dx_simulator.c', 50b8e80941Smrg 'v3dx_state.c', 51b8e80941Smrg) 52b8e80941Smrg 53b8e80941Smrgv3d_args = ['-DV3D_BUILD_NEON'] 54b8e80941Smrg 55b8e80941Smrgdep_v3dv3 = dependency('v3dv3', required: false) 56b8e80941Smrgif dep_v3dv3.found() 57b8e80941Smrg v3d_args += '-DUSE_V3D_SIMULATOR' 58b8e80941Smrgendif 59b8e80941Smrg 60b8e80941Smrgv3d_versions = ['33', '41'] 61b8e80941Smrg 62b8e80941Smrgper_version_libs = [] 63b8e80941Smrgforeach ver : v3d_versions 64b8e80941Smrg per_version_libs += static_library( 65b8e80941Smrg 'v3d-v' + ver, 66b8e80941Smrg [files_per_version, v3d_xml_pack, nir_opcodes_h, nir_builder_opcodes_h], 67b8e80941Smrg include_directories : [ 68b8e80941Smrg inc_src, inc_include, inc_gallium, inc_gallium_aux, inc_broadcom, 69b8e80941Smrg inc_gallium_drivers, 70b8e80941Smrg ], 71b8e80941Smrg c_args : [c_vis_args, v3d_args, '-DV3D_VERSION=' + ver], 72b8e80941Smrg cpp_args : [cpp_vis_args], 73b8e80941Smrg dependencies : [dep_v3dv3, dep_libdrm, dep_valgrind], 74b8e80941Smrg) 75b8e80941Smrg 76b8e80941Smrgendforeach 77b8e80941Smrg 78b8e80941Smrgv3d_neon_c_args = [] 79b8e80941Smrgif host_machine.cpu_family() == 'arm' 80b8e80941Smrg v3d_neon_c_args = '-mfpu=neon' 81b8e80941Smrgendif 82b8e80941Smrg 83b8e80941Smrglibv3d_neon = static_library( 84b8e80941Smrg 'v3d_neon', 85b8e80941Smrg 'v3d_tiling.c', 86b8e80941Smrg include_directories : [ 87b8e80941Smrg inc_src, inc_include, inc_gallium, inc_gallium_aux, inc_broadcom, 88b8e80941Smrg inc_gallium_drivers, 89b8e80941Smrg ], 90b8e80941Smrg c_args : [c_vis_args, v3d_args, v3d_neon_c_args], 91b8e80941Smrg dependencies : [dep_v3dv3, dep_libdrm, dep_valgrind, idep_nir_headers], 92b8e80941Smrg) 93b8e80941Smrg 94b8e80941Smrglibv3d = static_library( 95b8e80941Smrg 'v3d', 96b8e80941Smrg [files_libv3d, v3d_xml_pack], 97b8e80941Smrg include_directories : [ 98b8e80941Smrg inc_src, inc_include, inc_gallium, inc_gallium_aux, inc_broadcom, 99b8e80941Smrg inc_gallium_drivers, 100b8e80941Smrg ], 101b8e80941Smrg c_args : [c_vis_args, v3d_args], 102b8e80941Smrg cpp_args : [cpp_vis_args, v3d_args], 103b8e80941Smrg dependencies : [dep_v3dv3, dep_libdrm, dep_valgrind, idep_nir_headers], 104b8e80941Smrg link_with: [per_version_libs, libv3d_neon], 105b8e80941Smrg) 106b8e80941Smrg 107b8e80941Smrgdriver_v3d = declare_dependency( 108b8e80941Smrg compile_args : '-DGALLIUM_V3D', 109b8e80941Smrg link_with : [libv3d, libv3dwinsys, libbroadcom_cle, libbroadcom_v3d], 110b8e80941Smrg dependencies : idep_nir, 111b8e80941Smrg) 112