remove disabled vblank/sync code
authorBrian <brian.paul@tungstengraphics.com>
Fri, 2 Nov 2007 18:28:39 +0000 (12:28 -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 ea732715a6dd39dbcda7b62ae4284f29b5ac07fd..9ed19325b70e559e1c4683fc9104b27317d49656 100644 (file)
@@ -392,20 +392,6 @@ 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);
-
-              (*dri_interface->getUST) (&intel_fb->swap_ust);
-              driDrawableInitVBlank(driDrawPriv, intel_fb->vblank_flags,
-                                    &intel_fb->vbl_seq);
-              intel_fb->vbl_waited = intel_fb->vbl_seq;
-
-              for (i = 0; i < 2; i++) {
-                  intel_fb->vbl_pending[i] = intel_fb->vbl_seq;
-              }
-#endif
            }
         }
       }
index 059393f8b790ac961fca665a700107714ad388cd..90ade2679cbddadb5c391e5e5a425e7d9311bf48 100644 (file)
@@ -127,24 +127,6 @@ 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)) {
-       drmVBlank vbl;
-
-       vbl.request.type = DRM_VBLANK_ABSOLUTE;
-
-       if ( intel_fb->vblank_flags & VBLANK_FLAG_SECONDARY ) {
-          vbl.request.type |= DRM_VBLANK_SECONDARY;
-       }
-
-       vbl.request.sequence = intel_fb->vbl_pending[curbuf];
-       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 68f20556b4e3c15c21c0906d1f7c849832de1f48..5dd4f9434374624b15630f719429f272b8c2f5e4 100644 (file)
@@ -363,15 +363,6 @@ 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;
-
-   sInfo->swap_missed_usage = (sInfo->swap_missed_count != 0)
-      ? driCalculateSwapUsage(dPriv, 0, intel_fb->swap_missed_ust)
-      : 0.0;
-#endif
 
    return 0;
 }
index 5d20a4b94053d3364c204b6e97990f1ed9fe6f11..1deb138adf8b360887b2c4d09e27c374160e017a 100644 (file)
@@ -230,116 +230,10 @@ intelWindowMoved(struct intel_context *intel)
    /* Update Mesa's notion of window size */
    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,
-                                  .y1 = dPriv->y, .y2 = dPriv->y + dPriv->h };
-      drm_clip_rect_t pipeA_rect = { .x1 = sarea->pipeA_x,
-                                     .y1 = sarea->pipeA_y,
-                                    .x2 = sarea->pipeA_x + sarea->pipeA_w,
-                                    .y2 = sarea->pipeA_y + sarea->pipeA_h };
-      drm_clip_rect_t pipeB_rect = { .x1 = sarea->pipeB_x,
-                                     .y1 = sarea->pipeB_y,
-                                    .x2 = sarea->pipeB_x + sarea->pipeB_w,
-                                    .y2 = sarea->pipeB_y + sarea->pipeB_h };
-      GLint areaA = driIntersectArea( drw_rect, pipeA_rect );
-      GLint areaB = driIntersectArea( drw_rect, pipeB_rect );
-      GLuint flags = intel_fb->vblank_flags;
-
-      /* Update vblank info
-       */
-      if (areaB > areaA || (areaA == areaB && areaB > 0)) {
-        flags = intel_fb->vblank_flags | VBLANK_FLAG_SECONDARY;
-      } else {
-        flags = intel_fb->vblank_flags & ~VBLANK_FLAG_SECONDARY;
-      }
-
-      if (flags != intel_fb->vblank_flags && intel_fb->vblank_flags &&
-         !(intel_fb->vblank_flags & VBLANK_FLAG_NO_IRQ)) {
-        drmVBlank vbl;
-
-        vbl.request.type = DRM_VBLANK_ABSOLUTE;
-
-        if ( intel_fb->vblank_flags & VBLANK_FLAG_SECONDARY ) {
-           vbl.request.type |= DRM_VBLANK_SECONDARY;
-        }
-
-        intel_fb->vblank_flags = flags;
-        driGetCurrentVBlank(dPriv, intel_fb->vblank_flags, &intel_fb->vbl_seq);
-        intel_fb->vbl_waited = intel_fb->vbl_seq;
-
-      }
-   }
-#endif
 }
 
 
 
-#if VBL
-static GLboolean
-intelScheduleSwap(const __DRIdrawablePrivate * dPriv, GLboolean *missed_target)
-{
-   struct intel_framebuffer *intel_fb = dPriv->driverPrivate;
-   unsigned int interval = driGetVBlankInterval(dPriv, intel_fb->vblank_flags);
-   struct intel_context *intel =
-      intelScreenContext(dPriv->driScreenPriv->private);
-   unsigned int target;
-   drm_i915_vblank_swap_t swap;
-   GLboolean ret;
-
-   /* XXX: Scheduled buffer swaps don't work with private back buffers yet */
-   if (1 || !intel_fb->vblank_flags ||
-       (intel_fb->vblank_flags & VBLANK_FLAG_NO_IRQ))
-      return GL_FALSE;
-
-   swap.seqtype = DRM_VBLANK_ABSOLUTE;
-
-   if (intel_fb->vblank_flags & VBLANK_FLAG_SYNC) {
-      swap.seqtype |= DRM_VBLANK_NEXTONMISS;
-   } else if (interval == 0) {
-      return GL_FALSE;
-   }
-
-   swap.drawable = dPriv->hHWDrawable;
-   target = swap.sequence = intel_fb->vbl_seq + interval;
-
-   if ( intel_fb->vblank_flags & VBLANK_FLAG_SECONDARY ) {
-      swap.seqtype |= DRM_VBLANK_SECONDARY;
-   }
-
-   LOCK_HARDWARE(intel);
-
-   intel_batchbuffer_flush(intel->batch);
-
-   if (!drmCommandWriteRead(intel->driFd, DRM_I915_VBLANK_SWAP, &swap,
-                           sizeof(swap))) {
-      intel_fb->vbl_seq = swap.sequence;
-      swap.sequence -= target;
-      *missed_target = swap.sequence > 0 && swap.sequence <= (1 << 23);
-
-#if 1
-      intel_fb->vbl_pending[1] = intel_fb->vbl_pending[0] = intel_fb->vbl_seq;
-#else
-      intel_get_renderbuffer(&intel_fb->Base, BUFFER_BACK_LEFT)->vbl_pending =
-        intel_get_renderbuffer(&intel_fb->Base,
-                               BUFFER_FRONT_LEFT)->vbl_pending =
-        intel_fb->vbl_seq;
-#endif
-
-      ret = GL_TRUE;
-   } else {
-      ret = GL_FALSE;
-   }
-
-   UNLOCK_HARDWARE(intel);
-
-   return ret;
-}
-#endif
-
-
 void
 intelSwapBuffers(__DRIdrawablePrivate * dPriv)
 {
@@ -359,34 +253,12 @@ 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);
-
-           driWaitForVBlank(dPriv, &intel_fb->vbl_seq, intel_fb->vblank_flags,
-                            &missed_target);
-
-            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) {
-           intel_fb->swap_missed_count++;
-           intel_fb->swap_missed_ust = ust - intel_fb->swap_ust;
-        }
 
-        intel_fb->swap_ust = ust;
-#endif
       }
    }
    else {
index 138728862ab93627acaf3ce9fa1e1f5ffa2ea00a..9b3152f5d292573b0cf200ade73aca0dbbf96fb1 100644 (file)
@@ -39,22 +39,6 @@ struct intel_framebuffer
 {
    struct gl_framebuffer Base;
 
-#define VBL 0
-#if VBL
-   /* VBI
-    */
-   GLuint vbl_seq;
-   GLuint vblank_flags;
-   GLuint vbl_waited;
-
-   int64_t swap_ust;
-   int64_t swap_missed_ust;
-
-   GLuint swap_count;
-   GLuint swap_missed_count;
-
-   GLuint vbl_pending[3];  /**< [number of color buffers] */
-#endif
 };