aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/swrastwgl_dri/swrastwgl_dri.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-11-08 16:53:17 +0100
committermarha <marha@users.sourceforge.net>2013-11-08 16:53:17 +0100
commit3ef320ddf5d23b4e69cc7d44a17f902e245f6426 (patch)
tree93613bf53ec448c47fade975f70c4ec6b0051cb6 /xorg-server/hw/xwin/swrastwgl_dri/swrastwgl_dri.c
parentf707ea3ce065f0ce40f586c40283fab42059b485 (diff)
downloadvcxsrv-3ef320ddf5d23b4e69cc7d44a17f902e245f6426.tar.gz
vcxsrv-3ef320ddf5d23b4e69cc7d44a17f902e245f6426.tar.bz2
vcxsrv-3ef320ddf5d23b4e69cc7d44a17f902e245f6426.zip
Solved compilation and run-time problems after latest merge
Diffstat (limited to 'xorg-server/hw/xwin/swrastwgl_dri/swrastwgl_dri.c')
-rw-r--r--xorg-server/hw/xwin/swrastwgl_dri/swrastwgl_dri.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/xorg-server/hw/xwin/swrastwgl_dri/swrastwgl_dri.c b/xorg-server/hw/xwin/swrastwgl_dri/swrastwgl_dri.c
index 8597e5b4a..52b7203b5 100644
--- a/xorg-server/hw/xwin/swrastwgl_dri/swrastwgl_dri.c
+++ b/xorg-server/hw/xwin/swrastwgl_dri/swrastwgl_dri.c
@@ -852,6 +852,10 @@ __DRIconfig **driConcatConfigs(__DRIconfig **a, __DRIconfig **b)
return all;
}
+/**
+ * Return the value of a configuration attribute. The attribute is
+ * indicated by the index.
+ */
static int driGetConfigAttribIndex(const __DRIconfig *config, unsigned int index, unsigned int *value)
{
switch (attribMap[index].attrib) {
@@ -886,6 +890,31 @@ static int driGetConfigAttribIndex(const __DRIconfig *config, unsigned int index
return GL_TRUE;
}
+/**
+ * Get the value of a configuration attribute.
+ * \param attrib the attribute (one of the _DRI_ATTRIB_x tokens)
+ * \param value returns the attribute's value
+ * \return 1 for success, 0 for failure
+ */
+int
+driGetConfigAttrib(const __DRIconfig *config, unsigned int attrib, unsigned int *value)
+{
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(attribMap); i++)
+ if (attribMap[i].attrib == attrib)
+ return driGetConfigAttribIndex(config, i, value);
+
+ return GL_FALSE;
+}
+
+/**
+ * Get a configuration attribute name and value, given an index.
+ * \param index which field of the __DRIconfig to query
+ * \param attrib returns the attribute name (one of the _DRI_ATTRIB_x tokens)
+ * \param value returns the attribute's value
+ * \return 1 for success, 0 for failure
+ */
int driIndexConfigAttrib(const __DRIconfig *config, int index, unsigned int *attrib, unsigned int *value)
{
if (index >= 0 && index < ARRAY_SIZE(attribMap))
@@ -1188,7 +1217,7 @@ const __DRIcoreExtension driCoreExtension = {
NULL, /* driCreateNewScreen */
driDestroyScreen,
driGetExtensions,
- NULL,// driGetConfigAttrib,
+ driGetConfigAttrib,
driIndexConfigAttrib,
NULL, /* driCreateNewDrawable */
driDestroyDrawable,