Merge branch 'origin' into softpipe_0_1_branch
[mesa.git] / src / mesa / drivers / dri / i915tex / intel_buffers.c
index 5aed3ad0eccc71d37205e5dc3b464a533cd6f83e..17b4feadf854f1d4c84b41c2018d41c06a1afd9d 100644 (file)
@@ -272,7 +272,8 @@ intelWindowMoved(struct intel_context *intel)
         flags = intel_fb->vblank_flags & ~VBLANK_FLAG_SECONDARY;
       }
 
-      if (flags != intel_fb->vblank_flags) {
+      if (flags != intel_fb->vblank_flags && intel_fb->vblank_flags &&
+         !(intel_fb->vblank_flags & VBLANK_FLAG_NO_IRQ)) {
         drmVBlank vbl;
         int i;
 
@@ -283,7 +284,9 @@ intelWindowMoved(struct intel_context *intel)
         }
 
         for (i = 0; i < intel_fb->pf_num_pages; i++) {
-           if (!intel_fb->color_rb[i])
+           if (!intel_fb->color_rb[i] ||
+               (intel_fb->vbl_waited - intel_fb->color_rb[i]->vbl_pending) <=
+               (1<<23))
               continue;
 
            vbl.request.sequence = intel_fb->color_rb[i]->vbl_pending;
@@ -785,7 +788,8 @@ intelScheduleSwap(const __DRIdrawablePrivate * dPriv, GLboolean *missed_target)
    drm_i915_vblank_swap_t swap;
    GLboolean ret;
 
-   if ((intel_fb->vblank_flags & VBLANK_FLAG_NO_IRQ) ||
+   if (!intel_fb->vblank_flags ||
+       (intel_fb->vblank_flags & VBLANK_FLAG_NO_IRQ) ||
        intelScreen->current_rotation != 0 ||
        intelScreen->drmMinor < (intel_fb->pf_active ? 9 : 6))
       return GL_FALSE;