summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/intel_winsys/intel_context.c14
-rw-r--r--src/mesa/drivers/dri/intel_winsys/intel_lock.c18
-rw-r--r--src/mesa/drivers/dri/intel_winsys/intel_screen.c9
-rw-r--r--src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.c128
-rw-r--r--src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.h16
5 files changed, 0 insertions, 185 deletions
diff --git a/src/mesa/drivers/dri/intel_winsys/intel_context.c b/src/mesa/drivers/dri/intel_winsys/intel_context.c
index ea732715a6d..9ed19325b70 100644
--- a/src/mesa/drivers/dri/intel_winsys/intel_context.c
+++ b/src/mesa/drivers/dri/intel_winsys/intel_context.c
@@ -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
}
}
}
diff --git a/src/mesa/drivers/dri/intel_winsys/intel_lock.c b/src/mesa/drivers/dri/intel_winsys/intel_lock.c
index 059393f8b79..90ade2679cb 100644
--- a/src/mesa/drivers/dri/intel_winsys/intel_lock.c
+++ b/src/mesa/drivers/dri/intel_winsys/intel_lock.c
@@ -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);
diff --git a/src/mesa/drivers/dri/intel_winsys/intel_screen.c b/src/mesa/drivers/dri/intel_winsys/intel_screen.c
index 68f20556b4e..5dd4f943437 100644
--- a/src/mesa/drivers/dri/intel_winsys/intel_screen.c
+++ b/src/mesa/drivers/dri/intel_winsys/intel_screen.c
@@ -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;
}
diff --git a/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.c b/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.c
index 5d20a4b9405..1deb138adf8 100644
--- a/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.c
+++ b/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.c
@@ -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 {
diff --git a/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.h b/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.h
index 138728862ab..9b3152f5d29 100644
--- a/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.h
+++ b/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.h
@@ -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
};