summaryrefslogtreecommitdiff
path: root/saa/saa_unaccel.c
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom@vmware.com>2014-09-22 11:43:02 +0200
committerThomas Hellstrom <thellstrom@vmware.com>2014-09-24 11:57:08 +0200
commitc23fd33d8ce8491891255d93c04e053bf333bd4e (patch)
treee5df06cdd6d4fc348734da9fed1dbb3c1043f37c /saa/saa_unaccel.c
parentf86434ac69bd288c7fba65d178c22a91a0f4f6c2 (diff)
vmware/saa: Fix saa_check_copy_window dirty region v3
The saa_check_copy_window could dirty regions that were never touched, since we were using the X server provided damage region rather than the more detailed region actually copied. This would have been OK if we had first done a read-back of the region to be dirtied, but since we want to avoid that, instead compute the detailed destination region and use that for dirtying. This fixes rendering glitches seen with motif applications. v2: Fix whitespace error. v3: Move dirty region computation. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Sinclair Yeh <syeh@vmware.com> Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Diffstat (limited to 'saa/saa_unaccel.c')
-rw-r--r--saa/saa_unaccel.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/saa/saa_unaccel.c b/saa/saa_unaccel.c
index e2bf3ac..08a64b0 100644
--- a/saa/saa_unaccel.c
+++ b/saa/saa_unaccel.c
@@ -617,10 +617,32 @@ saa_check_copy_window(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
goto out_no_access;;
if (saa_prepare_access_pixmap(pPixmap, SAA_ACCESS_W, NULL)) {
+ struct saa_pixmap *spix;
+ RegionRec rgnDst;
+
+ REGION_NULL(pScreen, &rgnDst);
+ REGION_COPY(pScreen, &rgnDst, prgnSrc);
+
saa_swap(sscreen, pScreen, CopyWindow);
pScreen->CopyWindow(pWin, ptOldOrg, prgnSrc);
saa_swap(sscreen, pScreen, CopyWindow);
- saa_fad_write(pDrawable, SAA_ACCESS_W);
+ saa_finish_access_pixmap(pPixmap, SAA_ACCESS_W);
+
+ spix = saa_get_saa_pixmap(pPixmap);
+ if (spix->damage) {
+ int dx, dy;
+
+ dx = ptOldOrg.x - pWin->drawable.x;
+ dy = ptOldOrg.y - pWin->drawable.y;
+ REGION_TRANSLATE(pScreen, &rgnDst, -dx, -dy);
+ REGION_INTERSECT(pSreen, &rgnDst, &pWin->borderClip, &rgnDst);
+ REGION_TRANSLATE(pScreen, &rgnDst, xoff, yoff);
+
+ REGION_INTERSECT(pScreen, &rgnDst, &rgnDst,
+ saa_pix_damage_pending(spix));
+ saa_pixmap_dirty(pPixmap, FALSE, &rgnDst);
+ }
+ REGION_UNINIT(pScreen, &rgnDst);
}
saa_fad_read(pDrawable);
out_no_access: