| 1 |
# Copyright © 2018 Rob Clark |
| 2 |
# Copyright © 2019 Collabora |
| 3 |
# SPDX-License-Identifier: MIT |
| 4 |
|
| 5 |
subdir('kmod') |
| 6 |
|
| 7 |
pixel_format_versions = ['5', '6', '7', '9', '10', '12', '13'] |
| 8 |
libpanfrost_pixel_format = [] |
| 9 |
|
| 10 |
deps_for_libpanfrost = [dep_libdrm, idep_pan_packers, idep_mesautil, libpanfrost_model_dep] |
| 11 |
|
| 12 |
foreach ver : pixel_format_versions |
| 13 |
libpanfrost_pixel_format += static_library( |
| 14 |
'pan-format-v' + ver, |
| 15 |
['pan_format.c', pan_packers], |
| 16 |
include_directories : [inc_src, inc_include, inc_panfrost], |
| 17 |
c_args : ['-DPAN_ARCH=' + ver], |
| 18 |
gnu_symbol_visibility : 'hidden', |
| 19 |
dependencies : [deps_for_libpanfrost, dep_valgrind], |
| 20 |
) |
| 21 |
endforeach |
| 22 |
|
| 23 |
libpanfrost_per_arch = [] |
| 24 |
|
| 25 |
foreach ver : ['4', '5', '6', '7', '9', '10', '12', '13'] |
| 26 |
libpanfrost_per_arch += static_library( |
| 27 |
'pan-arch-v' + ver, |
| 28 |
[ |
| 29 |
'pan_blend.c', |
| 30 |
'pan_buffer.c', |
| 31 |
'pan_desc.c', |
| 32 |
'pan_fb.c', |
| 33 |
'pan_fb_nir.c', |
| 34 |
'pan_mod.c', |
| 35 |
'pan_texture.c', |
| 36 |
], |
| 37 |
include_directories : [inc_include, inc_src, inc_panfrost], |
| 38 |
c_args : ['-DPAN_ARCH=' + ver], |
| 39 |
gnu_symbol_visibility : 'hidden', |
| 40 |
dependencies : [deps_for_libpanfrost, idep_nir], |
| 41 |
) |
| 42 |
endforeach |
| 43 |
|
| 44 |
libpanfrost_lib_files = files( |
| 45 |
'pan_encoder.h', |
| 46 |
|
| 47 |
'pan_blend.c', |
| 48 |
'pan_clear.c', |
| 49 |
'pan_earlyzs.c', |
| 50 |
'pan_samples.c', |
| 51 |
'pan_tiler.c', |
| 52 |
'pan_layout.c', |
| 53 |
'pan_scratch.c', |
| 54 |
'pan_trace.c', |
| 55 |
'pan_props.c', |
| 56 |
'pan_util.c', |
| 57 |
'pan_afbc.c', |
| 58 |
) |
| 59 |
|
| 60 |
libpanfrost_lib = static_library( |
| 61 |
'panfrost_lib', |
| 62 |
[libpanfrost_lib_files, pan_packers], |
| 63 |
include_directories : [inc_include, inc_src, inc_panfrost], |
| 64 |
c_args : [no_override_init_args], |
| 65 |
gnu_symbol_visibility : 'hidden', |
| 66 |
dependencies: [dep_libdrm, idep_nir, idep_mesautil, libpanfrost_model_dep], |
| 67 |
build_by_default : false, |
| 68 |
link_with: [libpanfrost_pixel_format, libpanfrost_per_arch, libpankmod_lib], |
| 69 |
) |
| 70 |
|
| 71 |
libpanfrost_dep = declare_dependency( |
| 72 |
link_with: [libpanfrost_lib, libpanfrost_decode, libpanfrost_compiler, libpanfrost_pixel_format, libpanfrost_per_arch], |
| 73 |
include_directories: [inc_include, inc_src, inc_panfrost], |
| 74 |
dependencies: [deps_for_libpanfrost, libpankmod_dep, idep_nir], |
| 75 |
) |
| 76 |
|
| 77 |
if with_tests |
| 78 |
test( |
| 79 |
'panfrost_attribute', |
| 80 |
executable( |
| 81 |
'panfrost_attribute_test', |
| 82 |
files('tests/test-attribute.c'), |
| 83 |
c_args : [c_msvc_compat_args, no_override_init_args], |
| 84 |
gnu_symbol_visibility : 'hidden', |
| 85 |
include_directories : [inc_include, inc_src], |
| 86 |
dependencies: [libpanfrost_dep], |
| 87 |
), |
| 88 |
suite : ['panfrost'], |
| 89 |
) |
| 90 |
|
| 91 |
test( |
| 92 |
'panfrost_blend', |
| 93 |
executable( |
| 94 |
'panfrost_blend_test', |
| 95 |
files('tests/test-blend.c'), |
| 96 |
c_args : [c_msvc_compat_args, no_override_init_args], |
| 97 |
gnu_symbol_visibility : 'hidden', |
| 98 |
include_directories : [inc_include, inc_src], |
| 99 |
dependencies: [libpanfrost_dep], |
| 100 |
), |
| 101 |
suite : ['panfrost'], |
| 102 |
) |
| 103 |
|
| 104 |
test( |
| 105 |
'panfrost_clear', |
| 106 |
executable( |
| 107 |
'panfrost_clear_test', |
| 108 |
files('tests/test-clear.c'), |
| 109 |
c_args : [c_msvc_compat_args, no_override_init_args], |
| 110 |
gnu_symbol_visibility : 'hidden', |
| 111 |
include_directories : [inc_include, inc_src], |
| 112 |
dependencies: [libpanfrost_dep], |
| 113 |
), |
| 114 |
suite : ['panfrost'], |
| 115 |
) |
| 116 |
|
| 117 |
test( |
| 118 |
'panfrost_tests', |
| 119 |
executable( |
| 120 |
'panfrost_tests', |
| 121 |
files( |
| 122 |
'tests/test-earlyzs.cpp', |
| 123 |
'tests/test-layout.cpp', |
| 124 |
), |
| 125 |
cpp_args : cpp_msvc_compat_args, |
| 126 |
gnu_symbol_visibility : 'hidden', |
| 127 |
include_directories : [inc_include, inc_src, inc_panfrost], |
| 128 |
dependencies: [idep_gtest, libpanfrost_dep], |
| 129 |
), |
| 130 |
suite : ['panfrost'], |
| 131 |
protocol : 'gtest', |
| 132 |
) |
| 133 |
endif |