mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-25 03:58:19 +02:00
util/drirc_gen: enable validation for a specific driver
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41664>
This commit is contained in:
parent
73382c8126
commit
61267c69db
1 changed files with 14 additions and 5 deletions
|
|
@ -194,15 +194,24 @@ ${driver_prefix}_parse_dri_options(struct ${driver_prefix}_drirc *drirc,
|
|||
}
|
||||
"""
|
||||
|
||||
def drirc_validate(conf_paths, sections):
|
||||
def drirc_validate(conf_paths, sections, driver=None):
|
||||
declared = {opt.name for section in sections for opt in section.options}
|
||||
conf_names = set()
|
||||
for conf_path in conf_paths:
|
||||
tree = ET.parse(conf_path)
|
||||
for option in tree.iter('option'):
|
||||
name = option.get('name')
|
||||
if name:
|
||||
conf_names.add(name)
|
||||
if driver is None:
|
||||
for option in tree.iter('option'):
|
||||
name = option.get('name')
|
||||
if name:
|
||||
conf_names.add(name)
|
||||
else:
|
||||
for device in tree.iter('device'):
|
||||
if device.get('driver') != driver:
|
||||
continue
|
||||
for option in device.iter('option'):
|
||||
name = option.get('name')
|
||||
if name:
|
||||
conf_names.add(name)
|
||||
missing = conf_names - declared
|
||||
if missing:
|
||||
print('ERROR: options used in conf but not declared:', file=sys.stderr)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue