util: share the DOCTYPE for all driconf files

We can just pass it to xmllint.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41731>
This commit is contained in:
Samuel Pitoiset 2026-05-21 15:44:53 +02:00 committed by Marge Bot
parent d3f9543f2a
commit a33f1dfd2c
4 changed files with 26 additions and 53 deletions

View file

@ -1,4 +1,4 @@
<?xml version="1.0" standalone="yes"?>
<?xml version="1.0"?>
<!--
============================================
@ -28,31 +28,6 @@ TODO: document the other workarounds.
-->
<!DOCTYPE driconf [
<!ELEMENT driconf (device+)>
<!ELEMENT device (application | engine)+>
<!ATTLIST device driver CDATA #IMPLIED
device CDATA #IMPLIED>
<!ELEMENT application (option+)>
<!ATTLIST application name CDATA #REQUIRED
executable CDATA #IMPLIED
executable_regexp CDATA #IMPLIED
sha1 CDATA #IMPLIED
application_name_match CDATA #IMPLIED
application_versions CDATA #IMPLIED>
<!ELEMENT engine (option+)>
<!-- engine_name_match: A regexp matching the engine name -->
<!-- engine_versions: A version in range format
(version 1 to 4 : "1:4") -->
<!ATTLIST engine engine_name_match CDATA #REQUIRED
engine_versions CDATA #IMPLIED>
<!ELEMENT option EMPTY>
<!ATTLIST option name CDATA #REQUIRED
value CDATA #REQUIRED>
]>
<driconf>
<!-- Please always enable app-specific workarounds for all drivers and

View file

@ -1,4 +1,4 @@
<?xml version="1.0" standalone="yes"?>
<?xml version="1.0"?>
<!--
============================================
@ -7,31 +7,6 @@ Application bugs worked around in this file:
-->
<!DOCTYPE driconf [
<!ELEMENT driconf (device+)>
<!ELEMENT device (application | engine)+>
<!ATTLIST device driver CDATA #IMPLIED
device CDATA #IMPLIED>
<!ELEMENT application (option+)>
<!ATTLIST application name CDATA #REQUIRED
executable CDATA #IMPLIED
executable_regexp CDATA #IMPLIED
sha1 CDATA #IMPLIED
application_name_match CDATA #IMPLIED
application_versions CDATA #IMPLIED>
<!ELEMENT engine (option+)>
<!-- engine_name_match: A regexp matching the engine name -->
<!-- engine_versions: A version in range format
(version 1 to 4 : "1:4") -->
<!ATTLIST engine engine_name_match CDATA #REQUIRED
engine_versions CDATA #IMPLIED>
<!ELEMENT option EMPTY>
<!ATTLIST option name CDATA #REQUIRED
value CDATA #REQUIRED>
]>
<!-- NOTE: `executable` shouldn't be used for shader based drirc workarounds
because they aren't applied when replaying with Fossilize for precompilation. -->

23
src/util/driconf.dtd Normal file
View file

@ -0,0 +1,23 @@
<!ELEMENT driconf (device+)>
<!ELEMENT device (application | engine)+>
<!ATTLIST device driver CDATA #IMPLIED
device CDATA #IMPLIED>
<!ELEMENT application (option+)>
<!ATTLIST application name CDATA #REQUIRED
executable CDATA #IMPLIED
executable_regexp CDATA #IMPLIED
sha1 CDATA #IMPLIED
application_name_match CDATA #IMPLIED
application_versions CDATA #IMPLIED>
<!ELEMENT engine (option+)>
<!-- engine_name_match: A regexp matching the engine name -->
<!-- engine_versions: A version in range format
(version 1 to 4 : "1:4") -->
<!ATTLIST engine engine_name_match CDATA #REQUIRED
engine_versions CDATA #IMPLIED>
<!ELEMENT option EMPTY>
<!ATTLIST option name CDATA #REQUIRED
value CDATA #REQUIRED>

View file

@ -225,7 +225,7 @@ if with_tests
test(
'drirc xml validation',
prog_xmllint,
args : ['--noout', '--valid', files_drirc],
args : ['--noout', '--dtdvalid', files('driconf.dtd'), files_drirc],
suite : ['util'],
)
endif