summaryrefslogtreecommitdiffstats
path: root/src/glx/dri2_query_renderer.c
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2014-02-20 11:47:14 -0800
committerEmil Velikov <[email protected]>2014-05-02 22:13:58 +0100
commit625bdd64e5ea3327d4459b1ccccff8dab89129d0 (patch)
tree9db203b262da5be4df4826379e3511d7137019a8 /src/glx/dri2_query_renderer.c
parent7ebdc9e48c99a92475b48668284695663e871f7d (diff)
dri3: Enable GLX_MESA_query_renderer on DRI3 too
This should have happend around the time of commit 4680d23, but Keith's DRI3 patches and my GLX_MESA_query_renderer patches crossed in the mail. I don't have a working DRI3 setup, so I haven't been able to actually verify this. I'm hoping that someone can piglit this for me on DRI3... It's also unfortunate the DRI2 and DRI3 can't share more code. Signed-off-by: Ian Romanick <[email protected]> Cc: Keith Packard <[email protected]> Cc: "10.1" <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/glx/dri2_query_renderer.c')
-rw-r--r--src/glx/dri2_query_renderer.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/glx/dri2_query_renderer.c b/src/glx/dri2_query_renderer.c
index a28ced6ae6a..c96e1f94a42 100644
--- a/src/glx/dri2_query_renderer.c
+++ b/src/glx/dri2_query_renderer.c
@@ -28,6 +28,7 @@
#include "dri2.h"
#include "dri_interface.h"
#include "dri2_priv.h"
+#include "dri3_priv.h"
static int
dri2_convert_glx_query_renderer_attribs(int attribute)
@@ -98,4 +99,42 @@ dri2_query_renderer_string(struct glx_screen *base, int attribute,
return psc->rendererQuery->queryString(psc->driScreen, dri_attribute, value);
}
+_X_HIDDEN int
+dri3_query_renderer_integer(struct glx_screen *base, int attribute,
+ unsigned int *value)
+{
+ struct dri3_screen *const psc = (struct dri3_screen *) base;
+
+ /* Even though there are invalid values (and
+ * dri2_convert_glx_query_renderer_attribs may return -1), the higher level
+ * GLX code is required to perform the filtering. Assume that we got a
+ * good value.
+ */
+ const int dri_attribute = dri2_convert_glx_query_renderer_attribs(attribute);
+
+ if (psc->rendererQuery == NULL)
+ return -1;
+
+ return psc->rendererQuery->queryInteger(psc->driScreen, dri_attribute,
+ value);
+}
+
+_X_HIDDEN int
+dri3_query_renderer_string(struct glx_screen *base, int attribute,
+ const char **value)
+{
+ struct dri3_screen *const psc = (struct dri3_screen *) base;
+
+ /* Even though queryString only accepts a subset of the possible GLX
+ * queries, the higher level GLX code is required to perform the filtering.
+ * Assume that we got a good value.
+ */
+ const int dri_attribute = dri2_convert_glx_query_renderer_attribs(attribute);
+
+ if (psc->rendererQuery == NULL)
+ return -1;
+
+ return psc->rendererQuery->queryString(psc->driScreen, dri_attribute, value);
+}
+
#endif /* GLX_DIRECT_RENDERING */