From 488326b0b9c559511e3282f4dee6027db6fcae2f Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 2 Nov 2007 12:26:16 -0600 Subject: [PATCH] disable vblank/sync code --- src/mesa/drivers/dri/intel_winsys/intel_context.c | 2 ++ src/mesa/drivers/dri/intel_winsys/intel_lock.c | 2 ++ src/mesa/drivers/dri/intel_winsys/intel_screen.c | 2 ++ src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.c | 16 +++++++++++++++- src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.h | 3 +++ 5 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/intel_winsys/intel_context.c b/src/mesa/drivers/dri/intel_winsys/intel_context.c index b0c1a60..ea73271 100644 --- a/src/mesa/drivers/dri/intel_winsys/intel_context.c +++ b/src/mesa/drivers/dri/intel_winsys/intel_context.c @@ -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 } } } diff --git a/src/mesa/drivers/dri/intel_winsys/intel_lock.c b/src/mesa/drivers/dri/intel_winsys/intel_lock.c index 38f0a4e..059393f 100644 --- a/src/mesa/drivers/dri/intel_winsys/intel_lock.c +++ b/src/mesa/drivers/dri/intel_winsys/intel_lock.c @@ -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); diff --git a/src/mesa/drivers/dri/intel_winsys/intel_screen.c b/src/mesa/drivers/dri/intel_winsys/intel_screen.c index be31774..68f2055 100644 --- a/src/mesa/drivers/dri/intel_winsys/intel_screen.c +++ b/src/mesa/drivers/dri/intel_winsys/intel_screen.c @@ -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; } diff --git a/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.c b/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.c index ac4ae80..5d20a4b 100644 --- a/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.c +++ b/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.c @@ -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 { diff --git a/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.h b/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.h index aae4e7c..1387288 100644 --- a/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.h +++ b/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.h @@ -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 }; -- 2.7.4