intel: Set gen in intelInitScreen, just copy value in intelInitContext
authorKristian Høgsberg <krh@bitplanet.net>
Mon, 25 Apr 2011 13:49:09 +0000 (09:49 -0400)
committerKristian Høgsberg <krh@bitplanet.net>
Tue, 26 Apr 2011 17:26:31 +0000 (13:26 -0400)
src/mesa/drivers/dri/intel/intel_context.c
src/mesa/drivers/dri/intel/intel_screen.c
src/mesa/drivers/dri/intel/intel_screen.h

index ec08dd5c8da28be7960befda011254761c9a5a87..447fbe5bae1bed9fc96f74761d5dc1eb391342e6 100644 (file)
@@ -650,27 +650,23 @@ intelInitContext(struct intel_context *intel,
    intel->driFd = sPriv->fd;
 
    intel->has_xrgb_textures = GL_TRUE;
+   intel->gen = intelScreen->gen;
    if (IS_GEN6(intel->intelScreen->deviceID)) {
-      intel->gen = 6;
       intel->needs_ff_sync = GL_TRUE;
       intel->has_luminance_srgb = GL_TRUE;
    } else if (IS_GEN5(intel->intelScreen->deviceID)) {
-      intel->gen = 5;
       intel->needs_ff_sync = GL_TRUE;
       intel->has_luminance_srgb = GL_TRUE;
    } else if (IS_965(intel->intelScreen->deviceID)) {
-      intel->gen = 4;
       if (IS_G4X(intel->intelScreen->deviceID)) {
          intel->has_luminance_srgb = GL_TRUE;
          intel->is_g4x = GL_TRUE;
       }
    } else if (IS_9XX(intel->intelScreen->deviceID)) {
-      intel->gen = 3;
       if (IS_945(intel->intelScreen->deviceID)) {
         intel->is_945 = GL_TRUE;
       }
    } else {
-      intel->gen = 2;
       if (intel->intelScreen->deviceID == PCI_CHIP_I830_M ||
          intel->intelScreen->deviceID == PCI_CHIP_845_G) {
         intel->has_xrgb_textures = GL_FALSE;
index 8b3cb7cd1523a0244d8d42826b30e26d5c617327..bfbfec5f93ebca482c409a83f839957e72b1e906 100644 (file)
@@ -548,6 +548,18 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp)
       intelScreen->deviceID = strtod(devid_override, NULL);
    }
 
+   if (IS_GEN6(intelScreen->deviceID)) {
+      intelScreen->gen = 6;
+   } else if (IS_GEN5(intelScreen->deviceID)) {
+      intelScreen->gen = 5;
+   } else if (IS_965(intelScreen->deviceID)) {
+      intelScreen->gen = 4;
+   } else if (IS_9XX(intelScreen->deviceID)) {
+      intelScreen->gen = 3;
+   } else {
+      intelScreen->gen = 2;
+   }
+
    api_mask = (1 << __DRI_API_OPENGL);
 #if FEATURE_ES1
    api_mask |= (1 << __DRI_API_GLES);
index 0f0b5be56dc0e287a705859e40fda7cbbaaec63d..4613c9858c419ba18a187f3f60e253fec9fe5ef9 100644 (file)
@@ -37,6 +37,7 @@
 struct intel_screen
 {
    int deviceID;
+   int gen;
 
    int logTextureGranularity;