util/drirc: remove the driver option in drirc_validate

Each driver use its own drirc file now, so the option is useless.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41881>
This commit is contained in:
Samuel Pitoiset 2026-06-05 11:48:06 +02:00 committed by Marge Bot
parent 957eb2b5f0
commit 47298397dc
3 changed files with 7 additions and 16 deletions

View file

@ -134,7 +134,7 @@ def main():
options = declare_options()
drirc_gen.drirc_validate([args.validate], options, driver="turnip")
drirc_gen.drirc_validate([args.validate], options)
drirc_gen.drirc_generate(args.drirc_src, args.drirc_hdr, "turnip", options)

View file

@ -253,7 +253,7 @@ def main():
options = declare_options(args.android_ver)
drirc_gen.drirc_validate([args.validate], options, driver="anv")
drirc_gen.drirc_validate([args.validate], options)
drirc_gen.drirc_generate(args.drirc_src, args.drirc_hdr, "anv", options)

View file

@ -215,24 +215,15 @@ ${driver_prefix}_parse_dri_options(struct ${driver_prefix}_drirc *drirc,
}
"""
def drirc_validate(conf_paths, sections, driver=None):
def drirc_validate(conf_paths, sections):
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)
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)
for option in tree.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)