devs[i]->ops->release(&devs[i]);
}
+const struct drm_conf_ret *
+pipe_loader_configuration(struct pipe_loader_device *dev,
+ enum drm_conf conf)
+{
+ return dev->ops->configuration(dev, conf);
+}
+
struct pipe_screen *
pipe_loader_create_screen(struct pipe_loader_device *dev,
const char *library_paths)
#define PIPE_LOADER_H
#include "pipe/p_compiler.h"
+#include "state_tracker/drm_driver.h"
#ifdef HAVE_PIPE_LOADER_XLIB
#include <X11/Xlib.h>
const char *library_paths);
/**
+ * Query the configuration parameters for the specified device.
+ *
+ * \param dev Device that will be queried.
+ * \param conf The drm_conf id of the option to be queried.
+ */
+const struct drm_conf_ret *
+pipe_loader_configuration(struct pipe_loader_device *dev,
+ enum drm_conf conf);
+
+/**
* Release resources allocated for a list of devices.
*
* Should be called when the specified devices are no longer in use to
*dev = NULL;
}
+static const struct drm_conf_ret *
+pipe_loader_drm_configuration(struct pipe_loader_device *dev,
+ enum drm_conf conf)
+{
+ struct pipe_loader_drm_device *ddev = pipe_loader_drm_device(dev);
+ const struct drm_driver_descriptor *dd;
+
+ if (!ddev->lib)
+ return NULL;
+
+ dd = (const struct drm_driver_descriptor *)
+ util_dl_get_proc_address(ddev->lib, "driver_descriptor");
+
+ /* sanity check on the name */
+ if (!dd || strcmp(dd->name, ddev->base.driver_name) != 0)
+ return NULL;
+
+ if (!dd->configuration)
+ return NULL;
+
+ return dd->configuration(conf);
+}
+
static struct pipe_screen *
pipe_loader_drm_create_screen(struct pipe_loader_device *dev,
const char *library_paths)
static struct pipe_loader_ops pipe_loader_drm_ops = {
.create_screen = pipe_loader_drm_create_screen,
+ .configuration = pipe_loader_drm_configuration,
.release = pipe_loader_drm_release
};
struct pipe_screen *(*create_screen)(struct pipe_loader_device *dev,
const char *library_paths);
+ const struct drm_conf_ret *(*configuration)(struct pipe_loader_device *dev,
+ enum drm_conf conf);
+
void (*release)(struct pipe_loader_device **dev);
};
*dev = NULL;
}
+static const struct drm_conf_ret *
+pipe_loader_sw_configuration(struct pipe_loader_device *dev,
+ enum drm_conf conf)
+{
+ return NULL;
+}
+
static struct pipe_screen *
pipe_loader_sw_create_screen(struct pipe_loader_device *dev,
const char *library_paths)
static struct pipe_loader_ops pipe_loader_sw_ops = {
.create_screen = pipe_loader_sw_create_screen,
+ .configuration = pipe_loader_sw_configuration,
.release = pipe_loader_sw_release
};