aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/nouveau/nouveau_driver.c
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2014-02-14 23:34:47 +0000
committerEmil Velikov <[email protected]>2014-08-15 17:35:37 +0100
commit76f07362ea411fd6ef29b34df3885def5137bcba (patch)
treee88e92db3db79fe6b4417d236507783111564b22 /src/mesa/drivers/dri/nouveau/nouveau_driver.c
parent87d3ae0b45b6b6bb50b583dafa55eb109449a005 (diff)
dri/nouveau: add GLX_MESA_query_renderer support
- Create nouveau_{vendor,get_renderer}_string helpers. - Set correct max_gl*version. - Query the device PCIID via libdrm_nouveau/nouveau_getparam. Signed-off-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/nouveau/nouveau_driver.c')
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_driver.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_driver.c b/src/mesa/drivers/dri/nouveau/nouveau_driver.c
index b2887f83e6c..c1f86724161 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_driver.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_driver.c
@@ -34,21 +34,29 @@
#include "drivers/common/meta.h"
-static const GLubyte *
-nouveau_get_string(struct gl_context *ctx, GLenum name)
+const char const *nouveau_vendor_string = "Nouveau";
+
+const char *
+nouveau_get_renderer_string(unsigned chipset)
{
- static char buffer[128];
char hardware_name[32];
+ static char buffer[128];
+
+ snprintf(hardware_name, sizeof(hardware_name), "nv%02X", chipset);
+ driGetRendererString(buffer, hardware_name, 0);
+ return buffer;
+}
+
+static const GLubyte *
+nouveau_get_string(struct gl_context *ctx, GLenum name)
+{
switch (name) {
case GL_VENDOR:
- return (GLubyte *)"Nouveau";
+ return (GLubyte *)nouveau_vendor_string;
case GL_RENDERER:
- sprintf(hardware_name, "nv%02X", context_chipset(ctx));
- driGetRendererString(buffer, hardware_name, 0);
-
- return (GLubyte *)buffer;
+ return (GLubyte *)nouveau_get_renderer_string(context_chipset(ctx));
default:
return NULL;
}