• 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  'intel_debug.c',
25  'intel_debug.h',
26  'intel_device_info.c',
27  'intel_device_info.h',
28  'intel_hwconfig.c',
29  'intel_hwconfig.h',
30)
31
32libintel_dev = static_library(
33  'intel_dev',
34  [files_libintel_dev, sha1_h],
35  include_directories : [inc_include, inc_src, inc_intel],
36  dependencies : [dep_libdrm, idep_mesautil],
37  c_args : [no_override_init_args],
38  gnu_symbol_visibility : 'hidden',
39)
40
41if with_tests
42  test('intel_device_info_test',
43       executable(
44         'intel_device_info_test',
45         'intel_device_info_test.c',
46         include_directories : [inc_include, inc_src],
47         link_with : libintel_dev,
48       ),
49       suite : ['intel'],
50      )
51endif
52
53if with_tests and with_tools.contains('drm-shim') and with_tools.contains('intel')
54  platforms = [ [ 70,  ['ivb', 'byt'] ],
55                [ 75,  ['hsw'] ],
56                [ 80,  ['bdw', 'chv'] ],
57                [ 90,  ['skl', 'kbl', 'aml', 'cml', 'whl', 'bxt', 'glk'] ],
58                [ 110, ['icl', 'ehl', 'jsl'] ],
59                [ 120, ['tgl', 'rkl', 'adl', 'rpl', 'dg1', 'sg1'] ],
60                [ 125, ['dg2'] ],
61              ]
62  intel_devinfo_override_test = executable(
63    'intel_device_info_override_test',
64    'intel_device_info_override_test.c',
65    dependencies : [dep_libdrm],
66    include_directories : [inc_include, inc_src],
67    link_with : libintel_dev,
68  )
69  foreach _gens : platforms
70    gen = _gens[0]
71    foreach p : _gens[1]
72              test('intel_device_info_override_test_@0@'.format(p),
73                   intel_devinfo_override_test,
74                   args : '@0@'.format(gen),
75                   env : [ 'LD_PRELOAD=@0@'.format(join_paths(
76                     meson.current_build_dir(), '../tools/libintel_noop_drm_shim.so')),
77                           'INTEL_STUB_GPU_PLATFORM=@0@'.format(p) ],
78                   suite : ['intel'],
79                  )
80    endforeach
81  endforeach
82endif
83
84if with_intel_tools
85  intel_dev_info = executable(
86    'intel_dev_info',
87    files('intel_dev_info.c'),
88    dependencies : [dep_libdrm, dep_dl, dep_thread, dep_m],
89    include_directories : [inc_include, inc_src, inc_intel],
90    link_with : libintel_dev,
91    c_args : [no_override_init_args],
92    gnu_symbol_visibility : 'hidden',
93    install : true
94  )
95endif
96