summaryrefslogtreecommitdiff
path: root/src/i830_driver.c
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@virtuousgeek.org>2009-06-23 15:05:03 -0700
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-06-23 15:05:03 -0700
commit1eec83a203c48822400742a1fb184b2cb52c62f7 (patch)
tree9a93f0502bd5eca85758fcee995360e99ec8a93e /src/i830_driver.c
parentbfeeac6de096256fca82244338bb45d53ee53cbc (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>
Diffstat (limited to 'src/i830_driver.c')
-rw-r--r--src/i830_driver.c15
1 files changed, 15 insertions, 0 deletions
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;