Skip to content

driconf: Use nesting macros instead of begin/end so much

Emma Anholt requested to merge anholt/mesa:driconf-cleanups into master

Follow-up to !6751 (merged), this MR is just the last two commits. In !6697 (closed), @krh asked if I could make the driver's driconf be an array of structs instead of a string. I agree that that would be cleaner, but to be able to do so we need to have separate macros per option type so that I know where in a driOptionValue union to stick the default value. This introduces those macros, and cleans up the driconf definitions in the process (to my eyes, at least), while nearly eliminating one of the major sources of driconf failures (forgetting your DRI_CONF_OPT_END when copy and pasting).

This won't quite make struct driconf easy -- bools are still wrapped in "s in the driver's definitions rather than inside the macros (because otherwise the true turns into 1 in the strings), so we'll still have to do a bit of parsing at setup time. But it does make it look tractable.

Merge request reports