965 glxswapcontrol fix
authorZou Nan hai <nanhai.zou@intel.com>
Wed, 24 Jan 2007 08:07:43 +0000 (16:07 +0800)
committerZou Nan hai <nanhai.zou@intel.com>
Wed, 24 Jan 2007 08:07:43 +0000 (16:07 +0800)
src/mesa/drivers/dri/i965/intel_context.c

index 388600dbbe51078c307f0693df34c236c5d4d969..f7ab7d3b7d56f47ee96571cf3f3f0a6a23ca46ce 100644 (file)
@@ -61,6 +61,7 @@
 #include "bufmgr.h"
 
 #include "utils.h"
+#include "vblank.h"
 #ifndef INTEL_DEBUG
 int INTEL_DEBUG = (0);
 #endif
@@ -336,6 +337,11 @@ GLboolean intelInitContext( struct intel_context *intel,
    intel->driScreen = sPriv;
    intel->sarea = saPriv;
 
+   driParseConfigFiles (&intel->optionCache, &intelScreen->optionCache,
+                  intel->driScreen->myNum, "i965");
+
+   intel->vblank_flags = (intel->intelScreen->irq_active != 0)
+          ? driGetDefaultVBlankFlags(&intel->optionCache) : VBLANK_FLAG_NO_IRQ;
 
    ctx->Const.MaxTextureMaxAnisotropy = 2.0;
 
@@ -563,6 +569,9 @@ GLboolean intelMakeCurrent(__DRIcontextPrivate *driContextPriv,
 
       if ( intel->driDrawable != driDrawPriv ) {
         /* Shouldn't the readbuffer be stored also? */
+        driDrawableInitVBlank( driDrawPriv, intel->vblank_flags,
+                     &intel->vbl_seq );
+
         intel->driDrawable = driDrawPriv;
         intelWindowMoved( intel );
       }