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