From f81d4b76492497ee2beb2c360df849bd7a292294 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Tue, 9 Aug 2022 20:41:01 -0400 Subject: [PATCH] util/xmlconfig: allow drivers to override option values This corrects the issue that we can't have DRI_CONF_MESA_GLTHREAD(false) in gallium and then DRI_CONF_MESA_GLTHREAD(true) in drivers. Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/util/xmlconfig.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/util/xmlconfig.c b/src/util/xmlconfig.c index 491dc4be64bfc..855b869d8b1c8 100644 --- a/src/util/xmlconfig.c +++ b/src/util/xmlconfig.c @@ -347,7 +347,10 @@ driParseOptionInfo(driOptionCache *info, driOptionInfo *optinfo = &info->info[i]; driOptionValue *optval = &info->values[i]; - assert(!optinfo->name); /* No duplicate options in your list. */ + if (optinfo->name) { + /* Duplicate options override the value, but the type must match. */ + assert(optinfo->type == opt->info.type); + } optinfo->type = opt->info.type; optinfo->range = opt->info.range;