xf86-video-intel: man/intel.man src/i830_driver.c src/i830.h

Jesse Barnes jbarnes at kemper.freedesktop.org
Tue Jun 23 15:06:27 PDT 2009


 man/intel.man     |   10 ++++++++++
 src/i830.h        |    1 +
 src/i830_driver.c |   15 +++++++++++++++
 3 files changed, 26 insertions(+)

New commits:
commit 1eec83a203c48822400742a1fb184b2cb52c62f7
Author: Jesse Barnes <jbarnes at virtuousgeek.org>
Date:   Tue Jun 23 15:05:03 2009 -0700

    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 at virtuousgeek.org>

diff --git a/man/intel.man b/man/intel.man
index 05aa678..6330e4b 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
diff --git a/src/i830.h b/src/i830.h
index 19b189c..6825e77 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -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 9d38fba..70b8788 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;


More information about the xorg-commit mailing list