diff options
Diffstat (limited to 'src/mesa/drivers/dri/nouveau/nouveau_driver.c')
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nouveau_driver.c | 24 |
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; } |