Remove CVS keywords.
[mesa.git] / src / mesa / drivers / dri / gamma / gamma_lock.c
1
2 #include "gamma_context.h"
3 #include "gamma_lock.h"
4 #include "drirenderbuffer.h"
5
6 #ifdef DEBUG_LOCKING
7 char *prevLockFile = NULL;
8 int prevLockLine = 0;
9 #endif
10
11
12 /* Update the hardware state. This is called if another context has
13 * grabbed the hardware lock, which includes the X server. This
14 * function also updates the driver's window state after the X server
15 * moves, resizes or restacks a window -- the change will be reflected
16 * in the drawable position and clip rects. Since the X server grabs
17 * the hardware lock when it changes the window state, this routine will
18 * automatically be called after such a change.
19 */
20 void gammaGetLock( gammaContextPtr gmesa, GLuint flags )
21 {
22 __DRIdrawablePrivate *dPriv = gmesa->driDrawable;
23 __DRIscreenPrivate *sPriv = gmesa->driScreen;
24
25 drmGetLock( gmesa->driFd, gmesa->hHWContext, flags );
26
27 /* The window might have moved, so we might need to get new clip
28 * rects.
29 *
30 * NOTE: This releases and regrabs the hw lock to allow the X server
31 * to respond to the DRI protocol request for new drawable info.
32 * Since the hardware state depends on having the latest drawable
33 * clip rects, all state checking must be done _after_ this call.
34 */
35 DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv );
36
37 if ( gmesa->lastStamp != dPriv->lastStamp ) {
38 driUpdateFramebufferSize(gmesa->glCtx, dPriv);
39 gmesa->lastStamp = dPriv->lastStamp;
40 gmesa->new_state |= GAMMA_NEW_WINDOW | GAMMA_NEW_CLIP;
41 }
42
43 gmesa->numClipRects = dPriv->numClipRects;
44 gmesa->pClipRects = dPriv->pClipRects;
45
46 #if 0
47 gmesa->dirty = ~0;
48
49 if ( sarea->ctxOwner != gmesa->hHWContext ) {
50 sarea->ctxOwner = gmesa->hHWContext;
51 gmesa->dirty = GAMMA_UPLOAD_ALL;
52 }
53
54 for ( i = 0 ; i < gmesa->lastTexHeap ; i++ ) {
55 if ( sarea->texAge[i] != gmesa->lastTexAge[i] ) {
56 gammaAgeTextures( gmesa, i );
57 }
58 }
59 #endif
60 }