Merge commit 'origin/master' into gallium-map-range
[mesa.git] / src / mesa / drivers / dri / radeon / radeon_lock.h
index e18a642088acda81efc7e362f1d6daeab45cee10..86e96aa7d2c614bf3bbcf6f658b6a179039773ad 100644 (file)
@@ -1,8 +1,12 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_lock.h,v 1.3 2002/10/30 12:51:55 alanh Exp $ */
 /**************************************************************************
 
 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.
 
@@ -30,16 +34,15 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 /*
  * Authors:
- *   Kevin E. Martin <martin@valinux.com>
  *   Gareth Hughes <gareth@valinux.com>
+ *   Keith Whitwell <keith@tungstengraphics.com>
+ *   Kevin E. Martin <martin@valinux.com>
  */
 
 #ifndef __RADEON_LOCK_H__
 #define __RADEON_LOCK_H__
 
-#ifdef GLX_DIRECT_RENDERING
-
-extern void radeonGetLock( radeonContextPtr rmesa, GLuint flags );
+extern void radeonGetLock(radeonContextPtr rmesa, GLuint flags);
 
 /* Turn DEBUG_LOCKING on to find locking conflicts.
  */
@@ -85,38 +88,25 @@ extern int prevLockLine;
  * 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->dri.hwLock, rmesa->dri.hwContext,                \
-              (DRM_LOCK_HELD | rmesa->dri.hwContext), __ret ); \
+      DRM_CAS( (rmesa)->dri.hwLock, (rmesa)->dri.hwContext,            \
+              (DRM_LOCK_HELD | (rmesa)->dri.hwContext), __ret );       \
       if ( __ret )                                             \
-        radeonGetLock( rmesa, 0 );                             \
+        radeonGetLock( (rmesa), 0 );                           \
       DEBUG_LOCK();                                            \
    } while (0)
 
-/* Unlock the hardware.  We must assume that state has been lost when we unlock,
- * because when we next grab the lock (to emit an accumulated cmdbuf), we don't
- * have the information to recreate the context state as of the last unlock in
- * in the case that we did lose the context state.
- *
- * The alternative to this would be to copy out the state on unlock
- * (approximately) and if we did lose the context, dispatch a cmdbuf to reset
- * the state to that old copy before continuing with the accumulated command
- * buffer.
- */
 #define UNLOCK_HARDWARE( rmesa )                                       \
    do {                                                                        \
-      DRM_UNLOCK( rmesa->dri.fd,                                       \
-                 rmesa->dri.hwLock,                                    \
-                 rmesa->dri.hwContext );                               \
+      DRM_UNLOCK( (rmesa)->dri.fd,                                     \
+                 (rmesa)->dri.hwLock,                                  \
+                 (rmesa)->dri.hwContext );                             \
       DEBUG_RESET();                                                   \
-      rmesa->lost_context = GL_TRUE;                                   \
    } while (0)
 
-#endif
-#endif /* __RADEON_LOCK_H__ */
+#endif                         /* __RADEON_LOCK_H__ */