summaryrefslogtreecommitdiffstats
path: root/src/gallium/include/state_tracker
diff options
context:
space:
mode:
authorThomas Hellstrom <[email protected]>2011-10-12 10:29:24 +0200
committerThomas Hellstrom <[email protected]>2011-10-14 09:53:05 +0200
commitec7d5b8c021f655d49df4ba1ed2038ee423f9d5e (patch)
tree26b5dac14cdc8160585b2cebf780c41d09726242 /src/gallium/include/state_tracker
parent5a6ca7e9f24939cfacf2e8cd163a4efa9550ce1f (diff)
drm_driver: Add a configuration function to the driver descriptor.
Adds a possibility for the state tracker manager to query the target for a specific configuration. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Jakob Bornecrantz <[email protected]>
Diffstat (limited to 'src/gallium/include/state_tracker')
-rw-r--r--src/gallium/include/state_tracker/drm_driver.h47
1 files changed, 46 insertions, 1 deletions
diff --git a/src/gallium/include/state_tracker/drm_driver.h b/src/gallium/include/state_tracker/drm_driver.h
index d94c1e6a7cf..2df28599fe8 100644
--- a/src/gallium/include/state_tracker/drm_driver.h
+++ b/src/gallium/include/state_tracker/drm_driver.h
@@ -35,6 +35,40 @@ struct winsys_handle
unsigned stride;
};
+
+
+/**
+ * Configuration queries.
+ */
+enum drm_conf {
+ /* How many frames to allow before throttling. Or -1 to indicate any number */
+ DRM_CONF_THROTTLE, /* DRM_CONF_INT. */
+ DRM_CONF_MAX
+};
+
+/**
+ * Type of configuration answer
+ */
+enum drm_conf_type {
+ DRM_CONF_INT,
+ DRM_CONF_BOOL,
+ DRM_CONF_FLOAT,
+ DRM_CONF_POINTER
+};
+
+/**
+ * Return value from the configuration function.
+ */
+struct drm_conf_ret {
+ enum drm_conf_type type;
+ union {
+ int val_int;
+ bool val_bool;
+ float val_float;
+ void *val_pointer;
+ } val;
+};
+
struct drm_driver_descriptor
{
/**
@@ -54,6 +88,16 @@ struct drm_driver_descriptor
* For example wrapping trace or rbug debugging drivers around it.
*/
struct pipe_screen* (*create_screen)(int drm_fd);
+
+
+ /**
+ * Return a configuration value.
+ *
+ * If this function is NULL, or if it returns NULL
+ * the state tracker- or state
+ * tracker manager should provide a reasonable default value.
+ */
+ const struct drm_conf_ret *(*configuration) (enum drm_conf conf);
};
extern struct drm_driver_descriptor driver_descriptor;
@@ -61,11 +105,12 @@ extern struct drm_driver_descriptor driver_descriptor;
/**
* Instantiate a drm_driver_descriptor struct.
*/
-#define DRM_DRIVER_DESCRIPTOR(name_str, driver_name_str, func) \
+#define DRM_DRIVER_DESCRIPTOR(name_str, driver_name_str, func, conf) \
struct drm_driver_descriptor driver_descriptor = { \
.name = name_str, \
.driver_name = driver_name_str, \
.create_screen = func, \
+ .configuration = (conf), \
};
#endif