summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hellström <thomas@shipmail.org>2006-12-07 13:07:39 +0000
committerThomas Hellström <thomas@shipmail.org>2006-12-07 13:07:39 +0000
commit9189feeeff64cfc177e1dab1a71fd2ffd0cee292 (patch)
tree48fd414dbb982d185aad07545c5cbd6d98e1d353
parent15f5d854abb8c09ad478304f07ae76da394ee517 (diff)
Fix download from screen which was reusing kernel argument
data that was altered by the kernel.
-rw-r--r--ChangeLog7
-rw-r--r--unichrome/via_accel.c16
2 files changed, 16 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 4f6ede6..bbe7cd2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2006-12-07 Thomas Hellstrom <thomas-at-tungstengraphics-dot-com>
+ * unichrome/via_accel.c: (viaAccelDMADownload):
+
+ Fix download from screen which was reusing kernel argument
+ data that was altered by the kernel.
+
+2006-12-07 Thomas Hellstrom <thomas-at-tungstengraphics-dot-com>
+
* unichrome/via_accel.c: (viaAccelDMADownload),
(viaExaDownloadFromScreen):
diff --git a/unichrome/via_accel.c b/unichrome/via_accel.c
index cb3eb58..8f2d02e 100644
--- a/unichrome/via_accel.c
+++ b/unichrome/via_accel.c
@@ -1508,7 +1508,7 @@ viaAccelDMADownload(ScrnInfoPtr pScrn, unsigned long fbOffset,
drm_via_dmablit_t blit[2], *curBlit;
unsigned char *sysAligned = NULL;
Bool doSync[2], useBounceBuffer;
- unsigned bouncePitch;
+ unsigned pitch, numLines[2];
int curBuf, err, i , ret, blitHeight;
ret = 0;
@@ -1517,9 +1517,10 @@ viaAccelDMADownload(ScrnInfoPtr pScrn, unsigned long fbOffset,
doSync[1] = FALSE;
curBuf = 1;
blitHeight = h;
+ pitch = dstPitch;
if (useBounceBuffer) {
- bouncePitch = ALIGN_TO(dstPitch, 16);
- blitHeight = VIA_DMA_DL_SIZE / bouncePitch;
+ pitch = ALIGN_TO(dstPitch, 16);
+ blitHeight = VIA_DMA_DL_SIZE / pitch;
}
while (doSync[0] || doSync[1] || h != 0) {
@@ -1537,10 +1538,10 @@ viaAccelDMADownload(ScrnInfoPtr pScrn, unsigned long fbOffset,
doSync[curBuf] = FALSE;
if (useBounceBuffer) {
- for (i = 0; i < curBlit->num_lines; ++i) {
- memcpy(dst, curBlit->mem_addr, curBlit->line_length);
+ for (i = 0; i < numLines[curBuf]; ++i) {
+ memcpy(dst, curBlit->mem_addr, w);
dst += dstPitch;
- curBlit->mem_addr += curBlit->mem_stride;
+ curBlit->mem_addr += pitch;
}
}
}
@@ -1550,6 +1551,7 @@ viaAccelDMADownload(ScrnInfoPtr pScrn, unsigned long fbOffset,
curBlit->num_lines = (h > blitHeight) ? blitHeight : h;
h -= curBlit->num_lines;
+ numLines[curBuf] = curBlit->num_lines;
sysAligned = (unsigned char *)pVia->dBounce + (curBuf * VIA_DMA_DL_SIZE);
sysAligned = (unsigned char *)
@@ -1557,7 +1559,7 @@ viaAccelDMADownload(ScrnInfoPtr pScrn, unsigned long fbOffset,
curBlit->mem_addr = (useBounceBuffer) ? sysAligned : dst;
curBlit->line_length = w;
- curBlit->mem_stride = (useBounceBuffer) ? bouncePitch : dstPitch;
+ curBlit->mem_stride = pitch;
curBlit->fb_addr = fbOffset;
curBlit->fb_stride = srcPitch;
curBlit->to_fb = 0;