Commit 488326b0 authored by Brian's avatar Brian

disable vblank/sync code

parent a5df4239
......@@ -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
}
}
}
......
......@@ -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);
......
......@@ -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;
}
......
......@@ -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 {
......
......@@ -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
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment