Return back to VESA only version

This commit is contained in:
Franco Catrin L 2004-04-06 18:09:44 +00:00
parent 07bc231872
commit 1740b938e4
3 changed files with 22 additions and 56 deletions

View File

@ -0,0 +1,3 @@
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

View File

@ -61,7 +61,7 @@ neoCardInit(KdCardInfo *card)
return FALSE; return FALSE;
} }
if(!backendInitialize(card, &neoc->backendCard)) { if(!vesaInitialize(card, &neoc->backendCard)) {
xfree(neoc); xfree(neoc);
return FALSE; return FALSE;
} }
@ -101,31 +101,16 @@ neoScreenInit(KdScreenInfo *screen)
memset (neos, '\0', sizeof (NeoScreenInfo)); memset (neos, '\0', sizeof (NeoScreenInfo));
if(!backendScreenInitialize(screen, &neos->backendScreen, &neoc->backendCard)) { if(!vesaScreenInitialize(screen, &neos->backendScreen)) {
xfree(neos); xfree(neos);
return FALSE; return FALSE;
} }
screen->softCursor = TRUE; // no hardware color cursor available screen->softCursor = TRUE; // no hardware color cursor available
switch(neoc->backendCard.type) { neos->screen = neos->backendScreen.fb;
#ifdef KDRIVEFBDEV
case FBDEV:
neos->screen = neoc->backendCard.priv.fbdev.fb;
break;
#endif
#ifdef KDRIVEVESA
case VESA:
neos->screen = neos->backendScreen.vesa.fb;
break;
#endif
default:
ErrorF("Unhandled backend, we should never get here.\n");
xfree(neos);
return FALSE;
}
memory = neoc->chip->linearSize * 1024; memory = neos->backendScreen.fb_size;
screen_size = screen->fb[0].byteStride * screen->height; screen_size = screen->fb[0].byteStride * screen->height;
memory -= screen_size; memory -= screen_size;
@ -146,37 +131,25 @@ neoScreenInit(KdScreenInfo *screen)
static Bool static Bool
neoInitScreen(ScreenPtr pScreen) neoInitScreen(ScreenPtr pScreen)
{ {
ENTER(); return vesaInitScreen(pScreen);
KdScreenPriv(pScreen);
neoCardInfo(pScreenPriv);
return neoc->backendCard.initScreen(pScreen);
LEAVE();
} }
static Bool static Bool
neoFinishInitScreen(ScreenPtr pScreen) neoFinishInitScreen(ScreenPtr pScreen)
{ {
KdScreenPriv(pScreen); return vesaFinishInitScreen(pScreen);
neoCardInfo(pScreenPriv);
return neoc->backendCard.finishInitScreen(pScreen);
} }
static Bool static Bool
neoCreateResources(ScreenPtr pScreen) neoCreateResources(ScreenPtr pScreen)
{ {
KdScreenPriv(pScreen); return vesaCreateResources(pScreen);
neoCardInfo(pScreenPriv);
return neoc->backendCard.createRes(pScreen);
} }
void void
neoPreserve(KdCardInfo *card) neoPreserve(KdCardInfo *card)
{ {
NeoCardInfo *neoc = card->driver; vesaPreserve(card);
neoc->backendCard.preserve(card);
} }
CARD8 CARD8
@ -269,7 +242,7 @@ neoEnable(ScreenPtr pScreen)
KdScreenPriv(pScreen); KdScreenPriv(pScreen);
neoCardInfo(pScreenPriv); neoCardInfo(pScreenPriv);
if(!neoc->backendCard.enable(pScreen)) { if(!vesaEnable(pScreen)) {
return FALSE; return FALSE;
} }
@ -286,34 +259,25 @@ neoDisable(ScreenPtr pScreen)
neoResetMMIO(pScreenPriv->card, neoc); neoResetMMIO(pScreenPriv->card, neoc);
neoc->backendCard.disable(pScreen); vesaDisable(pScreen);
} }
static void static void
neoGetColors(ScreenPtr pScreen, int fb, int n, xColorItem *pdefs) neoGetColors(ScreenPtr pScreen, int fb, int n, xColorItem *pdefs)
{ {
KdScreenPriv(pScreen); vesaGetColors(pScreen, fb, n, pdefs);
neoCardInfo(pScreenPriv);
neoc->backendCard.getColors(pScreen, fb, n, pdefs);
} }
static void static void
neoPutColors(ScreenPtr pScreen, int fb, int n, xColorItem *pdefs) neoPutColors(ScreenPtr pScreen, int fb, int n, xColorItem *pdefs)
{ {
KdScreenPriv(pScreen); vesaPutColors(pScreen, fb, n, pdefs);
neoCardInfo(pScreenPriv);
neoc->backendCard.putColors(pScreen, fb, n, pdefs);
} }
static Bool static Bool
neoDPMS(ScreenPtr pScreen, int mode) neoDPMS(ScreenPtr pScreen, int mode)
{ {
KdScreenPriv(pScreen); return vesaDPMS(pScreen, mode);
neoCardInfo(pScreenPriv);
return neoc->backendCard.dpms(pScreen, mode);
} }
static void static void
@ -322,16 +286,15 @@ neoRestore(KdCardInfo *card)
NeoCardInfo *neoc = card->driver; NeoCardInfo *neoc = card->driver;
neoResetMMIO(card, neoc); neoResetMMIO(card, neoc);
neoc->backendCard.restore(card); vesaRestore(card);
} }
static void static void
neoScreenFini(KdScreenInfo *screen) neoScreenFini(KdScreenInfo *screen)
{ {
NeoScreenInfo *neos =(NeoScreenInfo *) screen->driver; NeoScreenInfo *neos =(NeoScreenInfo *) screen->driver;
NeoCardInfo *neoc = screen->card->driver;
neoc->backendCard.scrfini(screen); vesaScreenFini(screen);
xfree(neos); xfree(neos);
screen->driver = 0; screen->driver = 0;
} }
@ -342,7 +305,7 @@ neoCardFini(KdCardInfo *card)
NeoCardInfo *neoc = card->driver; NeoCardInfo *neoc = card->driver;
neoUnmapReg(card, neoc); neoUnmapReg(card, neoc);
neoc->backendCard.cardfini(card); vesaCardFini(card);
} }
#define neoCursorInit 0 // initCursor #define neoCursorInit 0 // initCursor

View File

@ -110,7 +110,7 @@ typedef volatile struct {
} NeoMMIO; } NeoMMIO;
typedef struct _neoCardInfo { typedef struct _neoCardInfo {
BackendInfo backendCard; VesaCardPrivRec backendCard;
CARD32 reg_base; CARD32 reg_base;
NeoMMIO *mmio; NeoMMIO *mmio;
@ -146,7 +146,7 @@ struct NeoChipInfo {
#define neoCardInfo(kd) NeoCardInfo *neoc = getNeoCardInfo(kd) #define neoCardInfo(kd) NeoCardInfo *neoc = getNeoCardInfo(kd)
typedef struct _neoScreenInfo { typedef struct _neoScreenInfo {
BackendScreen backendScreen; VesaScreenPrivRec backendScreen;
CARD8 *screen; CARD8 *screen;
CARD8 *off_screen; CARD8 *off_screen;