Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- sis310_accel.c.orig 2012-10-21 15:40:25.000000000 -0700
- +++ sis310_accel.c 2013-05-12 02:45:34.752236712 -0700
- @@ -101,9 +101,6 @@
- #ifdef SIS_USE_EXA /* EXA */
- void SiSScratchSave(ScreenPtr pScreen, ExaOffscreenArea *area);
- -Bool SiSUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src, int src_pitch);
- -Bool SiSUploadToScratch(PixmapPtr pSrc, PixmapPtr pDst);
- -Bool SiSDownloadFromScreen(PixmapPtr pSrc, int x, int y, int w, int h, char *dst, int dst_pitch);
- #endif /* EXA */
- void SISWriteBlitPacket(SISPtr pSiS, CARD32 *packet);
- @@ -1428,142 +1425,6 @@
- {
- }
- #endif
- -
- -Bool
- -SiSUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src, int src_pitch)
- -{
- - ScrnInfoPtr pScrn = xf86ScreenToScrn(pDst->drawable.pScreen);
- - SISPtr pSiS = SISPTR(pScrn);
- - unsigned char *dst = pDst->devPrivate.ptr;
- - int dst_pitch = exaGetPixmapPitch(pDst);
- -
- - (pSiS->SyncAccel)(pScrn);
- -
- - if(pDst->drawable.bitsPerPixel < 8)
- - return FALSE;
- -
- - dst += (x * pDst->drawable.bitsPerPixel / 8) + (y * src_pitch);
- - while(h--) {
- - SiSMemCopyToVideoRam(pSiS, dst, (unsigned char *)src,
- - (w * pDst->drawable.bitsPerPixel / 8));
- - src += src_pitch;
- - dst += dst_pitch;
- - }
- -
- - return TRUE;
- -}
- -
- -Bool
- -SiSUploadToScratch(PixmapPtr pSrc, PixmapPtr pDst)
- -{
- - ScrnInfoPtr pScrn = xf86ScreenToScrn(pSrc->drawable.pScreen);
- - SISPtr pSiS = SISPTR(pScrn);
- - unsigned char *src, *dst;
- - int src_pitch = exaGetPixmapPitch(pSrc);
- - int dst_pitch, size, w, h, bytes;
- -
- - w = pSrc->drawable.width;
- -/*
- -#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(6,8,2,0,0)
- - dst_pitch = ((w * (pSrc->drawable.bitsPerPixel >> 3)) +
- - pSiS->EXADriverPtr->card.offscreenPitch - 1) &
- - ~(pSiS->EXADriverPtr->card.offscreenPitch - 1);
- -#elif XORG_VERSION_CURRENT <= XORG_VERSION_NUMERIC(7,0,0,0,0)
- - dst_pitch = ((w * (pSrc->drawable.bitsPerPixel >> 3)) +
- - pSiS->EXADriverPtr->card.pixmapPitchAlign - 1) &
- - ~(pSiS->EXADriverPtr->card.pixmapPitchAlign - 1);
- -#else*/
- - dst_pitch = ((w * (pSrc->drawable.bitsPerPixel >> 3)) +
- - pSiS->EXADriverPtr->pixmapPitchAlign - 1) &
- - ~(pSiS->EXADriverPtr->pixmapPitchAlign - 1);
- -
- -//#endif
- - size = dst_pitch * pSrc->drawable.height;
- -
- - if(size > pSiS->exa_scratch->size)
- - return FALSE;
- -/*
- -#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(6,8,2,0,0)
- - pSiS->exa_scratch_next = (pSiS->exa_scratch_next +
- - pSiS->EXADriverPtr->card.offscreenByteAlign - 1) &
- - ~(pSiS->EXADriverPtr->card.offscreenByteAlign - 1);
- -#elif XORG_VERSION_CURRENT <= XORG_VERSION_NUMERIC(7,0,0,0,0)
- - pSiS->exa_scratch_next = (pSiS->exa_scratch_next +
- - pSiS->EXADriverPtr->card.pixmapOffsetAlign - 1) &
- - ~(pSiS->EXADriverPtr->card.pixmapOffsetAlign - 1);
- -#else*/
- - pSiS->exa_scratch_next = (pSiS->exa_scratch_next +
- - pSiS->EXADriverPtr->pixmapOffsetAlign - 1) &
- - ~(pSiS->EXADriverPtr->pixmapOffsetAlign - 1);
- -//#endif
- -/*
- -#if XORG_VERSION_CURRENT <= XORG_VERSION_NUMERIC(7,0,0,0,0)
- - if(pSiS->exa_scratch_next + size >
- - pSiS->exa_scratch->offset + pSiS->exa_scratch->size) {
- - (pSiS->EXADriverPtr->accel.WaitMarker)(pSrc->drawable.pScreen, 0);
- - pSiS->exa_scratch_next = pSiS->exa_scratch->offset;
- - }
- -#else*/
- - if(pSiS->exa_scratch_next + size >
- - pSiS->exa_scratch->offset + pSiS->exa_scratch->size) {
- - (pSiS->EXADriverPtr->WaitMarker)(pSrc->drawable.pScreen, 0);
- - pSiS->exa_scratch_next = pSiS->exa_scratch->offset;
- - }
- -//#endif
- -
- - memcpy(pDst, pSrc, sizeof(*pDst));
- - pDst->devKind = dst_pitch;
- -
- -//#if XORG_VERSION_CURRENT <= XORG_VERSION_NUMERIC(7,0,0,0,0)
- -// pDst->devPrivate.ptr = pSiS->EXADriverPtr->card.memoryBase + pSiS->exa_scratch_next;
- -//#else
- - pDst->devPrivate.ptr = pSiS->EXADriverPtr->memoryBase + pSiS->exa_scratch_next;
- -//#endif
- -
- - pSiS->exa_scratch_next += size;
- -
- - src = pSrc->devPrivate.ptr;
- - src_pitch = exaGetPixmapPitch(pSrc);
- - dst = pDst->devPrivate.ptr;
- -
- - bytes = (src_pitch < dst_pitch) ? src_pitch : dst_pitch;
- -
- - h = pSrc->drawable.height;
- -
- - (pSiS->SyncAccel)(pScrn);
- -
- - while(h--) {
- - SiSMemCopyToVideoRam(pSiS, dst, src, size);
- - src += src_pitch;
- - dst += dst_pitch;
- - }
- -
- - return TRUE;
- -}
- -
- -Bool
- -SiSDownloadFromScreen(PixmapPtr pSrc, int x, int y, int w, int h, char *dst, int dst_pitch)
- -{
- - ScrnInfoPtr pScrn = xf86ScreenToScrn(pSrc->drawable.pScreen);
- - SISPtr pSiS = SISPTR(pScrn);
- - unsigned char *src = pSrc->devPrivate.ptr;
- - int src_pitch = exaGetPixmapPitch(pSrc);
- - int size = src_pitch < dst_pitch ? src_pitch : dst_pitch;
- -
- - (pSiS->SyncAccel)(pScrn);
- -
- - if(pSrc->drawable.bitsPerPixel < 8)
- - return FALSE;
- -
- - src += (x * pSrc->drawable.bitsPerPixel / 8) + (y * src_pitch);
- - while(h--) {
- - SiSMemCopyFromVideoRam(pSiS, (unsigned char *)dst, src, size);
- - src += src_pitch;
- - dst += dst_pitch;
- - }
- -
- - return TRUE;
- -}
- #endif /* EXA */
- /* Helper for xv video blitter and rotation */
- @@ -1868,9 +1729,6 @@
- }
- #endif
- - /* Upload, download to/from Screen */
- - pSiS->EXADriverPtr->UploadToScreen = SiSUploadToScreen;
- - pSiS->EXADriverPtr->DownloadFromScreen = SiSDownloadFromScreen;
- #endif /*end of Xorg>=7.0*/
- }
- @@ -1953,11 +1811,6 @@
- SiSScratchSave, pSiS);
- if(pSiS->exa_scratch) {
- pSiS->exa_scratch_next = pSiS->exa_scratch->offset;
- - //#if XORG_VERSION_CURRENT <= XORG_VERSION_NUMERIC(7,0,0,0,0)
- - // pSiS->EXADriverPtr->accel.UploadToScratch = SiSUploadToScratch;
- - //#else
- - pSiS->EXADriverPtr->UploadToScratch = SiSUploadToScratch;
- - //#endif
- }
- } else {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement