gallium/driconf: Allow the driver to parse the driconf options.
This will give the driver a chance to set a device name separate from the driver name, using info probed during screen creation. All drivers querying driconf in screen creation now have to call parsing on their own, but other drivers get fallback parsing after screen creation. 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:
@@ -124,13 +124,19 @@ pipe_loader_load_options(struct pipe_loader_device *dev)
|
||||
|
||||
const driOptionDescription *merged_driconf =
|
||||
merge_driconf(driver_driconf, driver_count, &merged_count);
|
||||
|
||||
driParseOptionInfo(&dev->option_info, merged_driconf, merged_count);
|
||||
driParseConfigFiles(&dev->option_cache, &dev->option_info, 0,
|
||||
dev->driver_name, NULL, NULL, 0, NULL, 0);
|
||||
free((void *)merged_driconf);
|
||||
}
|
||||
|
||||
void
|
||||
pipe_loader_config_options(struct pipe_loader_device *dev)
|
||||
{
|
||||
if (!dev->option_cache.info) {
|
||||
driParseConfigFiles(&dev->option_cache, &dev->option_info, 0,
|
||||
dev->driver_name, NULL, NULL, 0, NULL, 0);
|
||||
}
|
||||
}
|
||||
|
||||
char *
|
||||
pipe_loader_get_driinfo_xml(const char *driver_name)
|
||||
{
|
||||
@@ -161,6 +167,7 @@ pipe_loader_create_screen_vk(struct pipe_loader_device *dev, bool sw_vk)
|
||||
|
||||
util_cpu_detect();
|
||||
pipe_loader_load_options(dev);
|
||||
config.options_info = &dev->option_info;
|
||||
config.options = &dev->option_cache;
|
||||
|
||||
return dev->ops->create_screen(dev, &config, sw_vk);
|
||||
|
Reference in New Issue
Block a user