1bf215546Sopenharmony_ci# Copyright © 2017 Intel Corporation
2bf215546Sopenharmony_ci# Copyright © 2018 Alyssa Rosenzweig
3bf215546Sopenharmony_ci
4bf215546Sopenharmony_ci# Permission is hereby granted, free of charge, to any person obtaining a copy
5bf215546Sopenharmony_ci# of this software and associated documentation files (the "Software"), to deal
6bf215546Sopenharmony_ci# in the Software without restriction, including without limitation the rights
7bf215546Sopenharmony_ci# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8bf215546Sopenharmony_ci# copies of the Software, and to permit persons to whom the Software is
9bf215546Sopenharmony_ci# furnished to do so, subject to the following conditions:
10bf215546Sopenharmony_ci
11bf215546Sopenharmony_ci# The above copyright notice and this permission notice shall be included in
12bf215546Sopenharmony_ci# all copies or substantial portions of the Software.
13bf215546Sopenharmony_ci
14bf215546Sopenharmony_ci# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15bf215546Sopenharmony_ci# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16bf215546Sopenharmony_ci# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17bf215546Sopenharmony_ci# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18bf215546Sopenharmony_ci# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19bf215546Sopenharmony_ci# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20bf215546Sopenharmony_ci# SOFTWARE.
21bf215546Sopenharmony_ci
22bf215546Sopenharmony_cifiles_panfrost = files(
23bf215546Sopenharmony_ci  'pan_helpers.c',
24bf215546Sopenharmony_ci  'pan_public.h',
25bf215546Sopenharmony_ci  'pan_screen.c',
26bf215546Sopenharmony_ci  'pan_screen.h',
27bf215546Sopenharmony_ci  'pan_resource.c',
28bf215546Sopenharmony_ci  'pan_resource.h',
29bf215546Sopenharmony_ci  'pan_context.c',
30bf215546Sopenharmony_ci  'pan_blit.c',
31bf215546Sopenharmony_ci  'pan_job.c',
32bf215546Sopenharmony_ci  'pan_assemble.c',
33bf215546Sopenharmony_ci  'pan_compute.c',
34bf215546Sopenharmony_ci  'pan_mempool.c',
35bf215546Sopenharmony_ci  'pan_mempool.h',
36bf215546Sopenharmony_ci)
37bf215546Sopenharmony_ci
38bf215546Sopenharmony_cipanfrost_includes = [
39bf215546Sopenharmony_ci  inc_mapi,
40bf215546Sopenharmony_ci  inc_mesa,
41bf215546Sopenharmony_ci  inc_gallium,
42bf215546Sopenharmony_ci  inc_gallium_aux,
43bf215546Sopenharmony_ci  inc_include,
44bf215546Sopenharmony_ci  inc_src,
45bf215546Sopenharmony_ci  inc_panfrost,
46bf215546Sopenharmony_ci]
47bf215546Sopenharmony_ci
48bf215546Sopenharmony_cicompile_args_panfrost = [
49bf215546Sopenharmony_ci  '-DGALLIUM_PANFROST',
50bf215546Sopenharmony_ci  '-Wno-pointer-arith'
51bf215546Sopenharmony_ci]
52bf215546Sopenharmony_ci
53bf215546Sopenharmony_cipanfrost_versions = ['4', '5', '6', '7', '9']
54bf215546Sopenharmony_cilibpanfrost_versions = []
55bf215546Sopenharmony_ci
56bf215546Sopenharmony_ciforeach ver : panfrost_versions
57bf215546Sopenharmony_ci  libpanfrost_versions += static_library(
58bf215546Sopenharmony_ci    'panfrost-v' + ver,
59bf215546Sopenharmony_ci    ['pan_cmdstream.c', pan_packers],
60bf215546Sopenharmony_ci    include_directories : panfrost_includes,
61bf215546Sopenharmony_ci    c_args : ['-DPAN_ARCH=' + ver],
62bf215546Sopenharmony_ci    gnu_symbol_visibility : 'hidden',
63bf215546Sopenharmony_ci    dependencies : [idep_pan_packers, idep_nir, dep_libdrm],
64bf215546Sopenharmony_ci)
65bf215546Sopenharmony_ciendforeach
66bf215546Sopenharmony_ci
67bf215546Sopenharmony_cilibpanfrost = static_library(
68bf215546Sopenharmony_ci  'panfrost',
69bf215546Sopenharmony_ci  files_panfrost,
70bf215546Sopenharmony_ci  dependencies: [
71bf215546Sopenharmony_ci    dep_thread,
72bf215546Sopenharmony_ci    dep_libdrm,
73bf215546Sopenharmony_ci    idep_mesautil,
74bf215546Sopenharmony_ci    idep_nir,
75bf215546Sopenharmony_ci    idep_pan_packers
76bf215546Sopenharmony_ci  ],
77bf215546Sopenharmony_ci  include_directories : panfrost_includes,
78bf215546Sopenharmony_ci  c_args : [c_msvc_compat_args, compile_args_panfrost],
79bf215546Sopenharmony_ci  gnu_symbol_visibility : 'hidden',
80bf215546Sopenharmony_ci  link_with: [libpanfrost_versions],
81bf215546Sopenharmony_ci)
82bf215546Sopenharmony_ci
83bf215546Sopenharmony_cidriver_panfrost = declare_dependency(
84bf215546Sopenharmony_ci  compile_args : compile_args_panfrost,
85bf215546Sopenharmony_ci  link_with : [libpanfrost, libpanfrostwinsys, libpanfrost_shared, libpanfrost_midgard, libpanfrost_bifrost, libpanfrost_decode, libpanfrost_lib],
86bf215546Sopenharmony_ci)
87