| 1 |
# Copyright © 2019 Google, Inc |
| 2 |
# SPDX-License-Identifier: MIT |
| 3 |
|
| 4 |
xml_reg_files = [ |
| 5 |
'a2xx.xml', |
| 6 |
'a3xx.xml', |
| 7 |
'a4xx.xml', |
| 8 |
'a5xx.xml', |
| 9 |
'a6xx.xml', |
| 10 |
'a6xx_enums.xml', |
| 11 |
'a6xx_descriptors.xml', |
| 12 |
'a6xx_perfcntrs.xml', |
| 13 |
'a7xx_enums.xml', |
| 14 |
'a7xx_perfcntrs.xml', |
| 15 |
'a8xx_enums.xml', |
| 16 |
'a8xx_descriptors.xml', |
| 17 |
] |
| 18 |
|
| 19 |
xml_files = xml_reg_files |
| 20 |
xml_files += [ |
| 21 |
'a6xx_gmu.xml', |
| 22 |
'ocmem.xml', |
| 23 |
'adreno_control_regs.xml', |
| 24 |
'adreno_pipe_regs.xml', |
| 25 |
'adreno_common.xml', |
| 26 |
] |
| 27 |
|
| 28 |
freedreno_pm4_xml_header_file = [] |
| 29 |
|
| 30 |
freedreno_pm4_xml_header_file += custom_target( |
| 31 |
'adreno_pm4.xml.h', |
| 32 |
input: [gen_header_py, 'adreno_pm4.xml', freedreno_schema, freedreno_copyright], |
| 33 |
output: 'adreno_pm4.xml.h', |
| 34 |
command: [prog_python, '@INPUT0@', '--rnn', rnn_src_path, '--xml', '@INPUT1@', 'c-defines'], |
| 35 |
capture: true, |
| 36 |
) |
| 37 |
|
| 38 |
freedreno_pm4_xml_header_file += custom_target( |
| 39 |
'adreno-pm4-pack.xml.h', |
| 40 |
input: [gen_header_py, 'adreno_pm4.xml', freedreno_schema, freedreno_copyright], |
| 41 |
output: 'adreno-pm4-pack.xml.h', |
| 42 |
command: [prog_python, '@INPUT0@', '--rnn', rnn_src_path, '--xml', '@INPUT1@', 'c-pack-structs'], |
| 43 |
capture: true, |
| 44 |
) |
| 45 |
freedreno_xml_header_files += freedreno_pm4_xml_header_file |
| 46 |
|
| 47 |
if install_fd_decode_tools |
| 48 |
custom_target( |
| 49 |
'adreno_pm4.xml.gz', |
| 50 |
input: 'adreno_pm4.xml', |
| 51 |
output: 'adreno_pm4.xml.gz', |
| 52 |
command: [prog_gzip, '-kc', '@INPUT@'], |
| 53 |
capture: true, |
| 54 |
install_dir: rnn_install_path + '/adreno', |
| 55 |
install: install_fd_decode_tools, |
| 56 |
build_by_default: install_fd_decode_tools, |
| 57 |
) |
| 58 |
endif |
| 59 |
|
| 60 |
foreach f : xml_files |
| 61 |
_name = f + '.h' |
| 62 |
freedreno_xml_header_files += custom_target( |
| 63 |
_name, |
| 64 |
input: [gen_header_py, f, freedreno_schema, freedreno_copyright], |
| 65 |
output: _name, |
| 66 |
command: [prog_python, '@INPUT0@', '--validate', '--rnn', rnn_src_path, '--xml', '@INPUT1@', 'c-defines'], |
| 67 |
capture: true, |
| 68 |
) |
| 69 |
if install_fd_decode_tools |
| 70 |
_gzname = f + '.gz' |
| 71 |
custom_target( |
| 72 |
_gzname, |
| 73 |
input: f, |
| 74 |
output: _gzname, |
| 75 |
command: [prog_gzip, '-kc', '@INPUT@'], |
| 76 |
capture: true, |
| 77 |
install_dir: rnn_install_path + '/adreno', |
| 78 |
install: install_fd_decode_tools, |
| 79 |
build_by_default: install_fd_decode_tools, |
| 80 |
) |
| 81 |
endif |
| 82 |
endforeach |
| 83 |
|
| 84 |
freedreno_xml_header_files += custom_target( |
| 85 |
'a6xx-pack.xml.h', |
| 86 |
input: [gen_header_py, 'a6xx.xml', freedreno_schema, freedreno_copyright], |
| 87 |
output: 'a6xx-pack.xml.h', |
| 88 |
command: [prog_python, '@INPUT0@', '--rnn', rnn_src_path, '--xml', '@INPUT1@', 'c-pack-structs'], |
| 89 |
capture: true, |
| 90 |
) |
| 91 |
|
| 92 |
freedreno_py_header_files = [] |
| 93 |
|
| 94 |
foreach f : xml_reg_files |
| 95 |
_pyname = f.split('.')[0] + '.py' |
| 96 |
freedreno_py_header_files += custom_target( |
| 97 |
_pyname, |
| 98 |
input: [gen_header_py, f, freedreno_schema, freedreno_copyright], |
| 99 |
output: _pyname, |
| 100 |
command: [prog_python, '@INPUT0@', '--rnn', rnn_src_path, '--xml', '@INPUT1@', 'py-defines'], |
| 101 |
capture: true, |
| 102 |
) |
| 103 |
endforeach |