1
/**************************************************************************
3
Copyright 2006 Stephane Marchesin
6
Permission is hereby granted, free of charge, to any person obtaining a
7
copy of this software and associated documentation files (the "Software"),
8
to deal in the Software without restriction, including without limitation
9
on the rights to use, copy, modify, merge, publish, distribute, sub
10
license, and/or sell copies of the Software, and to permit persons to whom
11
the Software is furnished to do so, subject to the following conditions:
13
The above copyright notice and this permission notice (including the next
14
paragraph) shall be included in all copies or substantial portions of the
17
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
20
ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
21
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
22
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
23
USE OR OTHER DEALINGS IN THE SOFTWARE.
25
**************************************************************************/
28
#ifndef __NOUVEAU_LOCK_H__
29
#define __NOUVEAU_LOCK_H__
31
#include "nouveau_context.h"
33
extern void nouveauGetLock( nouveauContextPtr nmesa, GLuint flags );
36
* !!! We may want to separate locks from locks with validation. This
37
* could be used to improve performance for those things commands that
38
* do not do any drawing !!!
41
/* Lock the hardware and validate our state.
43
#define LOCK_HARDWARE( nmesa ) \
47
DRM_CAS( nmesa->driHwLock, nmesa->hHWContext, \
48
(DRM_LOCK_HELD | nmesa->hHWContext), __ret ); \
50
nouveauGetLock( nmesa, 0 ); \
54
/* Unlock the hardware.
56
#define UNLOCK_HARDWARE( nmesa ) \
58
DRM_UNLOCK( nmesa->driFd, \
60
nmesa->hHWContext ); \
66
#define DEBUG_CHECK_LOCK()
69
#endif /* __NOUVEAU_LOCK_H__ */