diff options
author | Dave Airlie <airlied@redhat.com> | 2009-01-14 12:04:00 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-01-14 12:04:00 +1000 |
commit | d29e96bf33e91d071770b86d87ffc4ef4dfc2f70 (patch) | |
tree | ad017737e96a99ce1bedb0d9df3d60ea393339d9 /src/mesa/drivers/dri/r200/r200_lock.h | |
parent | 4637235183b80963536f2364e4d50fcb894886dd (diff) |
radeon/r200/r300: attempt to move lock to common code
Diffstat (limited to 'src/mesa/drivers/dri/r200/r200_lock.h')
-rw-r--r-- | src/mesa/drivers/dri/r200/r200_lock.h | 68 |
1 files changed, 1 insertions, 67 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_lock.h b/src/mesa/drivers/dri/r200/r200_lock.h index f1cb624d8f..29cad5b226 100644 --- a/src/mesa/drivers/dri/r200/r200_lock.h +++ b/src/mesa/drivers/dri/r200/r200_lock.h @@ -35,72 +35,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef __R200_LOCK_H__ #define __R200_LOCK_H__ -extern void r200GetLock( r200ContextPtr rmesa, GLuint flags ); - -/* Turn DEBUG_LOCKING on to find locking conflicts. - */ -#define DEBUG_LOCKING 0 - -#if DEBUG_LOCKING -extern char *prevLockFile; -extern int prevLockLine; - -#define DEBUG_LOCK() \ - do { \ - prevLockFile = (__FILE__); \ - prevLockLine = (__LINE__); \ - } while (0) - -#define DEBUG_RESET() \ - do { \ - prevLockFile = 0; \ - prevLockLine = 0; \ - } while (0) - -#define DEBUG_CHECK_LOCK() \ - do { \ - if ( prevLockFile ) { \ - fprintf( stderr, \ - "LOCK SET!\n\tPrevious %s:%d\n\tCurrent: %s:%d\n", \ - prevLockFile, prevLockLine, __FILE__, __LINE__ ); \ - exit( 1 ); \ - } \ - } while (0) - -#else - -#define DEBUG_LOCK() -#define DEBUG_RESET() -#define DEBUG_CHECK_LOCK() - -#endif - -/* - * !!! We may want to separate locks from locks with validation. This - * could be used to improve performance for those things commands that - * do not do any drawing !!! - */ - - -/* Lock the hardware and validate our state. - */ -#define LOCK_HARDWARE( rmesa ) \ - do { \ - char __ret = 0; \ - DEBUG_CHECK_LOCK(); \ - DRM_CAS( rmesa->radeon.dri.hwLock, rmesa->radeon.dri.hwContext, \ - (DRM_LOCK_HELD | rmesa->radeon.dri.hwContext), __ret ); \ - if ( __ret ) \ - r200GetLock( rmesa, 0 ); \ - DEBUG_LOCK(); \ - } while (0) - -#define UNLOCK_HARDWARE( rmesa ) \ - do { \ - DRM_UNLOCK( rmesa->radeon.dri.fd, \ - rmesa->radeon.dri.hwLock, \ - rmesa->radeon.dri.hwContext ); \ - DEBUG_RESET(); \ - } while (0) +#include "common_lock.h" #endif /* __R200_LOCK_H__ */ |