driconf: Make the driver's declarations be structs instead of XML.
We can generate the XML if anybody actually queries it, but this reduces the amount of work in driver setup and means that we'll be able to support driconf option queries on Android without libexpat. This updates the driconf interface struct version for i965, i915, and radeon to use the new getXml entrypoint to call the on-demand xml generation. Note that our loaders (egl, glx) implement the v2 function interface and don't use .xml when that's set, and the X server doesn't use this interface at all. XML generation tested on iris and i965 using adriconf Acked-by: Eric Engestrom <eric@engestrom.ch> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6916>
This commit is contained in:
+6
-5
@@ -178,13 +178,12 @@ loader_open_render_node(const char *name)
|
||||
}
|
||||
|
||||
#ifdef USE_DRICONF
|
||||
static const char __driConfigOptionsLoader[] =
|
||||
DRI_CONF_BEGIN
|
||||
static const driOptionDescription __driConfigOptionsLoader[] = {
|
||||
DRI_CONF_SECTION_INITIALIZATION
|
||||
DRI_CONF_DEVICE_ID_PATH_TAG()
|
||||
DRI_CONF_DRI_DRIVER()
|
||||
DRI_CONF_SECTION_END
|
||||
DRI_CONF_END;
|
||||
};
|
||||
|
||||
static char *loader_get_dri_config_driver(int fd)
|
||||
{
|
||||
@@ -193,7 +192,8 @@ static char *loader_get_dri_config_driver(int fd)
|
||||
char *dri_driver = NULL;
|
||||
char *kernel_driver = loader_get_kernel_driver_name(fd);
|
||||
|
||||
driParseOptionInfo(&defaultInitOptions, __driConfigOptionsLoader);
|
||||
driParseOptionInfo(&defaultInitOptions, __driConfigOptionsLoader,
|
||||
ARRAY_SIZE(__driConfigOptionsLoader));
|
||||
driParseConfigFiles(&userInitOptions, &defaultInitOptions, 0,
|
||||
"loader", kernel_driver, NULL, 0, NULL, 0);
|
||||
if (driCheckOption(&userInitOptions, "dri_driver", DRI_STRING)) {
|
||||
@@ -215,7 +215,8 @@ static char *loader_get_dri_config_device_id(void)
|
||||
driOptionCache userInitOptions;
|
||||
char *prime = NULL;
|
||||
|
||||
driParseOptionInfo(&defaultInitOptions, __driConfigOptionsLoader);
|
||||
driParseOptionInfo(&defaultInitOptions, __driConfigOptionsLoader,
|
||||
ARRAY_SIZE(__driConfigOptionsLoader));
|
||||
driParseConfigFiles(&userInitOptions, &defaultInitOptions, 0,
|
||||
"loader", NULL, NULL, 0, NULL, 0);
|
||||
if (driCheckOption(&userInitOptions, "device_id", DRI_STRING))
|
||||
|
||||
Reference in New Issue
Block a user