diff options
author | Felix Kuehling <[email protected]> | 2005-03-06 03:52:01 +0000 |
---|---|---|
committer | Felix Kuehling <[email protected]> | 2005-03-06 03:52:01 +0000 |
commit | 9d05d3dd308c4655673a710d0c10f09cac9c0d83 (patch) | |
tree | fe5bf551e5f95dd5210bd2b2b455d84310a0dbdd /src/mesa/drivers/dri/savage/savageioctl.c | |
parent | e6aa21156ace5bea0a8bcc8c58aceacb748e2627 (diff) |
Don't synchronize after each frame. Allow the GPU to be one frame
ahead of the CPU for more parallelism of CPU and GPU. Unfortunately
there seems to be some broken hardware (like my ProSavageDDR) on which
status register updates are delayed sometimes. This leads to very
jerky animation if the hardware can buffer more than the current
frame. A new option "sync_frames" can be used as a remedy on such
broken hardware.
Diffstat (limited to 'src/mesa/drivers/dri/savage/savageioctl.c')
-rw-r--r-- | src/mesa/drivers/dri/savage/savageioctl.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/mesa/drivers/dri/savage/savageioctl.c b/src/mesa/drivers/dri/savage/savageioctl.c index 5399963cb97..9f3a028428f 100644 --- a/src/mesa/drivers/dri/savage/savageioctl.c +++ b/src/mesa/drivers/dri/savage/savageioctl.c @@ -423,12 +423,6 @@ static void savageDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all, _swrast_Clear( ctx, mask, all, cx, cy, cw, ch ); } - -/* This is necessary to avoid very jerky animation on my ProSavageDDR. - * Seems to work fine on other Savages though. Make this configurable! - */ -#define SYNC_FRAMES 1 - /* * Copy the back buffer to the front buffer. */ @@ -449,9 +443,9 @@ void savageSwapBuffers( __DRIdrawablePrivate *dPriv ) FLUSH_BATCH(imesa); -#if SYNC_FRAMES - imesa->lastSwap = savageEmitEvent( imesa, 0 ); -#endif + if (imesa->sync_frames) + imesa->lastSwap = savageEmitEvent( imesa, 0 ); + if (imesa->lastSwap != 0) savageWaitEvent( imesa, imesa->lastSwap ); @@ -463,9 +457,9 @@ void savageSwapBuffers( __DRIdrawablePrivate *dPriv ) imesa->inSwap = GL_FALSE; } -#if !SYNC_FRAMES - imesa->lastSwap = savageEmitEvent( imesa, 0 ); -#endif + if (!imesa->sync_frames) + /* don't sync, but limit the lag to one frame. */ + imesa->lastSwap = savageEmitEvent( imesa, 0 ); } unsigned int savageEmitEventLocked( savageContextPtr imesa, unsigned int flags ) |