summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2013-10-11 12:20:57 -0700
committerIan Romanick <ian.d.romanick@intel.com>2013-10-14 10:46:50 -0700
commit1bdfe51651b5d0b0310577d75609ab7c8a045c0d (patch)
tree478a08c79df5d9dffb653e4dbdd1b0e4e01c9994
parent767df2e873f46cad9a7b53ef702341bc0c9529ea (diff)
i965: Refactor the renderer string creation out of intelGetString
This will soon be used in intel_screen.c from a function that doesn't have a gl_context. v2: Delete local variables that are now unused. This matches v1 of the changes to the i915 driver. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.c34
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.h2
2 files changed, 23 insertions, 13 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index 9b79745b9ac..34a423f64d1 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -97,29 +97,37 @@ brw_query_samples_for_format(struct gl_context *ctx, GLenum target,
const char *const brw_vendor_string = "Intel Open Source Technology Center";
+const char *
+brw_get_renderer_string(unsigned deviceID)
+{
+ const char *chipset;
+ static char buffer[128];
+
+ switch (deviceID) {
+#undef CHIPSET
+#define CHIPSET(id, symbol, str) case id: chipset = str; break;
+#include "pci_ids/i965_pci_ids.h"
+ default:
+ chipset = "Unknown Intel Chipset";
+ break;
+ }
+
+ (void) driGetRendererString(buffer, chipset, 0);
+ return buffer;
+}
+
static const GLubyte *
intelGetString(struct gl_context * ctx, GLenum name)
{
const struct brw_context *const brw = brw_context(ctx);
- const char *chipset;
- static char buffer[128];
switch (name) {
case GL_VENDOR:
return (GLubyte *) brw_vendor_string;
case GL_RENDERER:
- switch (brw->intelScreen->deviceID) {
-#undef CHIPSET
-#define CHIPSET(id, family, str) case id: chipset = str; break;
-#include "pci_ids/i965_pci_ids.h"
- default:
- chipset = "Unknown Intel Chipset";
- break;
- }
-
- (void) driGetRendererString(buffer, chipset, 0);
- return (GLubyte *) buffer;
+ return
+ (GLubyte *) brw_get_renderer_string(brw->intelScreen->deviceID);
default:
return NULL;
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index d233a09de8b..931ac563ee3 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -1474,6 +1474,8 @@ extern void intelInitClearFuncs(struct dd_function_table *functions);
*/
extern const char *const brw_vendor_string;
+extern const char *brw_get_renderer_string(unsigned deviceID);
+
extern void intelFinish(struct gl_context * ctx);
enum {