diff options
Diffstat (limited to 'src/mesa/drivers/dri/r300/radeon_lock.h')
-rw-r--r-- | src/mesa/drivers/dri/r300/radeon_lock.h | 55 |
1 files changed, 24 insertions, 31 deletions
diff --git a/src/mesa/drivers/dri/r300/radeon_lock.h b/src/mesa/drivers/dri/r300/radeon_lock.h index 632329fde1e..c47adc9575b 100644 --- a/src/mesa/drivers/dri/r300/radeon_lock.h +++ b/src/mesa/drivers/dri/r300/radeon_lock.h @@ -1,10 +1,15 @@ -/* +/************************************************************************** + +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 @@ -29,7 +34,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. /* * Authors: + * Gareth Hughes <[email protected]> * Keith Whitwell <[email protected]> + * Kevin E. Martin <[email protected]> */ #ifndef __RADEON_LOCK_H__ @@ -40,7 +47,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #endif #include "radeon_context.h" -extern void radeonGetLock(radeonContextPtr radeon, GLuint flags); +extern void radeonGetLock(radeonContextPtr rmesa, GLuint flags); +extern void radeonUpdatePageFlipping(radeonContextPtr rmesa); /* Turn DEBUG_LOCKING on to find locking conflicts. */ @@ -64,11 +72,11 @@ extern int prevLockLine; #define DEBUG_CHECK_LOCK() \ do { \ - if ( prevLockFile ) { \ - fprintf( stderr, \ + if (prevLockFile) { \ + fprintf(stderr, \ "LOCK SET!\n\tPrevious %s:%d\n\tCurrent: %s:%d\n", \ - prevLockFile, prevLockLine, __FILE__, __LINE__ ); \ - exit( 1 ); \ + prevLockFile, prevLockLine, __FILE__, __LINE__); \ + exit(1); \ } \ } while (0) @@ -88,38 +96,23 @@ extern int prevLockLine; /* Lock the hardware and validate our state. */ -#define LOCK_HARDWARE( radeon ) \ +#define LOCK_HARDWARE( rmesa ) \ do { \ char __ret = 0; \ DEBUG_CHECK_LOCK(); \ - DRM_CAS( (radeon)->dri.hwLock, (radeon)->dri.hwContext, \ - (DRM_LOCK_HELD | (radeon)->dri.hwContext), __ret ); \ - if ( __ret ) \ - radeonGetLock( (radeon), 0 ); \ + DRM_CAS((rmesa)->dri.hwLock, (rmesa)->dri.hwContext, \ + (DRM_LOCK_HELD | (rmesa)->dri.hwContext), __ret); \ + if (__ret) \ + radeonGetLock((rmesa), 0); \ DEBUG_LOCK(); \ } while (0) -#if R200_MERGED -#define UNLOCK_HARDWARE( radeon ) \ +#define UNLOCK_HARDWARE( rmesa ) \ do { \ - DRM_UNLOCK( (radeon)->dri.fd, \ - (radeon)->dri.hwLock, \ - (radeon)->dri.hwContext ); \ + DRM_UNLOCK((rmesa)->dri.fd, \ + (rmesa)->dri.hwLock, \ + (rmesa)->dri.hwContext); \ DEBUG_RESET(); \ - if (IS_R200_CLASS(radeon->radeonScreen)) { \ - r200ContextPtr __r200 = (r200ContextPtr)(radeon); \ - if (__r200->save_on_next_unlock) \ - r200SaveHwState( __r200 ); \ - __r200->save_on_next_unlock = GL_FALSE; \ - } \ } while (0) -#else -#define UNLOCK_HARDWARE( radeon ) \ - do { \ - DRM_UNLOCK( (radeon)->dri.fd, \ - (radeon)->dri.hwLock, \ - (radeon)->dri.hwContext ); \ - DEBUG_RESET(); \ - } while (0) -#endif + #endif /* __RADEON_LOCK_H__ */ |