xmlconfig: add kernel_driver device attribute
[mesa.git] / src / gallium / auxiliary / pipe-loader / pipe_loader.c
index cb37f30c02e93505ade6b3c17fba19161f1b8f77..6fd15527e53fe21cb5c43191a36b05d12ffbf95f 100644 (file)
@@ -34,6 +34,8 @@
 #include "util/xmlconfig.h"
 #include "util/xmlpool.h"
 
+#include <string.h>
+
 #ifdef _MSC_VER
 #include <stdlib.h>
 #define PATH_MAX _MAX_PATH
@@ -49,7 +51,9 @@ static int (*backends[])(struct pipe_loader_device **, int) = {
 };
 
 const char gallium_driinfo_xml[] =
+   DRI_CONF_BEGIN
 #include "driinfo_gallium.h"
+   DRI_CONF_END
 ;
 
 int
@@ -104,17 +108,33 @@ pipe_loader_load_options(struct pipe_loader_device *dev)
 
    driParseOptionInfo(&dev->option_info, xml_options);
    driParseConfigFiles(&dev->option_cache, &dev->option_info, 0,
-                       dev->driver_name);
+                       dev->driver_name, NULL);
+}
+
+char *
+pipe_loader_get_driinfo_xml(const char *driver_name)
+{
+#ifdef HAVE_LIBDRM
+   char *xml = pipe_loader_drm_get_driinfo_xml(driver_name);
+#else
+   char *xml = NULL;
+#endif
+
+   if (!xml)
+      xml = strdup(gallium_driinfo_xml);
+
+   return xml;
 }
 
 struct pipe_screen *
-pipe_loader_create_screen(struct pipe_loader_device *dev,
-                          struct pipe_screen_config *config)
+pipe_loader_create_screen(struct pipe_loader_device *dev)
 {
+   struct pipe_screen_config config;
+
    pipe_loader_load_options(dev);
-   config->options = &dev->option_cache;
+   config.options = &dev->option_cache;
 
-   return dev->ops->create_screen(dev, config);
+   return dev->ops->create_screen(dev, &config);
 }
 
 struct util_dl_library *