From f5fa7780dd152637b422617527abca5b26d51851 Mon Sep 17 00:00:00 2001 From: Connor Behan Date: Fri, 15 Jun 2012 17:27:40 -0700 Subject: [PATCH] Fix memory locations in UTS / DFS Instead of using devPrivate.ptr, we should use EXA functions to calculate the offset of a pixmap from the EXA memory base. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=51137 Signed-off-by: Connor Behan --- src/atimach64exa.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/atimach64exa.c b/src/atimach64exa.c index e4d5307..ffab9bf 100644 --- a/src/atimach64exa.c +++ b/src/atimach64exa.c @@ -394,14 +394,18 @@ static Bool Mach64UploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src, int src_pitch) { - char *dst = pDst->devPrivate.ptr; + ScreenPtr pScreen = pDst->drawable.pScreen; + ScrnInfoPtr pScreenInfo = xf86ScreenToScrn(pScreen); + ATIPtr pATI = ATIPTR(pScreenInfo); + + char *dst = pATI->pExa->memoryBase + exaGetPixmapOffset(pDst); int dst_pitch = exaGetPixmapPitch(pDst); int bpp = pDst->drawable.bitsPerPixel; int cpp = (bpp + 7) / 8; int wBytes = w * cpp; - exaWaitSync(pDst->drawable.pScreen); + exaWaitSync(pScreen); dst += (x * cpp) + (y * dst_pitch); @@ -421,14 +425,18 @@ static Bool Mach64DownloadFromScreen(PixmapPtr pSrc, int x, int y, int w, int h, char *dst, int dst_pitch) { - char *src = pSrc->devPrivate.ptr; + ScreenPtr pScreen = pSrc->drawable.pScreen; + ScrnInfoPtr pScreenInfo = xf86ScreenToScrn(pScreen); + ATIPtr pATI = ATIPTR(pScreenInfo); + + char *src = pATI->pExa->memoryBase + exaGetPixmapOffset(pSrc); int src_pitch = exaGetPixmapPitch(pSrc); int bpp = pSrc->drawable.bitsPerPixel; int cpp = (bpp + 7) / 8; int wBytes = w * cpp; - exaWaitSync(pSrc->drawable.pScreen); + exaWaitSync(pScreen); src += (x * cpp) + (y * src_pitch); -- 1.7.10.3