Comment 13 for bug 1066464

Revision history for this message
In , nihui (nihui) wrote :

hi
I have actually fixed this issue sometime ago.

diff -Nuarp xf86-video-sis-0.10.7/src/sis310_accel.c xf86-video-sis-0.10.7.exautsdfs/src/sis310_accel.c
--- xf86-video-sis-0.10.7/src/sis310_accel.c 2012-06-06 16:47:03.000000000 +0800
+++ xf86-video-sis-0.10.7.exautsdfs/src/sis310_accel.c 2012-09-15 13:42:59.535124999 +0800
@@ -1874,7 +1874,7 @@ SiSUploadToScreen(PixmapPtr pDst, int x,
 {
  ScrnInfoPtr pScrn = xf86ScreenToScrn(pDst->drawable.pScreen);
  SISPtr pSiS = SISPTR(pScrn);
- unsigned char *dst = pDst->devPrivate.ptr;
+ unsigned char *dst = ((unsigned char *) pSiS->FbBase) + exaGetPixmapOffset(pDst);
  int dst_pitch = exaGetPixmapPitch(pDst);

  (pSiS->SyncAccel)(pScrn);
@@ -1882,7 +1882,7 @@ SiSUploadToScreen(PixmapPtr pDst, int x,
  if(pDst->drawable.bitsPerPixel < 8)
     return FALSE;

- dst += (x * pDst->drawable.bitsPerPixel / 8) + (y * src_pitch);
+ dst += (x * pDst->drawable.bitsPerPixel / 8) + (y * dst_pitch);
  while(h--) {
     SiSMemCopyToVideoRam(pSiS, dst, (unsigned char *)src,
     (w * pDst->drawable.bitsPerPixel / 8));
@@ -1953,9 +1953,8 @@ SiSDownloadFromScreen(PixmapPtr pSrc, in
 {
  ScrnInfoPtr pScrn = xf86ScreenToScrn(pSrc->drawable.pScreen);
  SISPtr pSiS = SISPTR(pScrn);
- unsigned char *src = pSrc->devPrivate.ptr;
+ unsigned char *src = ((unsigned char *) pSiS->FbBase) + exaGetPixmapOffset(pSrc);
  int src_pitch = exaGetPixmapPitch(pSrc);
- int size = src_pitch < dst_pitch ? src_pitch : dst_pitch;

  (pSiS->SyncAccel)(pScrn);

@@ -1964,7 +1963,8 @@ SiSDownloadFromScreen(PixmapPtr pSrc, in

  src += (x * pSrc->drawable.bitsPerPixel / 8) + (y * src_pitch);
  while(h--) {
- SiSMemCopyFromVideoRam(pSiS, (unsigned char *)dst, src, size);
+ SiSMemCopyFromVideoRam(pSiS, (unsigned char *)dst, src,
+ (w * pSrc->drawable.bitsPerPixel / 8));
     src += src_pitch;
     dst += dst_pitch;
  }

reference page(chinese)
http://shuizhuyuanluo.blog.163.com/blog/static/7781812012811102554972/