Advertisement
Guest User

Untitled

a guest
May 12th, 2013
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.63 KB | None | 0 0
  1. --- sis310_accel.c.orig 2012-10-21 15:40:25.000000000 -0700
  2. +++ sis310_accel.c 2013-05-12 02:45:34.752236712 -0700
  3. @@ -101,9 +101,6 @@
  4.  
  5. #ifdef SIS_USE_EXA /* EXA */
  6. void SiSScratchSave(ScreenPtr pScreen, ExaOffscreenArea *area);
  7. -Bool SiSUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src, int src_pitch);
  8. -Bool SiSUploadToScratch(PixmapPtr pSrc, PixmapPtr pDst);
  9. -Bool SiSDownloadFromScreen(PixmapPtr pSrc, int x, int y, int w, int h, char *dst, int dst_pitch);
  10. #endif /* EXA */
  11.  
  12. void SISWriteBlitPacket(SISPtr pSiS, CARD32 *packet);
  13. @@ -1428,142 +1425,6 @@
  14. {
  15. }
  16. #endif
  17. -
  18. -Bool
  19. -SiSUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src, int src_pitch)
  20. -{
  21. - ScrnInfoPtr pScrn = xf86ScreenToScrn(pDst->drawable.pScreen);
  22. - SISPtr pSiS = SISPTR(pScrn);
  23. - unsigned char *dst = pDst->devPrivate.ptr;
  24. - int dst_pitch = exaGetPixmapPitch(pDst);
  25. -
  26. - (pSiS->SyncAccel)(pScrn);
  27. -
  28. - if(pDst->drawable.bitsPerPixel < 8)
  29. - return FALSE;
  30. -
  31. - dst += (x * pDst->drawable.bitsPerPixel / 8) + (y * src_pitch);
  32. - while(h--) {
  33. - SiSMemCopyToVideoRam(pSiS, dst, (unsigned char *)src,
  34. - (w * pDst->drawable.bitsPerPixel / 8));
  35. - src += src_pitch;
  36. - dst += dst_pitch;
  37. - }
  38. -
  39. - return TRUE;
  40. -}
  41. -
  42. -Bool
  43. -SiSUploadToScratch(PixmapPtr pSrc, PixmapPtr pDst)
  44. -{
  45. - ScrnInfoPtr pScrn = xf86ScreenToScrn(pSrc->drawable.pScreen);
  46. - SISPtr pSiS = SISPTR(pScrn);
  47. - unsigned char *src, *dst;
  48. - int src_pitch = exaGetPixmapPitch(pSrc);
  49. - int dst_pitch, size, w, h, bytes;
  50. -
  51. - w = pSrc->drawable.width;
  52. -/*
  53. -#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(6,8,2,0,0)
  54. - dst_pitch = ((w * (pSrc->drawable.bitsPerPixel >> 3)) +
  55. - pSiS->EXADriverPtr->card.offscreenPitch - 1) &
  56. - ~(pSiS->EXADriverPtr->card.offscreenPitch - 1);
  57. -#elif XORG_VERSION_CURRENT <= XORG_VERSION_NUMERIC(7,0,0,0,0)
  58. - dst_pitch = ((w * (pSrc->drawable.bitsPerPixel >> 3)) +
  59. - pSiS->EXADriverPtr->card.pixmapPitchAlign - 1) &
  60. - ~(pSiS->EXADriverPtr->card.pixmapPitchAlign - 1);
  61. -#else*/
  62. - dst_pitch = ((w * (pSrc->drawable.bitsPerPixel >> 3)) +
  63. - pSiS->EXADriverPtr->pixmapPitchAlign - 1) &
  64. - ~(pSiS->EXADriverPtr->pixmapPitchAlign - 1);
  65. -
  66. -//#endif
  67. - size = dst_pitch * pSrc->drawable.height;
  68. -
  69. - if(size > pSiS->exa_scratch->size)
  70. - return FALSE;
  71. -/*
  72. -#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(6,8,2,0,0)
  73. - pSiS->exa_scratch_next = (pSiS->exa_scratch_next +
  74. - pSiS->EXADriverPtr->card.offscreenByteAlign - 1) &
  75. - ~(pSiS->EXADriverPtr->card.offscreenByteAlign - 1);
  76. -#elif XORG_VERSION_CURRENT <= XORG_VERSION_NUMERIC(7,0,0,0,0)
  77. - pSiS->exa_scratch_next = (pSiS->exa_scratch_next +
  78. - pSiS->EXADriverPtr->card.pixmapOffsetAlign - 1) &
  79. - ~(pSiS->EXADriverPtr->card.pixmapOffsetAlign - 1);
  80. -#else*/
  81. - pSiS->exa_scratch_next = (pSiS->exa_scratch_next +
  82. - pSiS->EXADriverPtr->pixmapOffsetAlign - 1) &
  83. - ~(pSiS->EXADriverPtr->pixmapOffsetAlign - 1);
  84. -//#endif
  85. -/*
  86. -#if XORG_VERSION_CURRENT <= XORG_VERSION_NUMERIC(7,0,0,0,0)
  87. - if(pSiS->exa_scratch_next + size >
  88. - pSiS->exa_scratch->offset + pSiS->exa_scratch->size) {
  89. - (pSiS->EXADriverPtr->accel.WaitMarker)(pSrc->drawable.pScreen, 0);
  90. - pSiS->exa_scratch_next = pSiS->exa_scratch->offset;
  91. - }
  92. -#else*/
  93. - if(pSiS->exa_scratch_next + size >
  94. - pSiS->exa_scratch->offset + pSiS->exa_scratch->size) {
  95. - (pSiS->EXADriverPtr->WaitMarker)(pSrc->drawable.pScreen, 0);
  96. - pSiS->exa_scratch_next = pSiS->exa_scratch->offset;
  97. - }
  98. -//#endif
  99. -
  100. - memcpy(pDst, pSrc, sizeof(*pDst));
  101. - pDst->devKind = dst_pitch;
  102. -
  103. -//#if XORG_VERSION_CURRENT <= XORG_VERSION_NUMERIC(7,0,0,0,0)
  104. -// pDst->devPrivate.ptr = pSiS->EXADriverPtr->card.memoryBase + pSiS->exa_scratch_next;
  105. -//#else
  106. - pDst->devPrivate.ptr = pSiS->EXADriverPtr->memoryBase + pSiS->exa_scratch_next;
  107. -//#endif
  108. -
  109. - pSiS->exa_scratch_next += size;
  110. -
  111. - src = pSrc->devPrivate.ptr;
  112. - src_pitch = exaGetPixmapPitch(pSrc);
  113. - dst = pDst->devPrivate.ptr;
  114. -
  115. - bytes = (src_pitch < dst_pitch) ? src_pitch : dst_pitch;
  116. -
  117. - h = pSrc->drawable.height;
  118. -
  119. - (pSiS->SyncAccel)(pScrn);
  120. -
  121. - while(h--) {
  122. - SiSMemCopyToVideoRam(pSiS, dst, src, size);
  123. - src += src_pitch;
  124. - dst += dst_pitch;
  125. - }
  126. -
  127. - return TRUE;
  128. -}
  129. -
  130. -Bool
  131. -SiSDownloadFromScreen(PixmapPtr pSrc, int x, int y, int w, int h, char *dst, int dst_pitch)
  132. -{
  133. - ScrnInfoPtr pScrn = xf86ScreenToScrn(pSrc->drawable.pScreen);
  134. - SISPtr pSiS = SISPTR(pScrn);
  135. - unsigned char *src = pSrc->devPrivate.ptr;
  136. - int src_pitch = exaGetPixmapPitch(pSrc);
  137. - int size = src_pitch < dst_pitch ? src_pitch : dst_pitch;
  138. -
  139. - (pSiS->SyncAccel)(pScrn);
  140. -
  141. - if(pSrc->drawable.bitsPerPixel < 8)
  142. - return FALSE;
  143. -
  144. - src += (x * pSrc->drawable.bitsPerPixel / 8) + (y * src_pitch);
  145. - while(h--) {
  146. - SiSMemCopyFromVideoRam(pSiS, (unsigned char *)dst, src, size);
  147. - src += src_pitch;
  148. - dst += dst_pitch;
  149. - }
  150. -
  151. - return TRUE;
  152. -}
  153. #endif /* EXA */
  154.  
  155. /* Helper for xv video blitter and rotation */
  156. @@ -1868,9 +1729,6 @@
  157. }
  158. #endif
  159.  
  160. - /* Upload, download to/from Screen */
  161. - pSiS->EXADriverPtr->UploadToScreen = SiSUploadToScreen;
  162. - pSiS->EXADriverPtr->DownloadFromScreen = SiSDownloadFromScreen;
  163. #endif /*end of Xorg>=7.0*/
  164.  
  165. }
  166. @@ -1953,11 +1811,6 @@
  167. SiSScratchSave, pSiS);
  168. if(pSiS->exa_scratch) {
  169. pSiS->exa_scratch_next = pSiS->exa_scratch->offset;
  170. - //#if XORG_VERSION_CURRENT <= XORG_VERSION_NUMERIC(7,0,0,0,0)
  171. - // pSiS->EXADriverPtr->accel.UploadToScratch = SiSUploadToScratch;
  172. - //#else
  173. - pSiS->EXADriverPtr->UploadToScratch = SiSUploadToScratch;
  174. - //#endif
  175. }
  176.  
  177. } else {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement