2 * Author: Max Lingua <sunmax@libero.it>
5 #include "s3v_context.h"
8 char *prevLockFile
= NULL
;
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.
21 void s3vGetLock( s3vContextPtr vmesa
, GLuint flags
)
23 __DRIdrawablePrivate
*dPriv
= vmesa
->driDrawable
;
24 /* __DRIscreenPrivate *sPriv = vmesa->driScreen; */
26 printf("s3vGetLock <- ***\n");
28 drmGetLock( vmesa
->driFd
, vmesa
->hHWContext
, flags
);
30 /* The window might have moved, so we might need to get new clip
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.
38 /* DRI_VALIDATE_DRAWABLE_INFO( vmesa->display, sPriv, dPriv ); */
40 if ( vmesa
->lastStamp
!= dPriv
->lastStamp
) {
41 vmesa
->lastStamp
= dPriv
->lastStamp
;
42 vmesa
->new_state
|= S3V_NEW_WINDOW
| S3V_NEW_CLIP
;
45 vmesa
->numClipRects
= dPriv
->numClipRects
;
46 vmesa
->pClipRects
= dPriv
->pClipRects
;
51 if ( sarea
->ctxOwner
!= vmesa
->hHWContext
) {
52 sarea
->ctxOwner
= vmesa
->hHWContext
;
53 vmesa
->dirty
= S3V_UPLOAD_ALL
;
56 for ( i
= 0 ; i
< vmesa
->lastTexHeap
; i
++ ) {
57 if ( sarea
->texAge
[i
] != vmesa
->lastTexAge
[i
] ) {
58 s3vAgeTextures( vmesa
, i
);