[PATCH] Remove triple-buffering support

Owain G. Ainsworth oga at openbsd.org
Tue Jan 13 09:09:00 PST 2009


It never worked with any upstream linux kernel, and is quite heavily
deprecated. A new solution based around DRI2 will probably be
forthcoming. Pageflipping itself is next.
---
 man/intel.man     |   15 +--------------
 src/i830.h        |    2 --
 src/i830_accel.c  |    5 -----
 src/i830_dri.c    |   32 +++++---------------------------
 src/i830_driver.c |    8 --------
 src/i830_memory.c |   11 -----------
 src/i830_xaa.c    |    6 ------
 7 files changed, 6 insertions(+), 73 deletions(-)

diff --git a/man/intel.man b/man/intel.man
index 00aa1be..2359624 100644
--- a/man/intel.man
+++ b/man/intel.man
@@ -153,23 +153,10 @@ Default for i810: this option is not used.
 .BI "Option \*qPageFlip\*q \*q" boolean \*q
 Enable support for page flipping. This should improve 3D performance at the
 potential cost of worse performance with mixed 2D/3D. Also note that this gives
-no benefit without corresponding support in the Mesa 3D driver and may not give
-the full benefit without triple buffering (see
-.B "Option \*qTripleBuffer\*q"
-).
+no benefit without corresponding support in the Mesa 3D driver
 Default for i810: The option is not used.
 Default for i830 and above: Disabled (This option is currently unstable).
 .TP
-.BI "Option \*qTripleBuffer\*q \*q" boolean \*q
-Enable support for triple buffering. This should improve 3D performance at the
-potential cost of worse performance with mixed 2D/3D. Also note that this gives
-no benefit without corresponding support in the Mesa 3D driver and may not give
-any benefit without page flipping either (see
-.B "Option \*qPageFlip\*q"
-).
-Default for i810: The option is not used.
-Default for i830 and above: Disabled.
-.TP
 .BI "Option \*qAccelMethod\*q \*q" string \*q
 Choose acceleration architecture, either "XAA" or "EXA".  XAA is the old
 XFree86 based acceleration architecture.  EXA is a newer and simpler
diff --git a/src/i830.h b/src/i830.h
index 25bf482..94bcce7 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -461,7 +461,6 @@ typedef struct _I830Rec {
 
 #ifdef XF86DRI
    i830_memory *back_buffer;
-   i830_memory *third_buffer;
    i830_memory *depth_buffer;
    i830_memory *textures;		/**< Compatibility texture memory */
    i830_memory *memory_manager;		/**< DRI memory manager aperture */
@@ -484,7 +483,6 @@ typedef struct _I830Rec {
 
    Bool NeedRingBufferLow;
    Bool allowPageFlip;
-   Bool TripleBuffer;
    Bool tiling;
    Bool fb_compression;
 
diff --git a/src/i830_accel.c b/src/i830_accel.c
index 7dff714..1c8b7aa 100644
--- a/src/i830_accel.c
+++ b/src/i830_accel.c
@@ -255,11 +255,6 @@ I830SelectBuffer(ScrnInfoPtr pScrn, int buffer)
       if (pI830->back_buffer->tiling == TILE_YMAJOR)
 	 return FALSE;
       break;
-   case I830_SELECT_THIRD:
-      pI830->bufferOffset = pI830->third_buffer->offset;
-      if (pI830->third_buffer->tiling == TILE_YMAJOR)
-	 return FALSE;
-      break;
    case I830_SELECT_DEPTH:
       pI830->bufferOffset = pI830->depth_buffer->offset;
       if (pI830->depth_buffer->tiling == TILE_YMAJOR)
diff --git a/src/i830_dri.c b/src/i830_dri.c
index c4440ce..98df2ac 100644
--- a/src/i830_dri.c
+++ b/src/i830_dri.c
@@ -848,7 +848,6 @@ I830DRIDoMappings(ScreenPtr pScreen)
    /* init to zero to be safe */
    sarea->front_handle = 0;
    sarea->back_handle = 0;
-   sarea->third_handle = 0;
    sarea->depth_handle = 0;
    sarea->tex_handle = 0;
 
@@ -1079,10 +1078,6 @@ I830DRIRefreshArea (ScrnInfoPtr pScrn, int num, BoxPtr pbox)
 
    I830DRIDoRefreshArea(pScrn, num, pbox, pI830->back_buffer->offset);
 
-   if (pI830->third_buffer) {
-      I830DRIDoRefreshArea(pScrn, num, pbox, pI830->third_buffer->offset);
-   }
-
    DamageEmpty(pI830->pDamage);
 }
 #endif
@@ -1169,14 +1164,14 @@ I830DRISwapContext(ScreenPtr pScreen, DRISyncType syncType,
 
 	 if (sPriv->pf_current_page & (0x3 << 2)) {
 	    sPriv->pf_current_page = sPriv->pf_current_page & 0x3;
-	    sPriv->pf_current_page |= (sPriv->third_handle ? 2 : 1) << 2;
+	    sPriv->pf_current_page |= 1 << 2;
 
 	    flip.pipes |= 0x2;
 	 }
 
 	 if (sPriv->pf_current_page & 0x3) {
 	    sPriv->pf_current_page = sPriv->pf_current_page & (0x3 << 2);
-	    sPriv->pf_current_page |= sPriv->third_handle ? 2 : 1;
+	    sPriv->pf_current_page |= 1;
 
 	    flip.pipes |= 0x1;
 	 }
@@ -1208,8 +1203,6 @@ I830DRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 index)
 
    first_buffer = I830_SELECT_BACK;
    last_buffer = I830_SELECT_DEPTH;
-   if (I830PTR(pScrn)->third_buffer)
-      last_buffer = I830_SELECT_THIRD;
 
    for (buffer = first_buffer; buffer <= last_buffer; buffer++) {
       pbox = REGION_RECTS(prgn);
@@ -1358,8 +1351,6 @@ I830DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
    I830EmitFlush(pScrn);
    first_buffer = I830_SELECT_BACK;
    last_buffer = I830_SELECT_DEPTH;
-   if (pI830->third_buffer)
-      last_buffer = I830_SELECT_THIRD;
 
    for (buffer = first_buffer; buffer <= last_buffer; buffer++) {
       if (!I830SelectBuffer(pScrn, buffer))
@@ -1591,10 +1582,6 @@ i830_update_sarea(ScrnInfoPtr pScrn, drmI830Sarea *sarea)
 
    sarea->front_tiled = (pI830->front_buffer->tiling != TILE_NONE);
    sarea->back_tiled = (pI830->back_buffer->tiling != TILE_NONE);
-   if (pI830->third_buffer != NULL)
-       sarea->third_tiled = (pI830->third_buffer->tiling != TILE_NONE);
-   else
-       sarea->third_tiled = FALSE;
    sarea->depth_tiled = (pI830->depth_buffer->tiling != TILE_NONE);
    sarea->rotated_tiled = FALSE;
 
@@ -1602,7 +1589,6 @@ i830_update_sarea(ScrnInfoPtr pScrn, drmI830Sarea *sarea)
 
    sarea->front_bo_handle = i830_name_buffer (pScrn, pI830->front_buffer);
    sarea->back_bo_handle = i830_name_buffer (pScrn, pI830->back_buffer);
-   sarea->third_bo_handle = i830_name_buffer (pScrn, pI830->third_buffer);
    sarea->depth_bo_handle = i830_name_buffer (pScrn, pI830->depth_buffer);
 
    /* The rotation is now handled entirely by the X Server, so just leave the
@@ -1695,17 +1681,9 @@ i830_update_dri_mappings(ScrnInfoPtr pScrn, drmI830Sarea *sarea)
        return FALSE;
    }
 
-   if (pI830->third_buffer) {
-       if (!i830_do_addmap(pScrn, pI830->third_buffer, &sarea->third_handle,
-			   &sarea->third_size, &sarea->third_offset)) {
-	   xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Disabling DRI.\n");
-	   return FALSE;
-       }
-   } else {
-       sarea->third_handle = 0;
-       sarea->third_offset = 0;
-       sarea->third_size = 0;
-   }
+   sarea->third_handle = 0;
+   sarea->third_offset = 0;
+   sarea->third_size = 0;
 
    if (!i830_do_addmap(pScrn, pI830->depth_buffer, &sarea->depth_handle,
 		       &sarea->depth_size, &sarea->depth_offset)) {
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 1ddea00..23f3757 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -336,7 +336,6 @@ static OptionInfoRec I830Options[] = {
    {OPTION_LEGACY3D,	"Legacy3D",     OPTV_BOOLEAN,	{0},	FALSE},
 #endif
    {OPTION_LVDSFIXEDMODE, "LVDSFixedMode", OPTV_BOOLEAN,	{0},	FALSE},
-   {OPTION_TRIPLEBUFFER, "TripleBuffer", OPTV_BOOLEAN,	{0},	FALSE},
    {OPTION_FORCEENABLEPIPEA, "ForceEnablePipeA", OPTV_BOOLEAN,	{0},	FALSE},
 #ifdef INTEL_XVMC
    {OPTION_XVMC,	"XvMC",		OPTV_BOOLEAN,	{0},	TRUE},
@@ -1810,13 +1809,6 @@ I830DriOptsInit(ScrnInfoPtr pScrn)
     xf86DrvMsg(pScrn->scrnIndex, from, "Will%s try to enable page flipping\n",
 	       pI830->allowPageFlip ? "" : " not");
 
-    pI830->TripleBuffer = FALSE;
-    from =  (pI830->directRenderingType != DRI_DISABLED &&
-	     xf86GetOptValBool(pI830->Options, OPTION_TRIPLEBUFFER,
-			       &pI830->TripleBuffer)) ? X_CONFIG : X_DEFAULT;
-
-    xf86DrvMsg(pScrn->scrnIndex, from, "Triple buffering %sabled\n",
-	       pI830->TripleBuffer ? "en" : "dis");
 #endif /* XF86DRI */
 }
 
diff --git a/src/i830_memory.c b/src/i830_memory.c
index b6d8026..ab4e5ce 100644
--- a/src/i830_memory.c
+++ b/src/i830_memory.c
@@ -351,7 +351,6 @@ i830_reset_allocations(ScrnInfoPtr pScrn)
     pI830->power_context = NULL;
 #ifdef XF86DRI
     pI830->back_buffer = NULL;
-    pI830->third_buffer = NULL;
     pI830->depth_buffer = NULL;
     pI830->textures = NULL;
 #endif
@@ -367,8 +366,6 @@ i830_free_3d_memory(ScrnInfoPtr pScrn)
 #ifdef XF86DRI
     i830_free_memory(pScrn, pI830->back_buffer);
     pI830->back_buffer = NULL;
-    i830_free_memory(pScrn, pI830->third_buffer);
-    pI830->third_buffer = NULL;
     i830_free_memory(pScrn, pI830->depth_buffer);
     pI830->depth_buffer = NULL;
     i830_free_memory(pScrn, pI830->textures);
@@ -1753,14 +1750,6 @@ i830_allocate_3d_memory(ScrnInfoPtr pScrn)
     if (!i830_allocate_backbuffer(pScrn, &pI830->back_buffer, "back buffer"))
 	return FALSE;
 
-    if (pI830->TripleBuffer && !i830_allocate_backbuffer(pScrn,
-							 &pI830->third_buffer,
-							 "third buffer")) {
-       xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
-		  "Failed to allocate third buffer, triple buffering "
-		  "inactive\n");
-    }
-
     if (!i830_allocate_depthbuffer(pScrn))
 	return FALSE;
 
diff --git a/src/i830_xaa.c b/src/i830_xaa.c
index e5e849d..7684978 100644
--- a/src/i830_xaa.c
+++ b/src/i830_xaa.c
@@ -292,12 +292,6 @@ I830CheckTiling(ScrnInfoPtr pScrn)
    {
        return TRUE;
    }
-   if (pI830->third_buffer != NULL &&
-       pI830->bufferOffset == pI830->third_buffer->offset &&
-       pI830->third_buffer->tiling != TILE_NONE)
-   {
-       return TRUE;
-   }
 #endif
 
    return FALSE;
-- 
1.6.0.5


--+QahgC5+KEYLbs62
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="0003-Fix-ioctl-type.patch"



More information about the Intel-gfx mailing list