19f464c52Smaya# Copyright © 2017 Intel Corporation
29f464c52Smaya# Copyright © 2018 Alyssa Rosenzweig
39f464c52Smaya
49f464c52Smaya# Permission is hereby granted, free of charge, to any person obtaining a copy
59f464c52Smaya# of this software and associated documentation files (the "Software"), to deal
69f464c52Smaya# in the Software without restriction, including without limitation the rights
79f464c52Smaya# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
89f464c52Smaya# copies of the Software, and to permit persons to whom the Software is
99f464c52Smaya# furnished to do so, subject to the following conditions:
109f464c52Smaya
119f464c52Smaya# The above copyright notice and this permission notice shall be included in
129f464c52Smaya# all copies or substantial portions of the Software.
139f464c52Smaya
149f464c52Smaya# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
159f464c52Smaya# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
169f464c52Smaya# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
179f464c52Smaya# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
189f464c52Smaya# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
199f464c52Smaya# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
209f464c52Smaya# SOFTWARE.
219f464c52Smaya
229f464c52Smayafiles_panfrost = files(
237ec681f3Smrg  'pan_helpers.c',
249f464c52Smaya  'pan_public.h',
259f464c52Smaya  'pan_screen.c',
269f464c52Smaya  'pan_screen.h',
279f464c52Smaya  'pan_resource.c',
289f464c52Smaya  'pan_resource.h',
299f464c52Smaya  'pan_context.c',
307ec681f3Smrg  'pan_blit.c',
319f464c52Smaya  'pan_job.c',
329f464c52Smaya  'pan_assemble.c',
337ec681f3Smrg  'pan_compute.c',
347ec681f3Smrg  'pan_mempool.c',
357ec681f3Smrg  'pan_mempool.h',
369f464c52Smaya)
379f464c52Smaya
387ec681f3Smrgpanfrost_includes = [
397ec681f3Smrg  inc_mapi,
407ec681f3Smrg  inc_mesa,
419f464c52Smaya  inc_gallium,
429f464c52Smaya  inc_gallium_aux,
439f464c52Smaya  inc_include,
449f464c52Smaya  inc_src,
457ec681f3Smrg  inc_panfrost,
469f464c52Smaya]
479f464c52Smaya
489f464c52Smayacompile_args_panfrost = [
499f464c52Smaya  '-DGALLIUM_PANFROST',
509f464c52Smaya  '-Wno-pointer-arith'
519f464c52Smaya]
529f464c52Smaya
537ec681f3Smrgpanfrost_versions = ['4', '5', '6', '7']
547ec681f3Smrglibpanfrost_versions = []
557ec681f3Smrg
567ec681f3Smrgforeach ver : panfrost_versions
577ec681f3Smrg  libpanfrost_versions += static_library(
587ec681f3Smrg    'panfrost-v' + ver,
597ec681f3Smrg    ['pan_cmdstream.c', pan_packers],
607ec681f3Smrg    include_directories : panfrost_includes,
617ec681f3Smrg    c_args : ['-DPAN_ARCH=' + ver],
627ec681f3Smrg    gnu_symbol_visibility : 'hidden',
637ec681f3Smrg    dependencies : [idep_pan_packers, idep_nir, dep_libdrm],
649f464c52Smaya)
657ec681f3Smrgendforeach
669f464c52Smaya
679f464c52Smayalibpanfrost = static_library(
689f464c52Smaya  'panfrost',
697ec681f3Smrg  files_panfrost,
709f464c52Smaya  dependencies: [
719f464c52Smaya    dep_thread,
729f464c52Smaya    dep_libdrm,
737ec681f3Smrg    idep_mesautil,
747ec681f3Smrg    idep_nir,
757ec681f3Smrg    idep_pan_packers
769f464c52Smaya  ],
777ec681f3Smrg  include_directories : panfrost_includes,
787ec681f3Smrg  c_args : [c_msvc_compat_args, compile_args_panfrost],
797ec681f3Smrg  gnu_symbol_visibility : 'hidden',
807ec681f3Smrg  link_with: [libpanfrost_versions],
819f464c52Smaya)
829f464c52Smaya
839f464c52Smayadriver_panfrost = declare_dependency(
849f464c52Smaya  compile_args : compile_args_panfrost,
857ec681f3Smrg  link_with : [libpanfrost, libpanfrostwinsys, libpanfrost_shared, libpanfrost_midgard, libpanfrost_bifrost, libpanfrost_decode, libpanfrost_lib],
869f464c52Smaya)
87