From 76f07362ea411fd6ef29b34df3885def5137bcba Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Fri, 14 Feb 2014 23:34:47 +0000 Subject: 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 --- src/mesa/drivers/dri/nouveau/nouveau_driver.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'src/mesa/drivers/dri/nouveau/nouveau_driver.c') 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; } -- cgit v1.2.3