summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2003-03-24 15:41:32 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2003-03-24 15:41:32 +0000
commit56c896a2b8f02fbcf57d308eeefe593cf9fd8de5 (patch)
tree21e3bf9335ec1fdabc6f4d75b30a98715d4c808a
parentafc72872bee6c7952f33514acdc0a102ac5debe0 (diff)
Some hacks to make prototype VT switching facilities less prone to lockups.
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_lock.c32
1 files changed, 28 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_lock.c b/src/mesa/drivers/dri/radeon/radeon_lock.c
index 655ae82e51..5bc74836a5 100644
--- a/src/mesa/drivers/dri/radeon/radeon_lock.c
+++ b/src/mesa/drivers/dri/radeon/radeon_lock.c
@@ -170,10 +170,22 @@ void radeonGetLock( radeonContextPtr rmesa, GLuint flags )
RADEONSAREAPrivPtr sarea = rmesa->sarea;
int i;
- fprintf(stderr, "%s\n", __FUNCTION__);
- drmGetLock( rmesa->dri.fd, rmesa->dri.hwContext, flags );
- validate_drawable( rmesa );
+ while (1) {
+ drmGetLock( rmesa->dri.fd, rmesa->dri.hwContext, flags );
+
+ validate_drawable( rmesa );
+
+ fprintf(stderr, "%s %d\n", __FUNCTION__, rmesa->numClipRects);
+
+ if (rmesa->numClipRects)
+ break;
+
+ drmUnlock( rmesa->dri.fd, rmesa->dri.hwContext );
+
+ sleep(10);
+ }
+
if ( sarea->ctxOwner != rmesa->dri.hwContext ) {
sarea->ctxOwner = rmesa->dri.hwContext;
@@ -187,12 +199,24 @@ void radeonGetLock( radeonContextPtr rmesa, GLuint flags )
}
}
+
+extern void __miniglx_release_vt( void );
+
/* In the current miniglx, cliprects can change while the lock is
* held... Probably need to fix this.
*/
void radeonUnlock( radeonContextPtr rmesa )
{
fprintf(stderr, "%s\n", __FUNCTION__);
- validate_drawable( rmesa );
+
drmUnlock( rmesa->dri.fd, rmesa->dri.hwContext );
+
+ validate_drawable( rmesa );
+
+ /* This only happens if the VT switch was requested inside the
+ * locked region.
+ */
+ if (!rmesa->numClipRects)
+ __miniglx_release_vt();
+
}