diff options
author | Thomas Hellström <thomas@tungstengraphics.com> | 2006-03-29 21:21:54 +0000 |
---|---|---|
committer | Thomas Hellström <thomas@tungstengraphics.com> | 2006-03-29 21:21:54 +0000 |
commit | 3de9a9bd1d1f396bbea96a13608ee4d76a4d6516 (patch) | |
tree | 82024564ff008b91bc9e76a55843997df1bb5da3 | |
parent | e6cae6e6f622d0abe68918d772a820047127de5f (diff) |
Bump driver date.
Keep the lock mutex locked while we hold the heavyweight lock.
-rw-r--r-- | src/mesa/drivers/dri/i915/i915_context.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/intel_context.c | 18 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/intel_context.h | 6 |
3 files changed, 14 insertions, 12 deletions
diff --git a/src/mesa/drivers/dri/i915/i915_context.c b/src/mesa/drivers/dri/i915/i915_context.c index 5d389533b0..99c4b9c16a 100644 --- a/src/mesa/drivers/dri/i915/i915_context.c +++ b/src/mesa/drivers/dri/i915/i915_context.c @@ -109,7 +109,7 @@ GLboolean i915CreateContext( const __GLcontextModes *mesaVis, if (!i915) return GL_FALSE; - _mesa_printf( "\ntexmem branch (i915, drop2)\n\n"); + _mesa_printf( "\ntexmem branch (i915, drop3)\n\n"); i915InitVtbl( i915 ); i915InitMetaFuncs( i915 ); diff --git a/src/mesa/drivers/dri/i915/intel_context.c b/src/mesa/drivers/dri/i915/intel_context.c index c699e6a8fb..897b372ba2 100644 --- a/src/mesa/drivers/dri/i915/intel_context.c +++ b/src/mesa/drivers/dri/i915/intel_context.c @@ -86,7 +86,11 @@ int INTEL_DEBUG = (0); #include "extension_helper.h" -#define DRIVER_DATE "20060212" +#define DRIVER_DATE "20060329" + +_glthread_Mutex lockMutex; +static GLboolean lockMutexInit = GL_FALSE; + static const GLubyte *intelGetString( GLcontext *ctx, GLenum name ) { @@ -303,6 +307,10 @@ GLboolean intelInitContext( struct intel_context *intel, intel->driScreen = sPriv; intel->sarea = saPriv; + if (!lockMutexInit) { + lockMutexInit = GL_TRUE; + _glthread_INIT_MUTEX(lockMutex); + } ctx->Const.MaxTextureMaxAnisotropy = 2.0; @@ -543,8 +551,6 @@ GLboolean intelMakeCurrent(__DRIcontextPrivate *driContextPriv, return GL_TRUE; } -_glthread_DECLARE_STATIC_MUTEX(lockMutex); - void intelGetLock( struct intel_context *intel, GLuint flags ) { __DRIdrawablePrivate *dPriv = intel->driDrawable; @@ -552,8 +558,6 @@ void intelGetLock( struct intel_context *intel, GLuint flags ) drmI830Sarea * sarea = intel->sarea; int me = intel->hHWContext; - _glthread_LOCK_MUTEX(lockMutex); - drmGetLock(intel->driFd, intel->hHWContext, flags); @@ -565,10 +569,6 @@ void intelGetLock( struct intel_context *intel, GLuint flags ) if (dPriv) DRI_VALIDATE_DRAWABLE_INFO(sPriv, dPriv); - - _glthread_UNLOCK_MUTEX(lockMutex); - - /* Lost context? */ if (sarea->ctxOwner != me) { diff --git a/src/mesa/drivers/dri/i915/intel_context.h b/src/mesa/drivers/dri/i915/intel_context.h index df44db83d4..db8bfba6b8 100644 --- a/src/mesa/drivers/dri/i915/intel_context.h +++ b/src/mesa/drivers/dri/i915/intel_context.h @@ -266,7 +266,7 @@ struct intel_context }; -#define DEBUG_LOCKING 0 +#define DEBUG_LOCKING 1 #if DEBUG_LOCKING @@ -312,7 +312,7 @@ struct intel_context #endif - +extern _glthread_Mutex lockMutex; /* Lock the hardware and validate our state. @@ -320,6 +320,7 @@ struct intel_context #define LOCK_HARDWARE( intel ) \ do { \ char __ret=0; \ + _glthread_LOCK_MUTEX(lockMutex); \ DEBUG_CHECK_LOCK(); \ assert(!(intel)->locked); \ DRM_CAS((intel)->driHwLock, (intel)->hHWContext, \ @@ -342,6 +343,7 @@ do { \ } \ DRM_UNLOCK((intel)->driFd, (intel)->driHwLock, (intel)->hHWContext); \ DEBUG_RESET(); \ + _glthread_UNLOCK_MUTEX(lockMutex); \ } while (0) |