Revert "i965/fs: Change fs_visitor::emit_lrp to use MAC for gen<6"
[mesa.git] / src / glx / dri2_query_renderer.c
index 95560cb4a6bc1aa1286385b90154ecc0b842a874..c1e87723913039535613d9d5393b5b95728d0cca 100644 (file)
 
 #include "glxclient.h"
 #include "glx_error.h"
-#include "xf86drm.h"
 #include "dri2.h"
 #include "dri_interface.h"
 #include "dri2_priv.h"
+#if defined(HAVE_DRI3)
+#include "dri3_priv.h"
+#endif
 
 static int
 dri2_convert_glx_query_renderer_attribs(int attribute)
@@ -99,4 +101,44 @@ dri2_query_renderer_string(struct glx_screen *base, int attribute,
    return psc->rendererQuery->queryString(psc->driScreen, dri_attribute, value);
 }
 
+#if defined(HAVE_DRI3)
+_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 /* HAVE_DRI3 */
+
 #endif /* GLX_DIRECT_RENDERING */