summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEmil Velikov <emil.l.velikov@gmail.com>2014-05-17 15:31:32 +0100
committerEmil Velikov <emil.l.velikov@gmail.com>2014-06-19 12:37:14 +0100
commit36ff20027c43cd7115f1b6f073e4094582f643b6 (patch)
tree9cab40c233cfe47dc83ca4fd158b81e074dbadd7 /src
parent7f00611d780df85cc20474b6695754e36a6c9228 (diff)
downloadexternal_mesa3d-36ff20027c43cd7115f1b6f073e4094582f643b6.zip
external_mesa3d-36ff20027c43cd7115f1b6f073e4094582f643b6.tar.gz
external_mesa3d-36ff20027c43cd7115f1b6f073e4094582f643b6.tar.bz2
pipe-loader: add pipe_loader_ops::configuration()
Required for the dri state-tracker. Will be used to retrieve driver specific configuration parameters: - share_fd (dmabuf) capability - throttle Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/auxiliary/pipe-loader/pipe_loader.c7
-rw-r--r--src/gallium/auxiliary/pipe-loader/pipe_loader.h11
-rw-r--r--src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c24
-rw-r--r--src/gallium/auxiliary/pipe-loader/pipe_loader_priv.h3
-rw-r--r--src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c8
5 files changed, 53 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader.c b/src/gallium/auxiliary/pipe-loader/pipe_loader.c
index 2639763..8e79f85 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader.c
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader.c
@@ -61,6 +61,13 @@ pipe_loader_release(struct pipe_loader_device **devs, int ndev)
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)
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader.h b/src/gallium/auxiliary/pipe-loader/pipe_loader.h
index caef6c1..8ff00b1 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader.h
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader.h
@@ -34,6 +34,7 @@
#define PIPE_LOADER_H
#include "pipe/p_compiler.h"
+#include "state_tracker/drm_driver.h"
#ifdef HAVE_PIPE_LOADER_XLIB
#include <X11/Xlib.h>
@@ -94,6 +95,16 @@ pipe_loader_create_screen(struct pipe_loader_device *dev,
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
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
index 2e5b74b..1bbaf19 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
@@ -261,6 +261,29 @@ pipe_loader_drm_release(struct pipe_loader_device **dev)
*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)
@@ -285,5 +308,6 @@ pipe_loader_drm_create_screen(struct pipe_loader_device *dev,
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
};
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_priv.h b/src/gallium/auxiliary/pipe-loader/pipe_loader_priv.h
index 476c0ad..d3b0252 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader_priv.h
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_priv.h
@@ -34,6 +34,9 @@ struct pipe_loader_ops {
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);
};
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c b/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c
index fa317f2..b1b1ca6 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c
@@ -152,6 +152,13 @@ pipe_loader_sw_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)
@@ -176,5 +183,6 @@ pipe_loader_sw_create_screen(struct pipe_loader_device *dev,
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
};