EXA: Make sure driver hooks get correct offscreen offsets from exaCopyDirty.

This should ensure the driver UploadTo/DownloadFromScreen hooks can always
work as intended.
This commit is contained in:
Michel Dänzer 2007-09-17 20:33:56 +02:00
parent 56cc24ffb2
commit 547ad2125e

View File

@ -127,7 +127,7 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
ExaPixmapPriv (pPixmap); ExaPixmapPriv (pPixmap);
RegionPtr damage = DamageRegion (pExaPixmap->pDamage); RegionPtr damage = DamageRegion (pExaPixmap->pDamage);
RegionRec CopyReg; RegionRec CopyReg;
CARD8 *save_ptr; Bool save_offscreen;
int save_pitch; int save_pitch;
BoxPtr pBox; BoxPtr pBox;
int nbox; int nbox;
@ -176,9 +176,9 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
pBox = REGION_RECTS(&CopyReg); pBox = REGION_RECTS(&CopyReg);
nbox = REGION_NUM_RECTS(&CopyReg); nbox = REGION_NUM_RECTS(&CopyReg);
save_ptr = pPixmap->devPrivate.ptr; save_offscreen = pExaPixmap->offscreen;
save_pitch = pPixmap->devKind; save_pitch = pPixmap->devKind;
pPixmap->devPrivate.ptr = pExaPixmap->fb_ptr; pExaPixmap->offscreen = TRUE;
pPixmap->devKind = pExaPixmap->fb_pitch; pPixmap->devKind = pExaPixmap->fb_pitch;
while (nbox--) { while (nbox--) {
@ -216,7 +216,7 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
else else
sync (pPixmap->drawable.pScreen); sync (pPixmap->drawable.pScreen);
pPixmap->devPrivate.ptr = save_ptr; pExaPixmap->offscreen = save_offscreen;
pPixmap->devKind = save_pitch; pPixmap->devKind = save_pitch;
/* The copied bits are now valid in destination */ /* The copied bits are now valid in destination */