st/dri: implement v2 of DRI_ConfigOptions

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
Nicolai Hähnle
2017-06-30 11:06:06 +02:00
parent aa222e21c2
commit b4ff5e90e9
4 changed files with 55 additions and 2 deletions

View File

@@ -32,6 +32,7 @@
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <xf86drm.h>
#include <unistd.h>
@@ -299,6 +300,28 @@ pipe_loader_drm_create_screen(struct pipe_loader_device *dev,
return ddev->dd->create_screen(ddev->fd, config);
}
char *
pipe_loader_drm_get_driinfo_xml(const char *driver_name)
{
char *xml = NULL;
struct util_dl_library *lib = NULL;
const struct drm_driver_descriptor *dd =
get_driver_descriptor(driver_name, &lib);
if (!dd)
goto out;
const struct drm_conf_ret *conf = dd->configuration(DRM_CONF_XML_OPTIONS);
if (!conf)
goto out;
xml = strdup((const char *)conf->val.val_pointer);
out:
if (lib)
util_dl_close(lib);
return xml;
}
static const struct pipe_loader_ops pipe_loader_drm_ops = {
.create_screen = pipe_loader_drm_create_screen,
.configuration = pipe_loader_drm_configuration,