configure.ac      |    5 
 debian/changelog  |    8 -
 man/intel.man     |   20 ---
 src/i830.h        |   10 -
 src/i830_accel.c  |    5 
 src/i830_dri.c    |  306 ------------------------------------------------------
 src/i830_driver.c |   48 --------
 src/i830_memory.c |   11 -
 src/i830_xaa.c    |    6 -
 9 files changed, 8 insertions(+), 411 deletions(-)

New commits:
commit 0ce5c3aa80c73e15ac005555978c04b44143854b
Author: Julien Cristau <[email protected]>
Date:   Thu Apr 9 10:18:07 2009 +0100

    Upload to unstable.

diff --git a/debian/changelog b/debian/changelog
index 9960544..df7d200 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,10 +1,12 @@
-xserver-xorg-video-intel (2:2.6.3-1) UNRELEASED; urgency=low
+xserver-xorg-video-intel (2:2.6.3-1) unstable; urgency=low
 
   * New upstream release.
-    + doesn't FTBFS with the new libdrm (closes: #523125)
   * Bump build-dep on libdrm-dev to 2.4.5.
+  * Upload to unstable.
+  * Cherry-pick some patches from upstream git, so this doesn't FTBFS with the
+    new libdrm (closes: #523125)
 
- -- Julien Cristau <[email protected]>  Wed, 08 Apr 2009 21:27:41 +0100
+ -- Julien Cristau <[email protected]>  Thu, 09 Apr 2009 10:25:22 +0100
 
 xserver-xorg-video-intel (2:2.6.1-1) experimental; urgency=low
 

commit c26e86881438c47465d0de34437d8cb2cf23faa7
Author: Owain G. Ainsworth <[email protected]>
Date:   Tue Jan 13 18:46:41 2009 +0000

    Remove the pageflipping infrastructure.
    
    It was broken on current kernels, and deprecated anyway.
    (cherry picked from commit c7db3201106f07f3228c989014d6db5ace5378f6)

diff --git a/configure.ac b/configure.ac
index be4a25f..346506d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -105,8 +105,6 @@ if test x$DRI != xno; then
                       [have_sarea_h="yes"], [have_sarea_h="no"])
         AC_CHECK_FILE([${sdkdir}/dristruct.h],
                       [have_dristruct_h="yes"], [have_dristruct_h="no"])
-       AC_CHECK_FILE([${sdkdir}/damage.h],
-                      [have_damage_h="yes"], [have_damage_h="no"])
 fi
 AC_MSG_CHECKING([whether to include DRI support])
 if test x$DRI = xauto; then
@@ -215,9 +213,6 @@ if test "$DRI" = yes; then
         PKG_CHECK_MODULES(DRI, [xf86driproto glproto])
         AC_DEFINE(XF86DRI,1,[Enable DRI driver support])
         AC_DEFINE(XF86DRI_DEVEL,1,[Enable developmental DRI driver support])
-       if test "$have_damage_h" = yes; then
-               AC_DEFINE(DAMAGE,1,[Use Damage extension])
-       fi
 fi
 
 dnl exaGetPixmapDriverPrivate required for DRM_MODE.
diff --git a/man/intel.man b/man/intel.man
index 2359624..65d1114 100644
--- a/man/intel.man
+++ b/man/intel.man
@@ -150,13 +150,6 @@ pool.  On systems with a working GEM environment, this can 
be disabled to
 increase the memory pool available to other graphics tasks.
 Default for i830 and newer: Enabled.
 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
-Default for i810: The option is not used.
-Default for i830 and above: Disabled (This option is currently unstable).
-.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 a051034..5fda244 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -72,9 +72,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "dri.h"
 #include "GL/glxint.h"
 #include "i830_dri.h"
-#ifdef DAMAGE
-#include "damage.h"
-#endif
 #endif
 #include "intel_bufmgr.h"
 #include "i915_drm.h"
@@ -475,16 +472,11 @@ typedef struct _I830Rec {
    Bool can_resize;
 
    Bool want_vblank_interrupts;
-#ifdef DAMAGE
-   DamagePtr pDamage;
-   RegionRec driRegion;
-#endif
 #endif
 
    Bool need_mi_flush;
 
    Bool NeedRingBufferLow;
-   Bool allowPageFlip;
    Bool tiling;
    Bool fb_compression;
 
diff --git a/src/i830_dri.c b/src/i830_dri.c
index 54a3c14..2a0516c 100644
--- a/src/i830_dri.c
+++ b/src/i830_dri.c
@@ -111,14 +111,6 @@ static void I830DRIMoveBuffers(WindowPtr pParent, 
DDXPointRec ptOldOrg,
 
 static void I830DRITransitionTo2d(ScreenPtr pScreen);
 static void I830DRITransitionTo3d(ScreenPtr pScreen);
-#if defined(DAMAGE) && (DRIINFO_MAJOR_VERSION > 5 ||           \
-                       (DRIINFO_MAJOR_VERSION == 5 && DRIINFO_MINOR_VERSION >= 
1))
-#define DRI_SUPPORTS_CLIP_NOTIFY 1
-#else
-#define DRI_SUPPORTS_CLIP_NOTIFY 0
-static void I830DRITransitionMultiToSingle3d(ScreenPtr pScreen);
-static void I830DRITransitionSingleToMulti3d(ScreenPtr pScreen);
-#endif
 
 #if (DRIINFO_MAJOR_VERSION > 5 || \
      (DRIINFO_MAJOR_VERSION == 5 && DRIINFO_MINOR_VERSION >= 4))
@@ -127,10 +119,6 @@ static void I830DRITransitionSingleToMulti3d(ScreenPtr 
pScreen);
 #define DRI_DRIVER_FRAMEBUFFER_MAP 0
 #endif
 
-#if DRI_SUPPORTS_CLIP_NOTIFY
-static void I830DRIClipNotify(ScreenPtr pScreen, WindowPtr *ppWin, int num);
-#endif
-
 extern void GlxSetVisualConfigs(int nconfigs,
                                __GLXvisualConfig * configs,
                                void **configprivs);
@@ -599,10 +587,6 @@ I830DRIScreenInit(ScreenPtr pScreen)
         pDRIInfo->texOffsetStart = I830TexOffsetStart;
 #endif
 
-#if DRI_SUPPORTS_CLIP_NOTIFY
-      pDRIInfo->ClipNotify = I830DRIClipNotify;
-#endif
-
 #if DRI_DRIVER_FRAMEBUFFER_MAP
    /* DRI version is high enough that we can get the DRI code to not
     * try to manage the framebuffer.
@@ -622,11 +606,6 @@ I830DRIScreenInit(ScreenPtr pScreen)
    pDRIInfo->TransitionTo2d = I830DRITransitionTo2d;
    pDRIInfo->TransitionTo3d = I830DRITransitionTo3d;
 
-#if !DRI_SUPPORTS_CLIP_NOTIFY
-   pDRIInfo->TransitionSingleToMulti3D = I830DRITransitionSingleToMulti3d;
-   pDRIInfo->TransitionMultiToSingle3D = I830DRITransitionMultiToSingle3d;
-#endif
-
    /* do driver-independent DRI screen initialization here */
    if (!DRIScreenInit(pScreen, pDRIInfo, &pI830->drmSubFD)) {
       xf86DrvMsg(pScreen->myNum, X_ERROR,
@@ -729,14 +708,6 @@ I830DRIScreenInit(ScreenPtr pScreen)
            return FALSE;
         }
         pI830->drmMinor = version->version_minor;
-#ifdef DAMAGE
-        if (pI830->allowPageFlip && pI830->drmMinor < 9) {
-           xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
-                      "DRM version 1.9 or newer required for Page flipping. "
-                      "Disabling.\n");
-           pI830->allowPageFlip = FALSE;
-        }
-#endif  
         drmFreeVersion(version);
       }
    }
@@ -965,10 +936,6 @@ I830DRICloseScreen(ScreenPtr pScreen)
 
    DPRINTF(PFX, "I830DRICloseScreen\n");
 
-#ifdef DAMAGE
-   REGION_UNINIT(pScreen, &pI830->driRegion);
-#endif
-
    if (!pI830->memory_manager && pI830DRI->irq) {
        drmCtlUninstHandler(pI830->drmSubFD);
        pI830DRI->irq = 0;
@@ -1022,66 +989,6 @@ I830DRIFinishScreenInit(ScreenPtr pScreen)
    return TRUE;
 }
 
-#ifdef DAMAGE
-/* This should be done *before* XAA syncs,
- * Otherwise will have to sync again???
- */
-static void
-I830DRIDoRefreshArea (ScrnInfoPtr pScrn, int num, BoxPtr pbox, uint32_t dst)
-{
-   I830Ptr pI830 = I830PTR(pScrn);
-   unsigned int i, cmd, pitch, flags;
-
-   pitch = pScrn->displayWidth * pI830->cpp;
-   flags = 0xcc << 16; /* ROP_S */
-
-   if (pScrn->bitsPerPixel == 32) {
-      cmd = (XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA |
-            XY_SRC_COPY_BLT_WRITE_RGB);
-      flags |= 3 << 24;
-   } else {
-      cmd = (XY_SRC_COPY_BLT_CMD);
-      flags |= 1 << 24;
-   }
-
-   /* We can assume tiled buffers if page flipping is on */
-   if (IS_I965G(pI830)) {
-       cmd |= XY_SRC_COPY_BLT_DST_TILED | XY_SRC_COPY_BLT_SRC_TILED;
-       pitch >>= 2;
-   }
-
-   for (i = 0 ; i < num ; i++, pbox++) {
-      BEGIN_BATCH(8);
-      OUT_BATCH(cmd);
-      OUT_BATCH(flags | pitch);
-      OUT_BATCH((pbox->y1 << 16) | pbox->x1);
-      OUT_BATCH((pbox->y2 << 16) | pbox->x2);
-      OUT_BATCH(dst);
-      OUT_BATCH((pbox->y1 << 16) | pbox->x1);
-      OUT_BATCH(pitch);
-      OUT_BATCH(pI830->front_buffer->offset);
-      ADVANCE_BATCH();
-   }
-}
-
-static void
-I830DRIRefreshArea (ScrnInfoPtr pScrn, int num, BoxPtr pbox)
-{
-   I830Ptr pI830 = I830PTR(pScrn);
-   drmI830Sarea *pSAREAPriv = DRIGetSAREAPrivate(pScrn->pScreen);
-
-   /* Don't want to do this when no 3d is active and pages are
-    * right-way-round :
-    */
-   if (!pSAREAPriv->pf_active && pSAREAPriv->pf_current_page == 0)
-      return;
-
-   I830DRIDoRefreshArea(pScrn, num, pbox, pI830->back_buffer->offset);
-
-   DamageEmpty(pI830->pDamage);
-}
-#endif
-
 static void
 I830DRISwapContext(ScreenPtr pScreen, DRISyncType syncType,
                   DRIContextType oldContextType, void *oldContext,
@@ -1104,86 +1011,14 @@ I830DRISwapContext(ScreenPtr pScreen, DRISyncType 
syncType,
       if (!pI830->memory_manager)
          i830_refresh_ring(pScrn);
 
-#ifdef DAMAGE
-      if (!pI830->pDamage && pI830->allowPageFlip) {
-        PixmapPtr pPix  = pScreen->GetScreenPixmap(pScreen);
-        pI830->pDamage = DamageCreate(NULL, NULL, DamageReportNone, TRUE,
-                                      pScreen, pPix);
-
-        if (pI830->pDamage == NULL) {
-           xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-                       "No screen damage record, page flipping disabled\n");
-            pI830->allowPageFlip = FALSE;
-        } else {
-           DamageRegister(&pPix->drawable, pI830->pDamage);
-
-           DamageDamageRegion(&pPix->drawable,
-                              &WindowTable[pScreen->myNum]->winSize);
-
-            xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-                       "Damage tracking initialized for page flipping\n");
-        }
-    }
-#endif
    } else if (syncType == DRI_2D_SYNC &&
              oldContextType == DRI_NO_CONTEXT &&
              newContextType == DRI_2D_CONTEXT) {
-#ifdef DAMAGE
-      drmI830Sarea *sPriv = (drmI830Sarea *) DRIGetSAREAPrivate(pScreen);
-#endif
-
       if (I810_DEBUG & DEBUG_VERBOSE_DRI)
         ErrorF("i830DRISwapContext (out)\n");
 
       if (!pScrn->vtSema)
         return;
-
-#ifdef DAMAGE
-      if (pI830->pDamage) {
-        RegionPtr pDamageReg = DamageRegion(pI830->pDamage);
-
-        if (pDamageReg) {
-           RegionRec region;
-           int nrects;
-
-           REGION_NULL(pScreen, &region);
-           REGION_SUBTRACT(pScreen, &region, pDamageReg, &pI830->driRegion);
-
-           if ((nrects = REGION_NUM_RECTS(&region)))
-              I830DRIRefreshArea(pScrn, nrects, REGION_RECTS(&region));
-
-           REGION_UNINIT(pScreen, &region);
-        }
-      }
-#endif
-
-#ifdef DAMAGE
-      /* Try flipping back to the front page if necessary */
-      if (sPriv && !sPriv->pf_enabled && sPriv->pf_current_page != 0) {
-        drm_i915_flip_t flip = { .pipes = 0 };
-
-        if (sPriv->pf_current_page & (0x3 << 2)) {
-           sPriv->pf_current_page = sPriv->pf_current_page & 0x3;
-           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 |= 1;
-
-           flip.pipes |= 0x1;
-        }
-
-        drmCommandWrite(pI830->drmSubFD, DRM_I915_FLIP, &flip, sizeof(flip));
-
-        if (sPriv->pf_current_page != 0)
-           xf86DrvMsg(pScreen->myNum, X_WARNING,
-                      "[dri] %s: kernel failed to unflip buffers.\n", 
__func__);
-      }
-#endif
-
       pI830->LockHeld = 0;
    } else if (I810_DEBUG & DEBUG_VERBOSE_DRI)
       ErrorF("i830DRISwapContext (other)\n");
@@ -1402,70 +1237,12 @@ I830DRIMoveBuffers(WindowPtr pParent, DDXPointRec 
ptOldOrg,
    i830MarkSync(pScrn);
 }
 
-/* Use callbacks from dri.c to support pageflipping mode for a single
- * 3d context without need for any specific full-screen extension.
- *
- * Also see tdfx driver for example of using these callbacks to
- * allocate and free 3d-specific memory on demand.
- */
-
-/* Use the miext/shadow module to maintain a list of dirty rectangles.
- * These are blitted to the back buffer to keep both buffers clean
- * during page-flipping when the 3d application isn't fullscreen.
- *
- * Unlike most use of the shadow code, both buffers are in video
- * memory.
- *
- * An alternative to this would be to organize for all on-screen
- * drawing operations to be duplicated for the two buffers.  That
- * might be faster, but seems like a lot more work...
- */
-
-static void
-I830DRISetPfMask(ScreenPtr pScreen, int pfMask)
-{
-   ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-   I830Ptr pI830 = I830PTR(pScrn);
-   drmI830Sarea *pSAREAPriv = DRIGetSAREAPrivate(pScreen);
-
-   if (pI830->allowPageFlip && pfMask) {
-      pSAREAPriv->pf_enabled = pI830->allowPageFlip;
-      pSAREAPriv->pf_active = pfMask;
-   } else
-      pSAREAPriv->pf_active = 0;
-}
-
-#if !DRI_SUPPORTS_CLIP_NOTIFY
-static void
-I830DRITransitionSingleToMulti3d(ScreenPtr pScreen)
-{
-   /* Tell the clients not to pageflip.  How?
-    *   -- Field in sarea, plus bumping the window counters.
-    *   -- DRM needs to cope with Front-to-Back swapbuffers.
-    */
-   I830DRISetPfMask(pScreen, 0);
-}
-
-static void
-I830DRITransitionMultiToSingle3d(ScreenPtr pScreen)
-{
-   ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-   I830Ptr pI830 = I830PTR(pScrn);
-
-   /* Let the remaining 3d app start page flipping again.
-    */
-   I830DRISetPfMask(pScreen, pI830->allowPageFlip ? 0x3 : 0);
-}
-#endif /* !DRI_SUPPORTS_CLIP_NOTIFY */
-
 static void
 I830DRITransitionTo3d(ScreenPtr pScreen)
 {
    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
    I830Ptr pI830 = I830PTR(pScrn);
 
-   I830DRISetPfMask(pScreen, pI830->allowPageFlip ? 0x3 : 0);
-
    pI830->want_vblank_interrupts = TRUE;
    I830DRISetVBlankInterrupt(pScrn, TRUE);
 }
@@ -1477,65 +1254,10 @@ I830DRITransitionTo2d(ScreenPtr pScreen)
    I830Ptr pI830 = I830PTR(pScrn);
    drmI830Sarea *sPriv = (drmI830Sarea *) DRIGetSAREAPrivate(pScreen);
 
-   I830DRISetPfMask(pScreen, 0);
-
-   sPriv->pf_enabled = 0;
-
    pI830->want_vblank_interrupts = FALSE;
    I830DRISetVBlankInterrupt(pScrn, FALSE);
 }
 
-#if DRI_SUPPORTS_CLIP_NOTIFY
-static void
-I830DRIClipNotify(ScreenPtr pScreen, WindowPtr *ppWin, int num)
-{
-   ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-   I830Ptr pI830 = I830PTR(pScrn);
-   unsigned pfMask = 0;
-
-   REGION_UNINIT(pScreen, &pI830->driRegion);
-   REGION_NULL(pScreen, &pI830->driRegion);
-
-   if (num > 0) {
-      drmI830Sarea *sPriv = (drmI830Sarea *) DRIGetSAREAPrivate(pScreen);
-      BoxRec crtcBox[2];
-      unsigned numvisible[2] = { 0, 0 };
-      int i, j;
-
-      crtcBox[0].x1 = sPriv->pipeA_x;
-      crtcBox[0].y1 = sPriv->pipeA_y;
-      crtcBox[0].x2 = crtcBox[0].x1 + sPriv->pipeA_w;
-      crtcBox[0].y2 = crtcBox[0].y1 + sPriv->pipeA_h;
-      crtcBox[1].x1 = sPriv->pipeB_x;
-      crtcBox[1].y1 = sPriv->pipeB_y;
-      crtcBox[1].x2 = crtcBox[1].x1 + sPriv->pipeB_w;
-      crtcBox[1].y2 = crtcBox[1].y1 + sPriv->pipeB_h;
-
-      for (i = 0; i < 2; i++) {
-        for (j = 0; j < num; j++) {
-           WindowPtr pWin = ppWin[j];
-
-           if (pWin) {
-              if (RECT_IN_REGION(pScreen, &pWin->clipList, &crtcBox[i]) !=
-                  rgnOUT)
-                 numvisible[i]++;
-
-              if (i == 0)
-                 REGION_UNION(pScreen, &pI830->driRegion, &pWin->clipList,
-                              &pI830->driRegion);
-           }
-        }
-
-        if (numvisible[i] == 1)
-           pfMask |= 1 << i;
-      }
-   } else
-      REGION_NULL(pScreen, &pI830->driRegion);
-
-   I830DRISetPfMask(pScreen, pfMask);
-}
-#endif /* DRI_SUPPORTS_CLIP_NOTIFY */
-
 static int
 i830_name_buffer (ScrnInfoPtr pScrn, i830_memory *mem)
 {
diff --git a/src/i830_driver.c b/src/i830_driver.c
index a75325f..e73739d 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -327,7 +327,6 @@ static OptionInfoRec I830Options[] = {
    {OPTION_SW_CURSOR,  "SWcursor",     OPTV_BOOLEAN,   {0},    FALSE},
    {OPTION_CACHE_LINES,        "CacheLines",   OPTV_INTEGER,   {0},    FALSE},
    {OPTION_DRI,                "DRI",          OPTV_BOOLEAN,   {0},    TRUE},
-   {OPTION_PAGEFLIP,   "PageFlip",     OPTV_BOOLEAN,   {0},    FALSE},
    {OPTION_XVIDEO,     "XVideo",       OPTV_BOOLEAN,   {0},    TRUE},
    {OPTION_COLOR_KEY,  "ColorKey",     OPTV_INTEGER,   {0},    FALSE},
    {OPTION_VIDEO_KEY,  "VideoKey",     OPTV_INTEGER,   {0},    FALSE},
@@ -1810,24 +1809,6 @@ I830XvInit(ScrnInfoPtr pScrn)
 #endif
 }
 
-static void
-I830DriOptsInit(ScrnInfoPtr pScrn)
-{
-#ifdef XF86DRI
-    I830Ptr pI830 = I830PTR(pScrn);
-    MessageType from = X_PROBED;
-
-    pI830->allowPageFlip = FALSE;
-    from = (pI830->directRenderingType != DRI_DISABLED &&
-           xf86GetOptValBool(pI830->Options, OPTION_PAGEFLIP,
-                             &pI830->allowPageFlip)) ? X_CONFIG : X_DEFAULT;
-
-    xf86DrvMsg(pScrn->scrnIndex, from, "Will%s try to enable page flipping\n",
-              pI830->allowPageFlip ? "" : " not");
-
-#endif /* XF86DRI */
-}
-
 /**
  * This is called per zaphod head (so usually just once) to do initialization
  * before the Screen is created.
@@ -1982,8 +1963,6 @@ I830PreInit(ScrnInfoPtr pScrn, int flags)
 
    I830XvInit(pScrn);
 
-   I830DriOptsInit(pScrn);
-
    if (!xf86SetGamma(pScrn, zeros)) {
        PreInitCleanup(pScrn);
        return FALSE;
@@ -2896,11 +2875,6 @@ i830_memory_init(ScrnInfoPtr pScrn)
 
     /* If tiling fails we have to disable page flipping & FBC */
     pScrn->displayWidth = savedDisplayWidth;
-    if (pI830->allowPageFlip)
-       xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
-               "Couldn't allocate tiled memory, page flipping "
-               "disabled\n");
-    pI830->allowPageFlip = FALSE;
     if (pI830->fb_compression)
        xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
                "Couldn't allocate tiled memory, fb compression "
@@ -3325,11 +3299,6 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int 
argc, char **argv)
        I830SwapPipes(pScrn);
 #endif
 
-#ifdef XF86DRI
-   xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Page Flipping %sabled\n",
-             pI830->allowPageFlip ? "en" : "dis");
-#endif
-
    if (I830IsPrimary(pScrn)) {
         pScrn->fbOffset = pI830->front_buffer->offset;
    } else {
@@ -3886,15 +3855,6 @@ I830CloseScreen(int scrnIndex, ScreenPtr pScreen)
 #ifdef XF86DRI
    if (pI830->directRenderingOpen &&
        pI830->directRenderingType == DRI_XF86DRI) {
-#ifdef DAMAGE
-      if (pI830->pDamage) {
-        PixmapPtr pPix = pScreen->GetScreenPixmap(pScreen);
-
-        DamageUnregister(&pPix->drawable, pI830->pDamage);
-        DamageDestroy(pI830->pDamage);
-        pI830->pDamage = NULL;
-      }
-#endif
       pI830->directRenderingOpen = FALSE;
       I830DRICloseScreen(pScreen);
    }

commit 588e8b3b8dd2fcc9e4af1a3e75c419fad56e49a6
Author: Owain G. Ainsworth <[email protected]>
Date:   Tue Jan 13 17:09:00 2009 +0000

    Remove triple-buffering support
    
    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.
    (cherry picked from commit c82adfd0169317efb6c2f9de0f315651f9adbae1)

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 55b1681..a051034 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -463,7 +463,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 */
@@ -486,7 +485,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 5ee53bb..9155c92 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 bc8d646..54a3c14 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 fbe5934..a75325f 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -340,7 +340,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},
@@ -1826,13 +1825,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 706b947..62765d6 100644
--- a/src/i830_memory.c
+++ b/src/i830_memory.c
@@ -385,7 +385,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
@@ -401,8 +400,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);
@@ -1769,14 +1766,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;


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to