Mesa (master): r600: clean up Create/DestroyContext

Alex Deucher agd5f at kemper.freedesktop.org
Wed Aug 12 19:41:18 UTC 2009


Module: Mesa
Branch: master
Commit: 2f6675b8160c5fa2e6e9b5642c133fd2843a7508
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2f6675b8160c5fa2e6e9b5642c133fd2843a7508

Author: Alex Deucher <alexdeucher at gmail.com>
Date:   Wed Aug 12 14:49:07 2009 -0400

r600: clean up Create/DestroyContext

---

 src/mesa/drivers/dri/r600/r600_context.c           |    2 ++
 .../drivers/dri/radeon/radeon_common_context.c     |   11 +----------
 src/mesa/drivers/dri/radeon/radeon_screen.c        |    8 +++-----
 3 files changed, 6 insertions(+), 15 deletions(-)

diff --git a/src/mesa/drivers/dri/r600/r600_context.c b/src/mesa/drivers/dri/r600/r600_context.c
index eacf811..7009374 100644
--- a/src/mesa/drivers/dri/r600/r600_context.c
+++ b/src/mesa/drivers/dri/r600/r600_context.c
@@ -395,6 +395,8 @@ r600DestroyContext (__DRIcontextPrivate * driContextPriv)
 
     if (context)
 	    FREE(context->hw.pStateList);
+
+    radeonDestroyContext(driContextPriv);
 }
 
 
diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.c b/src/mesa/drivers/dri/radeon/radeon_common_context.c
index 3a9468e..f71dc1c 100644
--- a/src/mesa/drivers/dri/radeon/radeon_common_context.c
+++ b/src/mesa/drivers/dri/radeon/radeon_common_context.c
@@ -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__ );
 		}
diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c
index 89bb31e..7b75966 100644
--- a/src/mesa/drivers/dri/radeon/radeon_screen.c
+++ b/src/mesa/drivers/dri/radeon/radeon_screen.c
@@ -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,




More information about the mesa-commit mailing list