diff --git a/src/regsmi.h b/src/regsmi.h index 5dd0320..8dc214b 100644 --- a/src/regsmi.h +++ b/src/regsmi.h @@ -56,6 +56,13 @@ authorization from the XFree86 Project and SIlicon Motion. /* Mobile-System-on-a-Chip */ #define IS_MSOC(pSmi) ((pSmi)->Chipset == SMI_MSOC) +/* bernie: FIXME: must detect yeeloong */ +#define HAS_VGABIOS(pSmi) \ + (((pSmi)->Chipset == SMI_MSOC) || \ + ((pSmi)->Chipset == SMI_LYNXEMplus)) + + + /* I/O Functions */ static __inline__ CARD8 VGAIN8_INDEX(SMIPtr pSmi, int indexPort, int dataPort, CARD8 index) diff --git a/src/smi.h b/src/smi.h index 0f72db9..3deed1f 100644 --- a/src/smi.h +++ b/src/smi.h @@ -65,7 +65,7 @@ authorization from the XFree86 Project and Silicon Motion. /******************************************************************************/ #ifndef SMI_DEBUG -#define SMI_DEBUG 0 +#define SMI_DEBUG 1 #endif #define SMI_USE_IMAGE_WRITES 0 diff --git a/src/smi_driver.c b/src/smi_driver.c index 391efbc..073244e 100644 --- a/src/smi_driver.c +++ b/src/smi_driver.c @@ -740,6 +740,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) char *strptr; from = X_DEFAULT; + pSmi->useEXA =TRUE; if ((strptr = (char *)xf86GetOptValString(pSmi->Options, OPTION_ACCELMETHOD))) { if (!xf86NameCmp(strptr,"XAA")) { @@ -1217,8 +1218,6 @@ SMI_MapMmio(ScrnInfoPtr pScrn) SMIPtr pSmi = SMIPTR(pScrn); CARD32 memBase; - SMI_EnableMmio(pScrn); - switch (pSmi->Chipset) { case SMI_COUGAR3DR: memBase = PCI_REGION_BASE(pSmi->PciInfo, 1, REGION_MEM); @@ -1325,6 +1324,8 @@ SMI_MapMmio(ScrnInfoPtr pScrn) break; } + SMI_EnableMmio(pScrn); + xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, VERBLEV, "Physical MMIO at 0x%08lX\n", (unsigned long)memBase); xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, VERBLEV, @@ -1648,7 +1649,7 @@ SMI_ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) pScrn->fbOffset = pSmi->FBOffset + pSmi->fbMapOffset; /* Clear frame buffer */ - memset(pSmi->FBBase, 0, pSmi->videoRAMBytes); + memset(pSmi->FBBase, 0xF0, pSmi->videoRAMBytes); /* * The next step is to setup the screen's visuals, and initialise the @@ -2003,27 +2004,31 @@ SMI_EnableMmio(ScrnInfoPtr pScrn) ENTER(); + printf("bernie: %ld\n", pSmi->PIOBase); + if (!IS_MSOC(pSmi)) { vgaHWPtr hwp = VGAHWPTR(pScrn); - CARD8 tmp; /* * Enable chipset (seen on uninitialized secondary cards) might not be * needed once we use the VGA softbooter */ - vgaHWSetStdFuncs(hwp); + if (pSmi->IOBase) + vgaHWSetMmioFuncs(hwp, pSmi->MapBase, pSmi->IOBase - pSmi->MapBase); + else + vgaHWSetStdFuncs(hwp); /* Enable linear mode */ - outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x18); - tmp = inb(pSmi->PIOBase + VGA_SEQ_DATA); - pSmi->SR18Value = tmp; /* PDR#521 */ - outb(pSmi->PIOBase + VGA_SEQ_DATA, tmp | 0x11); + pSmi->SR18Value = VGAIN8_INDEX (pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x18); + //bernie: FIXME + //if (!saved_console_reg) + // pSmi->SavedReg.SR18 = pSmi->SR18Value; + //saved_console_reg = true; + VGAOUT8(pSmi, VGA_SEQ_DATA, pSmi->SR18Value | 0x11); /* Enable 2D/3D Engine and Video Processor */ - outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x21); - tmp = inb(pSmi->PIOBase + VGA_SEQ_DATA); - pSmi->SR21Value = tmp; /* PDR#521 */ - outb(pSmi->PIOBase + VGA_SEQ_DATA, tmp & ~0x03); + pSmi->SR21Value = VGAIN8_INDEX (pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21); + VGAOUT8(pSmi, VGA_SEQ_DATA, pSmi->SR21Value & ~0x03); } LEAVE(); @@ -2042,12 +2047,11 @@ SMI_DisableMmio(ScrnInfoPtr pScrn) vgaHWSetStdFuncs(hwp); /* Disable 2D/3D Engine and Video Processor */ - outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x21); - outb(pSmi->PIOBase + VGA_SEQ_DATA, pSmi->SR21Value); /* PDR#521 */ + /* bernie: why ~0x80? */ + VGAOUT8_INDEX (pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21, pSmi->SR21Value & ~0x80); /* Disable linear mode */ - outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x18); - outb(pSmi->PIOBase + VGA_SEQ_DATA, pSmi->SR18Value); /* PDR#521 */ + VGAOUT8_INDEX (pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x18, pSmi->SR18Value); } LEAVE(); diff --git a/src/smilynx_hw.c b/src/smilynx_hw.c index 019261d..781f4e4 100644 --- a/src/smilynx_hw.c +++ b/src/smilynx_hw.c @@ -163,7 +163,8 @@ SMILynx_Save(ScrnInfoPtr pScrn) ENTER(); /* Save the standard VGA registers */ - vgaHWSave(pScrn, vgaSavePtr, VGA_SR_ALL); + //bernie: FIXME: we need to fix DACDelay() in xserver for __mips__ + //vgaHWSave(pScrn, vgaSavePtr, VGA_SR_ALL); save->smiDACMask = VGAIN8(pSmi, VGA_DAC_MASK); VGAOUT8(pSmi, VGA_DAC_READ_ADDR, 0); for (i = 0; i < 256; i++) { @@ -374,7 +375,8 @@ SMILynx_WriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr, SMIRegPtr restore) VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21, tmp & ~0x03); } else { /* Restore the standard VGA registers */ - vgaHWRestore(pScrn, vgaSavePtr, VGA_SR_ALL); + //bernie: FIXME + //vgaHWRestore(pScrn, vgaSavePtr, VGA_SR_ALL); if (restore->smiDACMask) { VGAOUT8(pSmi, VGA_DAC_MASK, restore->smiDACMask); } else {