Use correct scratch reg offset for r6xx/r7xx
authorAlex Deucher <alexdeucher@gmail.com>
Wed, 10 Jun 2009 21:56:05 +0000 (17:56 -0400)
committerAlex Deucher <alexdeucher@gmail.com>
Wed, 10 Jun 2009 21:56:05 +0000 (17:56 -0400)
src/mesa/drivers/dri/radeon/radeon_screen.c

index 054ffb4..8309903 100644 (file)
@@ -1024,8 +1024,12 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv )
        __driUtilMessage("%s: drmMap (2) failed\n", __FUNCTION__ );
        return NULL;
      }
-     screen->scratch = (__volatile__ uint32_t *)
-       ((GLubyte *)screen->status.map + RADEON_SCRATCH_REG_OFFSET);
+     if (screen->chip_family < CHIP_FAMILY_R600)
+            screen->scratch = (__volatile__ uint32_t *)
+                    ((GLubyte *)screen->status.map + RADEON_SCRATCH_REG_OFFSET);
+     else
+            screen->scratch = (__volatile__ uint32_t *)
+                    ((GLubyte *)screen->status.map + R600_SCRATCH_REG_OFFSET);
 
      screen->buffers = drmMapBufs( sPriv->fd );
      if ( !screen->buffers ) {