summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/r300/radeon_lock.h
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2009-01-14 15:12:57 +1000
committerDave Airlie <[email protected]>2009-01-14 15:14:09 +1000
commit61da612a4f8862e0aac4ff4fc87c133cb8a1c4a5 (patch)
tree33b7a7d7f840048c3f8fab8f8e693dce5ea59dab /src/mesa/drivers/dri/r300/radeon_lock.h
parent23295cf8e84495af86f62395d32b3116261927e8 (diff)
r300: start moving new r300 cmdbuf into common code
Diffstat (limited to 'src/mesa/drivers/dri/r300/radeon_lock.h')
-rw-r--r--src/mesa/drivers/dri/r300/radeon_lock.h74
1 files changed, 1 insertions, 73 deletions
diff --git a/src/mesa/drivers/dri/r300/radeon_lock.h b/src/mesa/drivers/dri/r300/radeon_lock.h
index eaef49c3253..f2d17a54d47 100644
--- a/src/mesa/drivers/dri/r300/radeon_lock.h
+++ b/src/mesa/drivers/dri/r300/radeon_lock.h
@@ -42,78 +42,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef __RADEON_LOCK_H__
#define __RADEON_LOCK_H__
-#include "radeon_context.h"
-
-extern void radeonGetLock(radeonContextPtr rmesa, GLuint flags);
-extern void radeonUpdatePageFlipping(radeonContextPtr rmesa);
-
-/* 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(); \
- if (!(rmesa)->radeonScreen->driScreen->dri2.enabled) { \
- DRM_CAS((rmesa)->dri.hwLock, (rmesa)->dri.hwContext, \
- (DRM_LOCK_HELD | (rmesa)->dri.hwContext), __ret); \
- if (__ret) \
- radeonGetLock((rmesa), 0); \
- }\
- DEBUG_LOCK(); \
- } while (0)
-
-#define UNLOCK_HARDWARE( rmesa ) \
- do { \
- if (!(rmesa)->radeonScreen->driScreen->dri2.enabled) { \
- DRM_UNLOCK((rmesa)->dri.fd, \
- (rmesa)->dri.hwLock, \
- (rmesa)->dri.hwContext); \
- DEBUG_RESET(); \
- }\
- } while (0)
+#include "common_lock.h"
#endif /* __RADEON_LOCK_H__ */