intel/genxml: Support importing, which cuts the overall xml file size almost in half

Merged Jordan Justen requested to merge jljusten/mesa:genxml-import into main

I verified that the generated C pack files are identical after the change. I also verified that INTEL_DEBUG=bat still works.

I would like to use this to start the LNL genxml file as an import of gen125.xml.

The import xml looks like:

  <import name="filename.xml">
    <exclude name="ITEM_FOO" />
  </import>

The way the import works is, if the genxml file doesn't define the item, then it uses the item from the imported genxml. If the genxml does define an item, then that definition completely redefines the item ignoring the imported genxml. If something needs to be excluded during the import, then the syntax shown above can be used.

Included in this MR is src/intel/genxml/genxml_import.py. This script automates working with genxml files and importing. If the --import switch is used then the genxml files will be updated to use imports and optimized to remove duplicate items. If the --flatten switch is used then the genxml files will be flattened to not use imports. The last patch in this MR is the result of running src/intel/genxml/genxml_import.py --import.

Cc: @dbaker, @llandwerlin, @kwg

Edited by Jordan Justen

Merge request reports