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 21gen_xml_files = [ 22 'gen4.xml', 23 'gen45.xml', 24 'gen5.xml', 25 'gen6.xml', 26 'gen7.xml', 27 'gen75.xml', 28 'gen8.xml', 29 'gen9.xml', 30 'gen11.xml', 31 'gen12.xml', 32 'gen125.xml', 33] 34 35gen_pack_header_deps = files('util.py') 36 37genX_xml_h = custom_target( 38 'genX_xml.h', 39 input : ['gen_zipped_file.py', gen_xml_files], 40 output : 'genX_xml.h', 41 command : [prog_python, '@INPUT@'], 42 capture : true, 43) 44 45genX_bits_included_symbols = [ 46 # instructions 47 'MI_BATCH_BUFFER_START::Batch Buffer Start Address', 48 'MI_REPORT_PERF_COUNT::Memory Address', 49 'MI_STORE_DATA_IMM::Address', 50 'MI_STORE_DATA_IMM::Immediate Data', 51 'MI_STORE_REGISTER_MEM::Memory Address', 52 '3DSTATE_DEPTH_BUFFER::Surface Base Address', 53 '3DSTATE_DEPTH_BUFFER::Surface Pitch', 54 '3DSTATE_STENCIL_BUFFER::Surface Base Address', 55 '3DSTATE_STENCIL_BUFFER::Surface Pitch', 56 '3DSTATE_HIER_DEPTH_BUFFER::Surface Base Address', 57 '3DSTATE_HIER_DEPTH_BUFFER::Surface Pitch', 58 '3DSTATE_CLEAR_PARAMS', 59 '3DSTATE_SO_BUFFER::Surface Base Address', 60 '3DSTATE_SO_BUFFER::Stream Offset', 61 '3DSTATE_CPSIZE_CONTROL_BUFFER::Surface Base Address', 62 '3DSTATE_CPSIZE_CONTROL_BUFFER::Surface Pitch', 63 # structures 64 'RENDER_SURFACE_STATE::Surface Base Address', 65 'RENDER_SURFACE_STATE::Surface Pitch', 66 'RENDER_SURFACE_STATE::Auxiliary Surface Base Address', 67 'RENDER_SURFACE_STATE::Auxiliary Surface Pitch', 68 'RENDER_SURFACE_STATE::Clear Value Address', 69 'RENDER_SURFACE_STATE::Red Clear Color', 70 'RENDER_SURFACE_STATE::Green Clear Color', 71 'RENDER_SURFACE_STATE::Blue Clear Color', 72 'RENDER_SURFACE_STATE::Alpha Clear Color', 73 'CLEAR_COLOR', 74 'VERTEX_BUFFER_STATE::Buffer Starting Address', 75 'CPS_STATE', 76] 77 78genX_bits_h = custom_target( 79 'genX_bits.h', 80 input : ['gen_bits_header.py', gen_xml_files], 81 output : 'genX_bits.h', 82 command : [prog_python, '@INPUT@', '-o', '@OUTPUT@', 83 '--include-symbols', ','.join(genX_bits_included_symbols)], 84 depend_files: gen_pack_header_deps 85) 86 87gen_xml_pack = [] 88foreach f : gen_xml_files + ['gen_rt.xml'] 89 _name = '@0@_pack.h'.format(f.split('.')[0]) 90 gen_xml_pack += custom_target( 91 _name, 92 input : ['gen_pack_header.py', f], 93 output : _name, 94 command : [prog_python, '@INPUT@', '--engines=render,blitter,video'], 95 capture : true, 96 depend_files: gen_pack_header_deps 97 ) 98endforeach 99 100gen_pack_header_py = files('gen_pack_header.py') 101 102idep_genxml = declare_dependency(sources : [gen_xml_pack, genX_bits_h, genX_xml_h]) 103