i915: Refactor the vendor string out of intelGetString
authorIan Romanick <ian.d.romanick@intel.com>
Fri, 15 Feb 2013 00:25:44 +0000 (16:25 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 8 Nov 2013 02:08:15 +0000 (18:08 -0800)
This will soon be used in intel_screen.c from a function that doesn't
have a gl_context.

v2: Remove spurious break after return.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i915/intel_context.c
src/mesa/drivers/dri/i915/intel_context.h

index 15d4074..420ab2a 100644 (file)
@@ -60,6 +60,7 @@
 
 int INTEL_DEBUG = (0);
 
+const char *const i915_vendor_string = "Intel Open Source Technology Center";
 
 static const GLubyte *
 intelGetString(struct gl_context * ctx, GLenum name)
@@ -70,8 +71,7 @@ intelGetString(struct gl_context * ctx, GLenum name)
 
    switch (name) {
    case GL_VENDOR:
-      return (GLubyte *) "Intel Open Source Technology Center";
-      break;
+      return (GLubyte *) i915_vendor_string;
 
    case GL_RENDERER:
       switch (intel->intelScreen->deviceID) {
index 0b83a3e..e386e46 100644 (file)
@@ -393,6 +393,8 @@ extern int INTEL_DEBUG;
  * intel_context.c:
  */
 
+extern const char *const i915_vendor_string;
+
 extern bool intelInitContext(struct intel_context *intel,
                              int api,
                              unsigned major_version,