driconfig: Add support for device specific config

Add support for driconf overrides on a per-device level, for cases
where we don't want to override behavior for all devices supported
by a particular driver.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12135>
This commit is contained in:
Rob Clark
2021-07-28 18:17:42 -07:00
parent b080aa9466
commit 6edf0d8e90
22 changed files with 37 additions and 22 deletions
+2 -2
View File
@@ -195,7 +195,7 @@ static char *loader_get_dri_config_driver(int fd)
driParseOptionInfo(&defaultInitOptions, __driConfigOptionsLoader,
ARRAY_SIZE(__driConfigOptionsLoader));
driParseConfigFiles(&userInitOptions, &defaultInitOptions, 0,
"loader", kernel_driver, NULL, 0, NULL, 0);
"loader", kernel_driver, NULL, NULL, 0, NULL, 0);
if (driCheckOption(&userInitOptions, "dri_driver", DRI_STRING)) {
char *opt = driQueryOptionstr(&userInitOptions, "dri_driver");
/* not an empty string */
@@ -218,7 +218,7 @@ static char *loader_get_dri_config_device_id(void)
driParseOptionInfo(&defaultInitOptions, __driConfigOptionsLoader,
ARRAY_SIZE(__driConfigOptionsLoader));
driParseConfigFiles(&userInitOptions, &defaultInitOptions, 0,
"loader", NULL, NULL, 0, NULL, 0);
"loader", NULL, NULL, NULL, 0, NULL, 0);
if (driCheckOption(&userInitOptions, "device_id", DRI_STRING))
prime = strdup(driQueryOptionstr(&userInitOptions, "device_id"));
driDestroyOptionCache(&userInitOptions);