• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright © 2017 Intel Corporation
2
3# Permission is hereby granted, free of charge, to any person obtaining a copy
4# of this software and associated documentation files (the "Software"), to deal
5# in the Software without restriction, including without limitation the rights
6# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7# copies of the Software, and to permit persons to whom the Software is
8# furnished to do so, subject to the following conditions:
9
10# The above copyright notice and this permission notice shall be included in
11# all copies or substantial portions of the Software.
12
13# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19# SOFTWARE.
20
21# TODO: android?
22
23files_libintel_dev = files(
24  'i915/intel_device_info.c',
25  'i915/intel_device_info.h',
26  'xe/intel_device_info.c',
27  'xe/intel_device_info.h',
28  'intel_debug.c',
29  'intel_debug.h',
30  'intel_device_info.c',
31  'intel_device_info.h',
32  'intel_hwconfig.c',
33  'intel_hwconfig.h',
34  'intel_kmd.c',
35  'intel_kmd.h',
36)
37
38intel_dev_wa_src = custom_target('intel_wa.[ch]',
39                                 input : ['gen_wa_helpers.py', 'mesa_defs.json'],
40                                 output : ['intel_wa.h', 'intel_wa.c'],
41                                 command : [prog_python, '@INPUT@', '@OUTPUT@'])
42
43intel_dev_info_gen_src = custom_target('intel_device_info_gen.h',
44                                       input : 'intel_device_info_gen_h.py',
45                                       depend_files: 'intel_device_info.py',
46                                       output : ['intel_device_info_gen.h'],
47                                       command : [prog_python, '@INPUT@', '@OUTPUT@'])
48
49intel_dev_serialize_src = custom_target('intel_device_info_serialize_gen.c',
50                                        input : 'intel_device_info_serialize_gen_c.py',
51                                        depend_files: 'intel_device_info.py',
52                                        output : ['intel_device_info_serialize_gen.c'],
53                                        command : [prog_python, '@INPUT@', '@OUTPUT@'])
54
55# ensures intel_wa.h exists before implementation files are compiled
56idep_intel_dev_wa = declare_dependency(sources : [intel_dev_wa_src[0]])
57
58idep_intel_dev_info_gen = declare_dependency(sources : [intel_dev_info_gen_src[0]])
59
60libintel_dev = static_library(
61  'intel_dev',
62  [files_libintel_dev, sha1_h, [intel_dev_wa_src]],
63  include_directories : [inc_include, inc_src, inc_intel],
64  dependencies : [dep_libdrm, idep_mesautil, idep_intel_dev_wa,
65                  idep_intel_dev_info_gen],
66  c_args : [no_override_init_args],
67  gnu_symbol_visibility : 'hidden',
68)
69
70idep_intel_dev = declare_dependency(
71  link_with : libintel_dev,
72  dependencies : [idep_intel_dev_wa, idep_intel_dev_info_gen],
73  sources : [intel_dev_info_gen_src, intel_dev_wa_src[0]],
74)
75
76if with_tests
77  test('intel_device_info_test',
78       executable(
79         'intel_device_info_test',
80         'intel_device_info_test.c',
81         include_directories : [inc_include, inc_src, inc_intel],
82         dependencies : idep_intel_dev,
83       ),
84       suite : ['intel'],
85      )
86endif
87
88if with_tests and with_tools.contains('drm-shim') and with_tools.contains('intel')
89  platforms = [ [ 70,  ['ivb', 'byt'] ],
90                [ 75,  ['hsw'] ],
91                [ 80,  ['bdw', 'chv'] ],
92                [ 90,  ['skl', 'kbl', 'aml', 'cml', 'whl', 'bxt', 'glk'] ],
93                [ 110, ['icl', 'ehl', 'jsl'] ],
94                [ 120, ['tgl', 'rkl', 'adl', 'rpl', 'dg1', 'sg1'] ],
95                [ 125, ['dg2'] ],
96              ]
97  intel_devinfo_override_test = executable(
98    'intel_device_info_override_test',
99    'intel_device_info_override_test.c',
100    dependencies : [dep_libdrm, idep_intel_dev],
101    include_directories : [inc_include, inc_src, inc_intel],
102  )
103  intel_drm_ld_preload = join_paths(meson.current_build_dir(), '..', 'tools', 'libintel_noop_drm_shim.so')
104  foreach _gens : platforms
105    gen = _gens[0]
106    foreach p : _gens[1]
107              test('intel_device_info_override_test_@0@'.format(p),
108                   intel_devinfo_override_test,
109                   args : '@0@'.format(gen),
110                   env : [
111                      'LD_PRELOAD=@0@'.format(intel_drm_ld_preload),
112                      'INTEL_STUB_GPU_PLATFORM=@0@'.format(p),
113                      'STRACEDIR=meson-logs/strace/intel_device_info_override_test_@0@'.format(p),
114                   ],
115                   suite : ['intel'],
116                  )
117    endforeach
118  endforeach
119endif
120