summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/pipe-loader/pipe_loader.c
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2017-06-28 17:50:19 +0200
committerNicolai Hähnle <[email protected]>2017-08-02 09:50:57 +0200
commite794f8bf8bdb7cd0820251b46a9387ea5a7316da (patch)
treecda2f6ab2301d409ce404f13ab5b4bfcbe3588a9 /src/gallium/auxiliary/pipe-loader/pipe_loader.c
parent678dadf1237a3fb492ee2d8daa32d0205dea59ba (diff)
gallium: move loading of drirc to pipe-loader
v2: rebase compile fix: addition of mesa_no_error Reviewed-by: Marek Olšák <[email protected]> (v1)
Diffstat (limited to 'src/gallium/auxiliary/pipe-loader/pipe_loader.c')
-rw-r--r--src/gallium/auxiliary/pipe-loader/pipe_loader.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader.c b/src/gallium/auxiliary/pipe-loader/pipe_loader.c
index bb65be15289..95e6b42cf71 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader.c
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader.c
@@ -31,6 +31,7 @@
#include "util/u_memory.h"
#include "util/u_string.h"
#include "util/u_dl.h"
+#include "util/xmlconfig.h"
#include "util/xmlpool.h"
#ifdef _MSC_VER
@@ -71,6 +72,16 @@ pipe_loader_release(struct pipe_loader_device **devs, int ndev)
devs[i]->ops->release(&devs[i]);
}
+void
+pipe_loader_base_release(struct pipe_loader_device **dev)
+{
+ driDestroyOptionCache(&(*dev)->option_cache);
+ driDestroyOptionInfo(&(*dev)->option_info);
+
+ FREE(*dev);
+ *dev = NULL;
+}
+
const struct drm_conf_ret *
pipe_loader_configuration(struct pipe_loader_device *dev,
enum drm_conf conf)
@@ -78,6 +89,24 @@ pipe_loader_configuration(struct pipe_loader_device *dev,
return dev->ops->configuration(dev, conf);
}
+void
+pipe_loader_load_options(struct pipe_loader_device *dev)
+{
+ if (dev->option_info.info)
+ return;
+
+ const char *xml_options = gallium_driinfo_xml;
+ const struct drm_conf_ret *xml_options_conf =
+ pipe_loader_configuration(dev, DRM_CONF_XML_OPTIONS);
+
+ if (xml_options_conf)
+ xml_options = xml_options_conf->val.val_pointer;
+
+ driParseOptionInfo(&dev->option_info, xml_options);
+ driParseConfigFiles(&dev->option_cache, &dev->option_info, 0,
+ dev->driver_name);
+}
+
struct pipe_screen *
pipe_loader_create_screen(struct pipe_loader_device *dev,
struct pipe_screen_config *config)