xserver: Branch 'master' - 2 commits

Keith Packard keithp at kemper.freedesktop.org
Wed Nov 10 15:53:07 PST 2010


 composite/compalloc.c         |    2 +-
 composite/compwindow.c        |    4 ++--
 damageext/damageext.c         |    5 +++--
 exa/exa.c                     |    3 +--
 glx/glxdri.c                  |    4 +---
 hw/xfree86/modes/xf86Rotate.c |    2 +-
 6 files changed, 9 insertions(+), 11 deletions(-)

New commits:
commit 333b6ed26e36735ef72f314a3f8c4ec565af223f
Author: Kristian Høgsberg <krh at bitplanet.net>
Date:   Thu Oct 28 20:46:23 2010 -0700

    Set DamageSetReportAfterOp to true for the damage extension
    
    Change the damage extension reporter to queue up events after we chain
    to the wrapped functions.  Damage events are typically sent out after
    the rendering happens anyway, since we submit batch buffers from the
    flush callback chain and then flush client io buffers.  Compositing
    managers relie on this order, and there is no way we could reliably
    provide damage events to clients before the rendering happens anyway.
    
    By queueing up the damage events before the rendering happens, there's
    a risk that the client io buffer may overflow and send the damage
    events to the client before the driver has even seen the rendering
    request.  Reporting damage events after the rendering fixes this
    corner case and better corresponds with how we expect this to work.
    
    Signed-off-by: Kristian Høgsberg <krh at bitplanet.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 8d7b7a0d71e0b89321b3341b781bc8845386def6)
    [anholt: re-applied to revert the revert, now that the cause of the
    revert is fixed]
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/damageext/damageext.c b/damageext/damageext.c
index 4aa0ff3..754383d 100644
--- a/damageext/damageext.c
+++ b/damageext/damageext.c
@@ -217,6 +217,7 @@ ProcDamageCreate (ClientPtr client)
     if (!AddResource (stuff->damage, DamageExtType, (pointer) pDamageExt))
 	return BadAlloc;
 
+    DamageSetReportAfterOp (pDamageExt->pDamage, TRUE);
     DamageRegister (pDamageExt->pDrawable, pDamageExt->pDamage);
 
     if (pDrawable->type == DRAWABLE_WINDOW)
commit f36153e3ef6b13a87d016caab09cc9be274b0dd5
Author: Eric Anholt <eric at anholt.net>
Date:   Thu Oct 28 20:46:22 2010 -0700

    Replace usage of DamageRegionAppend with DamageDamageRegion to fix reportAfter.
    
    In all these cases, any rendering implied by this damage has already
    occurred, and we want to get the damage out to the client.  Some of
    the DamageRegionAppend calls were explicitly telling damage to flush
    the reportAfter damage out, but not all.
    
    Bug #30260. Fixes the compiz wallpaper plugin with client damage
    changed to reportAfter.
    
    Signed-off-by: Eric Anholt <eric at anholt.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/composite/compalloc.c b/composite/compalloc.c
index 47d5c0a..c86eb9b 100644
--- a/composite/compalloc.c
+++ b/composite/compalloc.c
@@ -238,7 +238,7 @@ compFreeClientWindow (WindowPtr pWin, XID id)
 	DamageRegister (&pWin->drawable, cw->damage);
 	cw->damageRegistered = TRUE;
 	pWin->redirectDraw = RedirectDrawAutomatic;
-	DamageRegionAppend(&pWin->drawable, &pWin->borderSize);
+	DamageDamageRegion(&pWin->drawable, &pWin->borderSize);
     }
     if (wasMapped && !pWin->mapped)
     {
diff --git a/composite/compwindow.c b/composite/compwindow.c
index 8849dc3..d17ff77 100644
--- a/composite/compwindow.c
+++ b/composite/compwindow.c
@@ -519,7 +519,7 @@ compCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
 	RegionTranslate(prgnSrc,
 			  pWin->drawable.x - ptOldOrg.x,
 			  pWin->drawable.y - ptOldOrg.y);
-	DamageRegionAppend(&pWin->drawable, prgnSrc);
+	DamageDamageRegion(&pWin->drawable, prgnSrc);
     }
     cs->CopyWindow = pScreen->CopyWindow;
     pScreen->CopyWindow = compCopyWindow;
@@ -598,7 +598,7 @@ compSetRedirectBorderClip (WindowPtr pWin, RegionPtr pRegion)
     /*
      * Report that as damaged so it will be redrawn
      */
-    DamageRegionAppend(&pWin->drawable, &damage);
+    DamageDamageRegion(&pWin->drawable, &damage);
     RegionUninit(&damage);
     /*
      * Save the new border clip region
diff --git a/damageext/damageext.c b/damageext/damageext.c
index f5265dd..4aa0ff3 100644
--- a/damageext/damageext.c
+++ b/damageext/damageext.c
@@ -222,7 +222,7 @@ ProcDamageCreate (ClientPtr client)
     if (pDrawable->type == DRAWABLE_WINDOW)
     {
 	pRegion = &((WindowPtr) pDrawable)->borderClip;
-	DamageRegionAppend(pDrawable, pRegion);
+	DamageDamageRegion(pDrawable, pRegion);
     }
 
     return Success;
@@ -292,7 +292,7 @@ ProcDamageAdd (ClientPtr client)
      * screen coordinates like damage expects.
      */
     RegionTranslate(pRegion, pDrawable->x, pDrawable->y);
-    DamageRegionAppend(pDrawable, pRegion);
+    DamageDamageRegion(pDrawable, pRegion);
     RegionTranslate(pRegion, -pDrawable->x, -pDrawable->y);
 
     return Success;
diff --git a/exa/exa.c b/exa/exa.c
index fc15c24..8adf847 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -159,8 +159,7 @@ exaPixmapDirty (PixmapPtr pPix, int x1, int y1, int x2, int y2)
 	return;
 
     RegionInit(&region, &box, 1);
-    DamageRegionAppend(&pPix->drawable, &region);
-    DamageRegionProcessPending(&pPix->drawable);
+    DamageDamageRegion(&pPix->drawable, &region);
     RegionUninit(&region);
 }
 
diff --git a/glx/glxdri.c b/glx/glxdri.c
index 41482c9..6458ef9 100644
--- a/glx/glxdri.c
+++ b/glx/glxdri.c
@@ -834,9 +834,7 @@ static void __glXReportDamage(__DRIdrawable *driDraw,
 
     RegionInit(&region, (BoxPtr) rects, num_rects);
     RegionTranslate(&region, pDraw->x, pDraw->y);
-    DamageRegionAppend(pDraw, &region);
-    /* This is wrong, this needs a seperate function. */
-    DamageRegionProcessPending(pDraw);
+    DamageDamageRegion(pDraw, &region);
     RegionUninit(&region);
 
     __glXleaveServer(GL_FALSE);
diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c
index fdc38c5..57c3499 100644
--- a/hw/xfree86/modes/xf86Rotate.c
+++ b/hw/xfree86/modes/xf86Rotate.c
@@ -168,7 +168,7 @@ xf86CrtcDamageShadow (xf86CrtcPtr crtc)
     if (damage_box.x2 > pScreen->width) damage_box.x2 = pScreen->width;
     if (damage_box.y2 > pScreen->height) damage_box.y2 = pScreen->height;
     RegionInit(&damage_region, &damage_box, 1);
-    DamageRegionAppend (&(*pScreen->GetScreenPixmap)(pScreen)->drawable,
+    DamageDamageRegion (&(*pScreen->GetScreenPixmap)(pScreen)->drawable,
 			&damage_region);
     RegionUninit(&damage_region);
     crtc->shadowClear = TRUE;


More information about the xorg-commit mailing list