st/xorg: Only damage non-front source in DRI2 CopyRegion hook.
authorMichel Dänzer <michel.daenzer@amd.com>
Mon, 22 Aug 2011 13:44:42 +0000 (15:44 +0200)
committerMichel Dänzer <michel@daenzer.net>
Fri, 26 Aug 2011 16:18:35 +0000 (18:18 +0200)
Based on a vmwgfx xa/saa fix.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
src/gallium/state_trackers/xorg/xorg_dri2.c

index 6f2c52eabb66cb01f711bf2c1ad0b2a7ac68f3ec..3350ac736cfecaafdd22e619127ef90cef8a167e 100644 (file)
@@ -372,13 +372,15 @@ dri2_copy_region(DrawablePtr pDraw, RegionPtr pRegion,
     save_accel = ms->exa->accel;
     ms->exa->accel = TRUE;
 
-    /* In case it won't be though, make sure the GPU copy contents of the
-     * source pixmap will be used for the software fallback - presumably the
-     * client modified them before calling in here.
-     */
-    exaMoveInPixmap(src_priv->pPixmap);
-    DamageRegionAppend(src_draw, pRegion);
-    DamageRegionProcessPending(src_draw);
+    if (pSrcBuffer->attachment != DRI2BufferFrontLeft) {
+       /* In case it won't be though, make sure the GPU copy contents of the
+        * source pixmap will be used for the software fallback - presumably the
+        * client modified them before calling in here.
+        */
+       exaMoveInPixmap(src_priv->pPixmap);
+       DamageRegionAppend(src_draw, pRegion);
+       DamageRegionProcessPending(src_draw);
+    }
 
    if (cust && cust->winsys_context_throttle)
        cust->winsys_context_throttle(cust, ms->ctx, THROTTLE_SWAP);