EXA: Avoid excessive syncing in PutImage

This commit is contained in:
Michel Dänzer 2008-10-20 09:55:24 -04:00 committed by Adam Jackson
parent 8d0cb507ae
commit 2188582e5e

View File

@ -129,6 +129,7 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
BoxPtr pBox; BoxPtr pBox;
int nbox; int nbox;
Bool access_prepared = FALSE; Bool access_prepared = FALSE;
Bool need_sync = FALSE;
/* Damaged bits are valid in current copy but invalid in other one */ /* Damaged bits are valid in current copy but invalid in other one */
if (exaPixmapIsOffscreen(pPixmap)) { if (exaPixmapIsOffscreen(pPixmap)) {
@ -220,14 +221,15 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
exaMemcpyBox (pPixmap, pBox, exaMemcpyBox (pPixmap, pBox,
fallback_src, fallback_srcpitch, fallback_src, fallback_srcpitch,
fallback_dst, fallback_dstpitch); fallback_dst, fallback_dstpitch);
} } else
need_sync = TRUE;
pBox++; pBox++;
} }
if (access_prepared) if (access_prepared)
exaFinishAccess(&pPixmap->drawable, fallback_index); exaFinishAccess(&pPixmap->drawable, fallback_index);
else else if (need_sync)
sync (pPixmap->drawable.pScreen); sync (pPixmap->drawable.pScreen);
pExaPixmap->offscreen = save_offscreen; pExaPixmap->offscreen = save_offscreen;