radeon: Drop dri2 checks now that it's always true.
authorEric Anholt <eric@anholt.net>
Fri, 14 Oct 2011 19:49:59 +0000 (12:49 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 28 Oct 2011 18:23:33 +0000 (11:23 -0700)
This makes LOCK_HARDWARE empty, so it goes away.

16 files changed:
src/mesa/drivers/dri/r200/Makefile
src/mesa/drivers/dri/r200/r200_context.h
src/mesa/drivers/dri/r200/r200_ioctl.c
src/mesa/drivers/dri/r200/r200_swtcl.c
src/mesa/drivers/dri/r200/radeon_lock.c [deleted symlink]
src/mesa/drivers/dri/r200/radeon_lock.h [deleted symlink]
src/mesa/drivers/dri/radeon/Makefile
src/mesa/drivers/dri/radeon/radeon_common.c
src/mesa/drivers/dri/radeon/radeon_common.h
src/mesa/drivers/dri/radeon/radeon_context.h
src/mesa/drivers/dri/radeon/radeon_dma.c
src/mesa/drivers/dri/radeon/radeon_ioctl.c
src/mesa/drivers/dri/radeon/radeon_ioctl.h
src/mesa/drivers/dri/radeon/radeon_lock.c [deleted file]
src/mesa/drivers/dri/radeon/radeon_lock.h [deleted file]
src/mesa/drivers/dri/radeon/radeon_span.c

index 60d9c490a76daf7c44c65fa7c7fbd001c55615c1..694479fba5743af6237e373dbe948a2af9013263 100644 (file)
@@ -20,7 +20,6 @@ RADEON_COMMON_SOURCES = \
        radeon_dma.c \
        radeon_debug.c \
        radeon_fbo.c \
-       radeon_lock.c \
        radeon_mipmap_tree.c \
        radeon_pixel_read.c \
        radeon_queryobj.c \
index 38b00e5d23d7052a6928b993a33df94169228a84..b4003c3baf478aeec2cf407ab9a3709325de539b 100644 (file)
@@ -54,8 +54,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "radeon_screen.h"
 #include "radeon_common.h"
 
-#include "radeon_lock.h"
-
 struct r200_context;
 typedef struct r200_context r200ContextRec;
 typedef struct r200_context *r200ContextPtr;
index 018e78d7237ff306586e21e6872521d47ae2a8f3..3b0e431b2d6b4050166e1af98782a8e8fef7688b 100644 (file)
@@ -44,7 +44,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 
 #include "radeon_common.h"
-#include "radeon_lock.h"
 #include "r200_context.h"
 #include "r200_ioctl.h"
 #include "radeon_reg.h"
@@ -60,7 +59,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 static void r200Clear( struct gl_context *ctx, GLbitfield mask )
 {
    r200ContextPtr rmesa = R200_CONTEXT(ctx);
-   __DRIdrawable *dPriv = radeon_get_drawable(&rmesa->radeon);
    GLuint flags = 0;
    GLuint orig_mask = mask;
 
@@ -71,13 +69,6 @@ static void r200Clear( struct gl_context *ctx, GLbitfield mask )
               fprintf( stderr, "r200Clear %x radeon->sarea is NULL\n", mask);
    }
 
-   {
-      LOCK_HARDWARE( &rmesa->radeon );
-      UNLOCK_HARDWARE( &rmesa->radeon );
-      if ( dPriv->numClipRects == 0 )
-        return;
-   }
-
    radeonFlush( ctx );
 
    if ( mask & BUFFER_BIT_FRONT_LEFT ) {
index c56a49d5ad6f06a1956d70446c07c4a62cbcd582..dad2bc76ab61e5713ae086e4d7cb395ffd7ea19c 100644 (file)
@@ -851,8 +851,6 @@ r200PointsBitmap( struct gl_context *ctx, GLint px, GLint py,
 
    /* Update window height
     */
-   LOCK_HARDWARE( &rmesa->radeon );
-   UNLOCK_HARDWARE( &rmesa->radeon );
    h = radeon_get_drawable(&rmesa->radeon)->h + radeon_get_drawable(&rmesa->radeon)->y;
    px += radeon_get_drawable(&rmesa->radeon)->x;
 
diff --git a/src/mesa/drivers/dri/r200/radeon_lock.c b/src/mesa/drivers/dri/r200/radeon_lock.c
deleted file mode 120000 (symlink)
index af4108a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../radeon/radeon_lock.c
\ No newline at end of file
diff --git a/src/mesa/drivers/dri/r200/radeon_lock.h b/src/mesa/drivers/dri/r200/radeon_lock.h
deleted file mode 120000 (symlink)
index 64bdf94..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../radeon/radeon_lock.h
\ No newline at end of file
index 5ee8022b8dcb3c0ac785091043b1a1380a5f0de9..e54891f4d8984e33f8f57c01ac2e77d2c46c95c2 100644 (file)
@@ -21,7 +21,6 @@ RADEON_COMMON_SOURCES = \
        radeon_dma.c \
        radeon_debug.c \
        radeon_fbo.c \
-       radeon_lock.c \
        radeon_mipmap_tree.c \
        radeon_pixel_read.c \
        radeon_queryobj.c \
index 51ae9cc7bf47e714983d5f117be2acb4fc1a0f65..64a7c3f33ff6a04a27cbb318847e9c05f0ae7d4a 100644 (file)
@@ -54,7 +54,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #include "radeon_common.h"
 #include "radeon_bocs_wrapper.h"
-#include "radeon_lock.h"
 #include "radeon_drm.h"
 #include "radeon_queryobj.h"
 
@@ -277,58 +276,6 @@ uint32_t radeonGetAge(radeonContextPtr radeon)
        return age;
 }
 
-
-/* wait for idle */
-void radeonWaitForIdleLocked(radeonContextPtr radeon)
-{
-       int ret;
-       int i = 0;
-
-       do {
-               ret = drmCommandNone(radeon->dri.fd, DRM_RADEON_CP_IDLE);
-               if (ret)
-                       DO_USLEEP(1);
-       } while (ret && ++i < 100);
-
-       if (ret < 0) {
-               UNLOCK_HARDWARE(radeon);
-               fprintf(stderr, "Error: R300 timed out... exiting\n");
-               exit(-1);
-       }
-}
-
-static void radeon_flip_renderbuffers(struct radeon_framebuffer *rfb)
-{
-       int current_page = rfb->pf_current_page;
-       int next_page = (current_page + 1) % rfb->pf_num_pages;
-       struct gl_renderbuffer *tmp_rb;
-
-       /* Exchange renderbuffers if necessary but make sure their
-        * reference counts are preserved.
-        */
-       if (rfb->color_rb[current_page] &&
-           rfb->base.Attachment[BUFFER_FRONT_LEFT].Renderbuffer !=
-           &rfb->color_rb[current_page]->base) {
-               tmp_rb = NULL;
-               _mesa_reference_renderbuffer(&tmp_rb,
-                                            rfb->base.Attachment[BUFFER_FRONT_LEFT].Renderbuffer);
-               tmp_rb = &rfb->color_rb[current_page]->base;
-               _mesa_reference_renderbuffer(&rfb->base.Attachment[BUFFER_FRONT_LEFT].Renderbuffer, tmp_rb);
-               _mesa_reference_renderbuffer(&tmp_rb, NULL);
-       }
-
-       if (rfb->color_rb[next_page] &&
-           rfb->base.Attachment[BUFFER_BACK_LEFT].Renderbuffer !=
-           &rfb->color_rb[next_page]->base) {
-               tmp_rb = NULL;
-               _mesa_reference_renderbuffer(&tmp_rb,
-                                            rfb->base.Attachment[BUFFER_BACK_LEFT].Renderbuffer);
-               tmp_rb = &rfb->color_rb[next_page]->base;
-               _mesa_reference_renderbuffer(&rfb->base.Attachment[BUFFER_BACK_LEFT].Renderbuffer, tmp_rb);
-               _mesa_reference_renderbuffer(&tmp_rb, NULL);
-       }
-}
-
 /**
  * Check if we're about to draw into the front color buffer.
  * If so, set the intel->front_buffer_dirty field to true.
@@ -556,27 +503,10 @@ void radeonReadBuffer( struct gl_context *ctx, GLenum mode )
        }
 }
 
-
-/* Turn on/off page flipping according to the flags in the sarea:
- */
-void radeonUpdatePageFlipping(radeonContextPtr radeon)
-{
-       struct radeon_framebuffer *rfb = radeon_get_drawable(radeon)->driverPrivate;
-
-       rfb->pf_active = radeon->sarea->pfState;
-       rfb->pf_current_page = radeon->sarea->pfCurrentPage;
-       rfb->pf_num_pages = 2;
-       radeon_flip_renderbuffers(rfb);
-       radeon_draw_buffer(radeon->glCtx, radeon->glCtx->DrawBuffer);
-}
-
 void radeon_window_moved(radeonContextPtr radeon)
 {
        /* Cliprects has to be updated before doing anything else */
        radeonSetCliprects(radeon);
-       if (!radeon->radeonScreen->driScreen->dri2.enabled) {
-               radeonUpdatePageFlipping(radeon);
-       }
 }
 
 void radeon_viewport(struct gl_context *ctx, GLint x, GLint y, GLsizei width, GLsizei height)
@@ -862,9 +792,7 @@ int rcommonFlushCmdBuf(radeonContextPtr rmesa, const char *caller)
 
        radeonReleaseDmaRegions(rmesa);
 
-       LOCK_HARDWARE(rmesa);
        ret = rcommonFlushCmdBufLocked(rmesa, caller);
-       UNLOCK_HARDWARE(rmesa);
 
        if (ret) {
                fprintf(stderr, "drmRadeonCmdBuffer: %d. Kernel failed to "
index 0389f5a0b642370e49fa1628285a8d9a8231ced9..344250efcef3ae91829444ff3252a0094df9e5c7 100644 (file)
@@ -11,11 +11,8 @@ void radeonSetCliprects(radeonContextPtr radeon);
 void radeonUpdateScissor( struct gl_context *ctx );
 void radeonScissor(struct gl_context* ctx, GLint x, GLint y, GLsizei w, GLsizei h);
 
-void radeonWaitForIdleLocked(radeonContextPtr radeon);
 extern uint32_t radeonGetAge(radeonContextPtr radeon);
 
-void radeonUpdatePageFlipping(radeonContextPtr rmesa);
-
 void radeonFlush(struct gl_context *ctx);
 void radeonFinish(struct gl_context * ctx);
 void radeonEmitState(radeonContextPtr radeon);
index de71aa2c6dd35dafc149e4f2c81591ca4022a37e..90c36684df8639d15607ee931fd6c3ce4bd65954 100644 (file)
@@ -60,8 +60,6 @@ struct r100_context;
 typedef struct r100_context r100ContextRec;
 typedef struct r100_context *r100ContextPtr;
 
-#include "radeon_lock.h"
-
 
 
 #define R100_TEX_ALL 0x7
index 03d4e9656d708e14ac3a1dfa12077cd6ac671241..1f87a0fa16dc83f193c9c859bd7a777a3042a2bf 100644 (file)
@@ -328,11 +328,6 @@ void radeonReleaseDmaRegions(radeonContextPtr rmesa)
                      __FUNCTION__, free, wait, reserved, rmesa->dma.minimum_size);
        }
 
-       if (!rmesa->radeonScreen->driScreen->dri2.enabled) {
-               /* request updated cs processing information from kernel */
-               legacy_track_pending(rmesa->radeonScreen->bom, 0);
-       }
-
        /* move waiting bos to free list.
           wait list provides gpu time to handle data before reuse */
        foreach_s(dma_bo, temp, &rmesa->dma.wait) {
index bbc0467fdded43baa4db480258b2e79bbb796a6e..d1ae9fcb72086e8706da9fc953ebdf3285960643 100644 (file)
@@ -383,7 +383,6 @@ void radeonEmitAOS( r100ContextPtr rmesa,
 static void radeonClear( struct gl_context *ctx, GLbitfield mask )
 {
    r100ContextPtr rmesa = R100_CONTEXT(ctx);
-   __DRIdrawable *dPriv = radeon_get_drawable(&rmesa->radeon);
    GLuint flags = 0;
    GLuint orig_mask = mask;
 
@@ -395,13 +394,6 @@ static void radeonClear( struct gl_context *ctx, GLbitfield mask )
       fprintf( stderr, "radeonClear\n");
    }
 
-   {
-      LOCK_HARDWARE( &rmesa->radeon );
-      UNLOCK_HARDWARE( &rmesa->radeon );
-      if ( dPriv->numClipRects == 0 )
-        return;
-   }
-
    radeon_firevertices(&rmesa->radeon);
 
    if ( mask & BUFFER_BIT_FRONT_LEFT ) {
index c92d54e8fc7e7e2a84be29c32ea006efade2d5bc..d7d1d84282b66855282cac0397bd579024d04577 100644 (file)
@@ -37,7 +37,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #define __RADEON_IOCTL_H__
 
 #include "main/simple_list.h"
-#include "radeon_lock.h"
 #include "radeon_bocs_wrapper.h"
 
 extern void radeonEmitVertexAOS( r100ContextPtr rmesa,
diff --git a/src/mesa/drivers/dri/radeon/radeon_lock.c b/src/mesa/drivers/dri/radeon/radeon_lock.c
deleted file mode 100644 (file)
index ae8a212..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-/**************************************************************************
-
-Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
-                     VA Linux Systems Inc., Fremont, California.
-Copyright (C) The Weather Channel, Inc.  2002.  All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- *   Gareth Hughes <gareth@valinux.com>
- *   Keith Whitwell <keith@tungstengraphics.com>
- *   Kevin E. Martin <martin@valinux.com>
- */
-
-#include "main/glheader.h"
-#include "main/mtypes.h"
-#include "main/colormac.h"
-#include "dri_util.h"
-#include "radeon_screen.h"
-#include "radeon_common.h"
-#include "radeon_lock.h"
-
-/* Update the hardware state.  This is called if another context has
- * grabbed the hardware lock, which includes the X server.  This
- * function also updates the driver's window state after the X server
- * moves, resizes or restacks a window -- the change will be reflected
- * in the drawable position and clip rects.  Since the X server grabs
- * the hardware lock when it changes the window state, this routine will
- * automatically be called after such a change.
- */
-void radeonGetLock(radeonContextPtr rmesa, GLuint flags)
-{
-       __DRIdrawable *const drawable = radeon_get_drawable(rmesa);
-       __DRIdrawable *const readable = radeon_get_readable(rmesa);
-       __DRIscreen *sPriv = rmesa->dri.screen;
-
-       drmGetLock(rmesa->dri.fd, rmesa->dri.hwContext, flags);
-
-       /* The window might have moved, so we might need to get new clip
-        * rects.
-        *
-        * NOTE: This releases and regrabs the hw lock to allow the X server
-        * to respond to the DRI protocol request for new drawable info.
-        * Since the hardware state depends on having the latest drawable
-        * clip rects, all state checking must be done _after_ this call.
-        */
-       if (drawable)
-               DRI_VALIDATE_DRAWABLE_INFO(sPriv, drawable);
-       if (readable && drawable != readable) {
-               DRI_VALIDATE_DRAWABLE_INFO(sPriv, readable);
-       }
-
-       if (drawable && (rmesa->lastStamp != drawable->lastStamp)) {
-               radeon_window_moved(rmesa);
-               rmesa->lastStamp = drawable->lastStamp;
-       }
-
-       rmesa->vtbl.get_lock(rmesa);
-}
-#ifndef NDEBUG
-struct lock_debug {
-       const char* function;
-       const char* file;
-       int line;
-};
-
-static struct lock_debug ldebug = {0};
-#endif
-
-#if 0
-/** TODO: use atomic operations for reference counting **/
-/** gcc 4.2 has builtin functios for this **/
-#define ATOMIC_INC_AND_FETCH(atomic) __sync_add_and_fetch(&atomic, 1)
-#define ATOMIC_DEC_AND_FETCH(atomic) __sync_sub_and_fetch(&atomic, 1)
-#else
-#define ATOMIC_INC_AND_FETCH(atomic) (++atomic)
-#define ATOMIC_DEC_AND_FETCH(atomic) (--atomic)
-#endif
-
-
-void radeon_lock_hardware(radeonContextPtr radeon
-#ifndef NDEBUG
-               ,const char* function
-               ,const char* file
-               ,const int line
-#endif
-               )
-{
-       char ret = 0;
-
-       if (!radeon->radeonScreen->driScreen->dri2.enabled) {
-               if (ATOMIC_INC_AND_FETCH(radeon->dri.hwLockCount) > 1)
-               {
-#ifndef NDEBUG
-                       if ( RADEON_DEBUG & RADEON_SANITY )
-                               fprintf(stderr, "*** %d times of recursive call to %s ***\n"
-                                               "Original call was from %s (file: %s line: %d)\n"
-                                               "Now call is coming from %s (file: %s line: %d)\n"
-                                               , radeon->dri.hwLockCount, __FUNCTION__
-                                               , ldebug.function, ldebug.file, ldebug.line
-                                               , function, file, line
-                                          );
-#endif
-                       return;
-               }
-               DRM_CAS(radeon->dri.hwLock, radeon->dri.hwContext,
-                        (DRM_LOCK_HELD | radeon->dri.hwContext), ret );
-               if (ret)
-                       radeonGetLock(radeon, 0);
-#ifndef NDEBUG
-               ldebug.function = function;
-               ldebug.file = file;
-               ldebug.line = line;
-#endif
-       }
-}
-
-void radeon_unlock_hardware(radeonContextPtr radeon)
-{
-       if (!radeon->radeonScreen->driScreen->dri2.enabled) {
-               if (ATOMIC_DEC_AND_FETCH(radeon->dri.hwLockCount) > 0)
-               {
-                       return;
-               }
-               DRM_UNLOCK( radeon->dri.fd,
-                           radeon->dri.hwLock,
-                           radeon->dri.hwContext );
-       }
-}
diff --git a/src/mesa/drivers/dri/radeon/radeon_lock.h b/src/mesa/drivers/dri/radeon/radeon_lock.h
deleted file mode 100644 (file)
index da5a5b4..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/**************************************************************************
-
-Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
-                     VA Linux Systems Inc., Fremont, California.
-Copyright (C) The Weather Channel, Inc.  2002.  All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- *   Gareth Hughes <gareth@valinux.com>
- *   Keith Whitwell <keith@tungstengraphics.com>
- *   Kevin E. Martin <martin@valinux.com>
- */
-
-#ifndef COMMON_LOCK_H
-#define COMMON_LOCK_H
-
-#include "main/colormac.h"
-#include "radeon_screen.h"
-#include "radeon_common.h"
-
-extern void radeonGetLock(radeonContextPtr rmesa, GLuint flags);
-
-void radeon_lock_hardware(radeonContextPtr rmesa
-#ifndef NDEBUG
-               ,const char* function
-               ,const char* file
-               ,const int line
-#endif
-               );
-void radeon_unlock_hardware(radeonContextPtr rmesa);
-
-/* Lock the hardware and validate our state.
- */
-#ifdef NDEBUG
-#define LOCK_HARDWARE( rmesa ) radeon_lock_hardware(rmesa)
-#else
-#define LOCK_HARDWARE( rmesa ) radeon_lock_hardware(rmesa, __FUNCTION__, __FILE__, __LINE__)
-#endif
-#define UNLOCK_HARDWARE( rmesa )  radeon_unlock_hardware(rmesa)
-
-#endif
index 9d88ce98f0928d76a526bb3d28dcaa15d7133d56..dbb167124b82bf7dedaccac42b31780c8d39517f 100644 (file)
@@ -45,7 +45,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "swrast/swrast.h"
 
 #include "radeon_common.h"
-#include "radeon_lock.h"
 #include "radeon_span.h"
 
 #define DBG 0
@@ -608,16 +607,6 @@ static void radeonSpanRenderStart(struct gl_context * ctx)
 
        radeon_firevertices(rmesa);
 
-       /* The locking and wait for idle should really only be needed in classic mode.
-        * In a future memory manager based implementation, this should become
-        * unnecessary due to the fact that mapping our buffers, textures, etc.
-        * should implicitly wait for any previous rendering commands that must
-        * be waited on. */
-       if (!rmesa->radeonScreen->driScreen->dri2.enabled) {
-               LOCK_HARDWARE(rmesa);
-               radeonWaitForIdleLocked(rmesa);
-       }
-
        for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) {
                if (ctx->Texture.Unit[i]._ReallyEnabled)
                        ctx->Driver.MapTexture(ctx, ctx->Texture.Unit[i]._Current);
@@ -630,7 +619,6 @@ static void radeonSpanRenderStart(struct gl_context * ctx)
 
 static void radeonSpanRenderFinish(struct gl_context * ctx)
 {
-       radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
        int i;
 
        _swrast_flush(ctx);
@@ -643,10 +631,6 @@ static void radeonSpanRenderFinish(struct gl_context * ctx)
        radeon_map_unmap_framebuffer(ctx, ctx->DrawBuffer, GL_FALSE);
        if (ctx->ReadBuffer != ctx->DrawBuffer)
                radeon_map_unmap_framebuffer(ctx, ctx->ReadBuffer, GL_FALSE);
-
-       if (!rmesa->radeonScreen->driScreen->dri2.enabled) {
-               UNLOCK_HARDWARE(rmesa);
-       }
 }
 
 void radeonInitSpanFuncs(struct gl_context * ctx)