summaryrefslogtreecommitdiff
path: root/src/mga_exa.c
diff options
context:
space:
mode:
authorTilman Sauerbeck <tilman@hammerfest.(none)>2006-09-09 01:14:38 +0200
committerTilman Sauerbeck <tilman@hammerfest.(none)>2006-09-09 01:14:38 +0200
commitc2545d6e94964fc981746cdf212b5dc9cd4fdd1b (patch)
treeb70672c9109dc66d18c4860598aa1e21f18105cb /src/mga_exa.c
parent3969fe1176da9e39b722982889a3cccc0f812e59 (diff)
Implemented pseudo-DMA based UTS.
Diffstat (limited to 'src/mga_exa.c')
-rw-r--r--src/mga_exa.c37
1 files changed, 30 insertions, 7 deletions
diff --git a/src/mga_exa.c b/src/mga_exa.c
index 15f43d6..74c325c 100644
--- a/src/mga_exa.c
+++ b/src/mga_exa.c
@@ -729,10 +729,35 @@ mgaComposite(PixmapPtr pDst, int srcx, int srcy, int maskx, int masky,
}
static Bool
-mgaUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src,
- int src_pitch)
+mgaUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h,
+ char *src, int src_pitch)
{
- return FALSE;
+ PMGA(pDst);
+ int bytes_padded = ((pDst->drawable.bitsPerPixel * w + 31) / 32) * 4;
+
+ QUIESCE_DMA(pDst);
+
+ mgaSetup(pMga, pDst, NULL, 10);
+
+ OUTREG(MGAREG_OPMODE, MGAOPM_DMA_BLIT);
+ OUTREG(MGAREG_DSTORG, exaGetPixmapOffset(pDst));
+ OUTREG(MGAREG_PITCH, mgaGetPixmapPitch(pDst));
+ OUTREG(MGAREG_PLNWT, 0xffffffff);
+ OUTREG(MGAREG_DWGCTL, MGADWG_ILOAD | MGADWG_BFCOL |
+ MGADWG_SGNZERO | MGADWG_SHIFTZERO |
+ MGADWG_RSTR | 0x000c0000);
+ OUTREG(MGAREG_AR0, w - 1);
+ OUTREG(MGAREG_AR3, 0);
+ OUTREG(MGAREG_AR5, 0);
+ OUTREG(MGAREG_FXBNDRY, ((x + w - 1) << 16) | (x & 0xffff));
+ OUTREG(MGAREG_YDSTLEN | MGAREG_EXEC, (y << 16) | (h & 0xffff));
+
+ while (h--) {
+ memcpy (pMga->ILOADBase, src, bytes_padded);
+ src += src_pitch;
+ }
+
+ return TRUE;
}
static Bool
@@ -811,10 +836,8 @@ mgaExaInit(ScreenPtr pScreen)
pExa->DoneComposite = mgaNoopDone;
}
- if (0) {
- pExa->DownloadFromScreen = mgaDownloadFromScreen;
- pExa->UploadToScreen = mgaUploadToScreen;
- }
+ /* pExa->DownloadFromScreen = mgaDownloadFromScreen; */
+ pExa->UploadToScreen = mgaUploadToScreen;
/* XXX fill in the XAA setup code here */
#if 0