diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-06-23 15:05:03 -0700 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-06-23 15:05:03 -0700 |
commit | 1eec83a203c48822400742a1fb184b2cb52c62f7 (patch) | |
tree | 9a93f0502bd5eca85758fcee995360e99ec8a93e | |
parent | bfeeac6de096256fca82244338bb45d53ee53cbc (diff) |
Add option to control swapbuffers behavior
Until we get triple buffering, we'll want this so users can avoid taking a
performance hit on apps that render slower than the refresh rate.
Fixes fdo bug #22234.
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
-rw-r--r-- | man/intel.man | 10 | ||||
-rw-r--r-- | src/i830.h | 1 | ||||
-rw-r--r-- | src/i830_driver.c | 15 |
3 files changed, 26 insertions, 0 deletions
diff --git a/man/intel.man b/man/intel.man index 05aa6789..6330e4b7 100644 --- a/man/intel.man +++ b/man/intel.man @@ -92,6 +92,16 @@ performance. .IP Default: enabled. .TP +.BI "Option \*qSwapbuffersWait\*q \*q" boolean \*q +This option controls the behavior of glXSwapBuffers and glXCopySubBufferMESA +calls by GL applications. If enabled, the calls will avoid tearing by making +sure the display scanline is outside of the area to be copied before the copy +occurs. If disabled, no scanline synchronization is performed, meaning tearing +will likely occur. Note that when enabled, this option can adversely affect +the framerate of applications that render frames at less than refresh rate. +.IP +Default: enabled. +.TP .BI "Option \*qDRI\*q \*q" boolean \*q Disable or enable DRI support. .IP @@ -414,6 +414,7 @@ typedef struct _I830Rec { Bool tiling; Bool fb_compression; + Bool swapbuffers_wait; Bool CursorNeedsPhysical; diff --git a/src/i830_driver.c b/src/i830_driver.c index 9d38fba1..70b87887 100644 --- a/src/i830_driver.c +++ b/src/i830_driver.c @@ -171,6 +171,7 @@ typedef enum { OPTION_LVDS24BITMODE, OPTION_FBC, OPTION_TILING, + OPTION_SWAPBUFFERS_WAIT, OPTION_LVDSFIXEDMODE, OPTION_FORCEENABLEPIPEA, #ifdef INTEL_XVMC @@ -189,6 +190,7 @@ static OptionInfoRec I830Options[] = { {OPTION_LVDS24BITMODE, "LVDS24Bit", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_FBC, "FramebufferCompression", OPTV_BOOLEAN, {0}, TRUE}, {OPTION_TILING, "Tiling", OPTV_BOOLEAN, {0}, TRUE}, + {OPTION_SWAPBUFFERS_WAIT, "SwapbuffersWait", OPTV_BOOLEAN, {0}, TRUE}, {OPTION_LVDSFIXEDMODE, "LVDSFixedMode", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_FORCEENABLEPIPEA, "ForceEnablePipeA", OPTV_BOOLEAN, {0}, FALSE}, #ifdef INTEL_XVMC @@ -2663,10 +2665,23 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) pI830->fb_compression = FALSE; } + /* SwapBuffers delays to avoid tearing */ + pI830->swapbuffers_wait = TRUE; + + /* Allow user override if they set a value */ + if (xf86IsOptionSet(pI830->Options, OPTION_SWAPBUFFERS_WAIT)) { + if (xf86ReturnOptValBool(pI830->Options, OPTION_SWAPBUFFERS_WAIT, FALSE)) + pI830->swapbuffers_wait = TRUE; + else + pI830->swapbuffers_wait = FALSE; + } + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Framebuffer compression %sabled\n", pI830->fb_compression ? "en" : "dis"); xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Tiling %sabled\n", pI830->tiling ? "en" : "dis"); + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "SwapBuffers wait %sabled\n", + pI830->swapbuffers_wait ? "en" : "dis"); pI830->last_3d = LAST_3D_OTHER; pI830->overlayOn = FALSE; |