1
/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_lock.h,v 1.1 2002/10/30 12:51:52 alanh Exp $ */
3
Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
5
The Weather Channel (TM) funded Tungsten Graphics to develop the
6
initial release of the Radeon 8500 driver under the XFree86 license.
7
This notice must be preserved.
9
Permission is hereby granted, free of charge, to any person obtaining
10
a copy of this software and associated documentation files (the
11
"Software"), to deal in the Software without restriction, including
12
without limitation the rights to use, copy, modify, merge, publish,
13
distribute, sublicense, and/or sell copies of the Software, and to
14
permit persons to whom the Software is furnished to do so, subject to
15
the following conditions:
17
The above copyright notice and this permission notice (including the
18
next paragraph) shall be included in all copies or substantial
19
portions of the Software.
21
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
24
IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
25
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
26
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
27
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29
**************************************************************************/
33
* Keith Whitwell <keith@tungstengraphics.com>
36
#ifndef __R200_LOCK_H__
37
#define __R200_LOCK_H__
39
extern void r200GetLock( r200ContextPtr rmesa, GLuint flags );
41
/* Turn DEBUG_LOCKING on to find locking conflicts.
43
#define DEBUG_LOCKING 0
46
extern char *prevLockFile;
47
extern int prevLockLine;
49
#define DEBUG_LOCK() \
51
prevLockFile = (__FILE__); \
52
prevLockLine = (__LINE__); \
55
#define DEBUG_RESET() \
61
#define DEBUG_CHECK_LOCK() \
63
if ( prevLockFile ) { \
65
"LOCK SET!\n\tPrevious %s:%d\n\tCurrent: %s:%d\n", \
66
prevLockFile, prevLockLine, __FILE__, __LINE__ ); \
75
#define DEBUG_CHECK_LOCK()
80
* !!! We may want to separate locks from locks with validation. This
81
* could be used to improve performance for those things commands that
82
* do not do any drawing !!!
86
/* Lock the hardware and validate our state.
88
#define LOCK_HARDWARE( rmesa ) \
92
DRM_CAS( rmesa->dri.hwLock, rmesa->dri.hwContext, \
93
(DRM_LOCK_HELD | rmesa->dri.hwContext), __ret ); \
95
r200GetLock( rmesa, 0 ); \
99
#define UNLOCK_HARDWARE( rmesa ) \
101
DRM_UNLOCK( rmesa->dri.fd, \
103
rmesa->dri.hwContext ); \
107
#endif /* __R200_LOCK_H__ */