disable vblank/sync code
authorBrian <brian.paul@tungstengraphics.com>
Fri, 2 Nov 2007 18:26:16 +0000 (12:26 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Mon, 5 Nov 2007 15:04:47 +0000 (08:04 -0700)
src/mesa/drivers/dri/intel_winsys/intel_context.c
src/mesa/drivers/dri/intel_winsys/intel_lock.c
src/mesa/drivers/dri/intel_winsys/intel_screen.c
src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.c
src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.h

index b0c1a608fa84d5266dfeb7169d95396a031b5824..ea732715a6dd39dbcda7b62ae4284f29b5ac07fd 100644 (file)
@@ -392,6 +392,7 @@ intelMakeCurrent(__DRIcontextPrivate * driContextPriv,
 
         if (intel->driDrawable != driDrawPriv) {
            if (driDrawPriv->pdraw->swap_interval == (unsigned)-1) {
+#if VBL
               int i;
 
               intel_fb->vblank_flags = driGetDefaultVBlankFlags(&intel->optionCache);
@@ -404,6 +405,7 @@ intelMakeCurrent(__DRIcontextPrivate * driContextPriv,
               for (i = 0; i < 2; i++) {
                   intel_fb->vbl_pending[i] = intel_fb->vbl_seq;
               }
+#endif
            }
         }
       }
index 38f0a4e2d7c46e6659b39d1198d6d8e501af7c9d..059393f8b790ac961fca665a700107714ad388cd 100644 (file)
@@ -127,6 +127,7 @@ void LOCK_HARDWARE( struct intel_context *intel )
 
     curbuf = 0; /* current draw buf: 0 = front, 1 = back */
 
+#if VBL
     if (intel_fb && intel_fb->vblank_flags &&
        !(intel_fb->vblank_flags & VBLANK_FLAG_NO_IRQ) &&
        (intel_fb->vbl_waited - intel_fb->vbl_pending[curbuf]) > (1<<23)) {
@@ -142,6 +143,7 @@ void LOCK_HARDWARE( struct intel_context *intel )
        drmWaitVBlank(intel->driFd, &vbl);
        intel_fb->vbl_waited = vbl.reply.sequence;
     }
+#endif
 
     DRM_CAS(intel->driHwLock, intel->hHWContext,
             (DRM_LOCK_HELD|intel->hHWContext), __ret);
index be31774904286a490c5479c1b634fd53e198bf8c..68f20556b4e3c15c21c0906d1f7c849832de1f48 100644 (file)
@@ -363,6 +363,7 @@ intelGetSwapInfo(__DRIdrawablePrivate * dPriv, __DRIswapInfo * sInfo)
    }
 
    intel_fb = dPriv->driverPrivate;
+#if VBL
    sInfo->swap_count = intel_fb->swap_count;
    sInfo->swap_ust = intel_fb->swap_ust;
    sInfo->swap_missed_count = intel_fb->swap_missed_count;
@@ -370,6 +371,7 @@ intelGetSwapInfo(__DRIdrawablePrivate * dPriv, __DRIswapInfo * sInfo)
    sInfo->swap_missed_usage = (sInfo->swap_missed_count != 0)
       ? driCalculateSwapUsage(dPriv, 0, intel_fb->swap_missed_ust)
       : 0.0;
+#endif
 
    return 0;
 }
index ac4ae80cfbab1469c83939b5e6aca1b0f97cf846..5d20a4b94053d3364c204b6e97990f1ed9fe6f11 100644 (file)
@@ -231,6 +231,7 @@ intelWindowMoved(struct intel_context *intel)
    intelUpdateFramebufferSize(ctx, dPriv);
    intel_fb->Base.Initialized = GL_TRUE; /* XXX remove someday */
 
+#if VBL
    {
       drmI830Sarea *sarea = intel->sarea;
       drm_clip_rect_t drw_rect = { .x1 = dPriv->x, .x2 = dPriv->x + dPriv->w,
@@ -271,11 +272,12 @@ intelWindowMoved(struct intel_context *intel)
 
       }
    }
-
+#endif
 }
 
 
 
+#if VBL
 static GLboolean
 intelScheduleSwap(const __DRIdrawablePrivate * dPriv, GLboolean *missed_target)
 {
@@ -335,6 +337,8 @@ intelScheduleSwap(const __DRIdrawablePrivate * dPriv, GLboolean *missed_target)
 
    return ret;
 }
+#endif
+
 
 void
 intelSwapBuffers(__DRIdrawablePrivate * dPriv)
@@ -355,6 +359,7 @@ intelSwapBuffers(__DRIdrawablePrivate * dPriv)
 
         _mesa_notifySwapBuffers(ctx);  /* flush pending rendering comands */
 
+#if VBL
          if (!intelScheduleSwap(dPriv, &missed_target)) {
             struct pipe_surface *back_surf
                = get_color_surface(intel_fb, BUFFER_BACK_LEFT);
@@ -364,7 +369,15 @@ intelSwapBuffers(__DRIdrawablePrivate * dPriv)
 
             intelDisplayBuffer(dPriv, back_surf, NULL);
         }
+#else
+         {
+            struct pipe_surface *back_surf
+               = get_color_surface(intel_fb, BUFFER_BACK_LEFT);
+            intelDisplayBuffer(dPriv, back_surf, NULL);
+         }
+#endif
 
+#if VBL
         intel_fb->swap_count++;
         (*dri_interface->getUST) (&ust);
         if (missed_target) {
@@ -373,6 +386,7 @@ intelSwapBuffers(__DRIdrawablePrivate * dPriv)
         }
 
         intel_fb->swap_ust = ust;
+#endif
       }
    }
    else {
index aae4e7c61f27a60839d871194fc6081eb28ef3b0..138728862ab93627acaf3ce9fa1e1f5ffa2ea00a 100644 (file)
@@ -39,6 +39,8 @@ struct intel_framebuffer
 {
    struct gl_framebuffer Base;
 
+#define VBL 0
+#if VBL
    /* VBI
     */
    GLuint vbl_seq;
@@ -52,6 +54,7 @@ struct intel_framebuffer
    GLuint swap_missed_count;
 
    GLuint vbl_pending[3];  /**< [number of color buffers] */
+#endif
 };