diff options
author | Franco Catrin L <fcatrin@tuxpan.com> | 2004-04-11 00:53:10 +0000 |
---|---|---|
committer | Franco Catrin L <fcatrin@tuxpan.com> | 2004-04-11 00:53:10 +0000 |
commit | c231856a1343e38381e1b4e545ff1ac279141bf0 (patch) | |
tree | 8a099bec20ca8c773c4bd119562a6be60d232cca /hw | |
parent | 47436a8af82a00d0d392cef4d5906729d9a37649 (diff) |
First acceleration function implemented (DrawSolid)
Diffstat (limited to 'hw')
-rw-r--r-- | hw/kdrive/neomagic/ChangeLog | 3 | ||||
-rw-r--r-- | hw/kdrive/neomagic/neo_draw.c | 30 | ||||
-rw-r--r-- | hw/kdrive/neomagic/neomagic.c | 13 |
3 files changed, 7 insertions, 39 deletions
diff --git a/hw/kdrive/neomagic/ChangeLog b/hw/kdrive/neomagic/ChangeLog index edf4222c1..5f8384a15 100644 --- a/hw/kdrive/neomagic/ChangeLog +++ b/hw/kdrive/neomagic/ChangeLog @@ -1,6 +1,7 @@ 2004-04-10 Franco Catrin L. <fcatrin@tuxpan.com> * MMIO enabled after switching to new VT - + * First acceleration function implemented (DrawSolid) + 2004-04-06 Franco Catrin L. <fcatrin@tuxpan.com> * Returned to a working state. Brent will continue working on a backend in a separate CVS branch diff --git a/hw/kdrive/neomagic/neo_draw.c b/hw/kdrive/neomagic/neo_draw.c index b4531864b..400b09857 100644 --- a/hw/kdrive/neomagic/neo_draw.c +++ b/hw/kdrive/neomagic/neo_draw.c @@ -47,12 +47,8 @@ CARD32 fgColor; static void neoWaitIdle(NeoCardInfo *neoc) { // if MMIO is not working it may halt the machine - DBGOUT("Waiting for idle...\n"); - DBGOUT("blStat %lx=%lx\n", &mmio->bltStat, mmio->bltStat); unsigned int i = 0; while ((mmio->bltStat & 1) && ++i<100000); - if (i>=100000) DBGOUT("Wait Idle timeout\n"); - else DBGOUT("*** Wait Idle ok\n"); } static void neoWaitFifo(NeoCardInfo *neoc, int requested_fifo_space) @@ -71,19 +67,12 @@ static Bool neoPrepareSolid(PixmapPtr pPixmap, return FALSE; } else { fgColor = fg; - /* set blt control */ -/* NEO_BC0_SRC_IS_FG | - NEO_BC3_SRC_XY_ADDR | - NEO_BC3_DST_XY_ADDR | - NEO_BC3_SKIP_MAPPING | 0x0c0000; */ - return TRUE; } } static void neoSolid (int x1, int y1, int x2, int y2) { - DBGOUT("Solid (%i, %i) - (%i, %i). \n", x1, y1, x2, y2); int x, y, w, h; x = x1; y = y1; @@ -97,12 +86,6 @@ static void neoSolid (int x1, int y1, int x2, int y2) y = y2; h = -h; } - - int pitch = 16; - - neoWaitIdle(card); - mmio->bltStat = NEO_MODE1_DEPTH16 << 16; - mmio->pitch = (pitch << 16) | (pitch & 0xffff); neoWaitIdle(card); mmio->fgColor = fgColor; @@ -110,11 +93,9 @@ static void neoSolid (int x1, int y1, int x2, int y2) NEO_BC3_FIFO_EN | NEO_BC0_SRC_IS_FG | NEO_BC3_SKIP_MAPPING | 0x0c0000; - mmio->dstStart = (y <<16) | (x & 0xffff); + mmio->dstStart = y * screen->pitch + x * screen->depth; - mmio->xyExt = (h << 16) | (w & 0xffff); - DBGOUT("Solid (%i, %i) - (%i, %i). Color %li\n", x, y, w, h, fgColor); - // DBGOUT("Offset %lx. Extent %lx\n",mmio->dstStart, mmio->xyExt); + mmio->xyExt = (unsigned long)(h << 16) | (w & 0xffff); } @@ -169,10 +150,9 @@ void neoDrawEnable (ScreenPtr pScreen) screen = neos; card = neoc; mmio = neoc->mmio; - DBGOUT("NEO AA MMIO=%p\n", mmio); -// screen->depth = screen->vesa.mode.BitsPerPixel/8; -// screen->pitch = screen->vesa.mode.BytesPerScanLine; -// DBGOUT("NEO depth=%x, pitch=%x\n", screen->depth, screen->pitch); + screen->depth = screen->backendScreen.mode.BitsPerPixel/8; + screen->pitch = screen->backendScreen.mode.BytesPerScanLine; + DBGOUT("NEO depth=%x, pitch=%x\n", screen->depth, screen->pitch); LEAVE(); } diff --git a/hw/kdrive/neomagic/neomagic.c b/hw/kdrive/neomagic/neomagic.c index 60ec8f424..8ac29cbb6 100644 --- a/hw/kdrive/neomagic/neomagic.c +++ b/hw/kdrive/neomagic/neomagic.c @@ -52,7 +52,6 @@ struct NeoChipInfo neoChips[] = { static Bool neoCardInit(KdCardInfo *card) { - ENTER(); NeoCardInfo *neoc; struct NeoChipInfo *chip; @@ -79,14 +78,12 @@ neoCardInit(KdCardInfo *card) card->driver = neoc; - LEAVE(); return TRUE; } static Bool neoScreenInit(KdScreenInfo *screen) { - ENTER(); NeoScreenInfo *neos; neoCardInfo(screen); int screen_size, memory; @@ -122,7 +119,6 @@ neoScreenInit(KdScreenInfo *screen) screen->driver = neos; - LEAVE(); return TRUE; } @@ -185,7 +181,6 @@ static void neoUnlock(NeoCardInfo *neoc){ Bool neoMapReg(KdCardInfo *card, NeoCardInfo *neoc) { - ENTER(); neoc->reg_base = card->attr.address[1] & 0xFFF80000; if(!neoc->reg_base) { return FALSE; @@ -198,18 +193,12 @@ neoMapReg(KdCardInfo *card, NeoCardInfo *neoc) KdSetMappedMode(neoc->reg_base, NEO_REG_SIZE(card), KD_MAPPED_MODE_REGISTERS); - // if you see the cursor sprite them MMIO is working - - *(((CARD32 *)neoc->mmio)+0x400) =(CARD32)8; - //neoSetIndex(neoc, 0x3ce, 0x82,8); - LEAVE(); return TRUE; } void neoUnmapReg(KdCardInfo *card, NeoCardInfo *neoc) { - ENTER(); if(neoc->reg_base) { neoSetIndex(neoc, 0x3ce, 0x82,0); @@ -217,7 +206,6 @@ neoUnmapReg(KdCardInfo *card, NeoCardInfo *neoc) KdUnmapDevice((void *)neoc->mmio, NEO_REG_SIZE(card)); neoc->reg_base = 0; } - LEAVE(); } static void @@ -247,7 +235,6 @@ neoEnable(ScreenPtr pScreen) } neoSetMMIO(pScreenPriv->card, neoc); - return TRUE; } |