r600: clean up Create/DestroyContext
authorAlex Deucher <alexdeucher@gmail.com>
Wed, 12 Aug 2009 18:49:07 +0000 (14:49 -0400)
committerAlex Deucher <alexdeucher@gmail.com>
Wed, 12 Aug 2009 19:40:15 +0000 (15:40 -0400)
src/mesa/drivers/dri/r600/r600_context.c
src/mesa/drivers/dri/radeon/radeon_common_context.c
src/mesa/drivers/dri/radeon/radeon_screen.c

index eacf811282568beac20ea40b298192d9a32d3dfe..7009374b0ca71fec157f50c949666309f35b2008 100644 (file)
@@ -395,6 +395,8 @@ r600DestroyContext (__DRIcontextPrivate * driContextPriv)
 
     if (context)
            FREE(context->hw.pStateList);
+
+    radeonDestroyContext(driContextPriv);
 }
 
 
index 3a9468e88d2daab0c65953491fe4e689eabd53b8..f71dc1cb2336188ec56d8db29411b700c09c6ed4 100644 (file)
@@ -306,16 +306,7 @@ void radeonDestroyContext(__DRIcontextPrivate *driContextPriv )
        }
 
        assert(radeon);
-       if (radeon) 
-    {
-
-#if RADEON_COMMON && defined(RADEON_COMMON_FOR_R600) /* +r6/r7 */
-           if (IS_R600_CLASS(screen))
-        {
-               r600DestroyContext(driContextPriv);
-        }
-#endif
-
+       if (radeon) {
                if (radeon->dma.current) {
                        rcommonFlushCmdBuf( radeon, __FUNCTION__ );
                }
index 89bb31ea181599cd701710795b952ecc8bb2b7ab..7b759661ca7535b95db2d053ae13609509d36b2a 100644 (file)
@@ -1586,11 +1586,6 @@ static GLboolean radeonCreateContext(const __GLcontextModes * glVisual,
 {
        __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
        radeonScreenPtr screen = (radeonScreenPtr) (sPriv->private);
-#if RADEON_COMMON && defined(RADEON_COMMON_FOR_R600)
-       if (IS_R600_CLASS(screen))
-               return r600CreateContext(glVisual, driContextPriv, sharedContextPriv);
-#endif
-
 #if RADEON_COMMON && defined(RADEON_COMMON_FOR_R300)
        if (IS_R300_CLASS(screen))
                return r300CreateContext(glVisual, driContextPriv, sharedContextPriv);
@@ -1798,6 +1793,9 @@ const struct __DriverAPIRec driDriverAPI = {
 #if RADEON_COMMON && defined(RADEON_COMMON_FOR_R200)
    .CreateContext   = r200CreateContext,
    .DestroyContext  = r200DestroyContext,
+#elif RADEON_COMMON && defined(RADEON_COMMON_FOR_R600)
+   .CreateContext   = r600CreateContext,
+   .DestroyContext  = r600DestroyContext,
 #else
    .CreateContext   = radeonCreateContext,
    .DestroyContext  = radeonDestroyContext,