Lines Matching defs:pSmi

277     SMIPtr	pSmi = SMIPTR(pScrn);
281 if (pSmi) {
282 free(pSmi->save);
283 free(pSmi->mode);
381 SMIPtr pSmi;
396 pSmi = SMIPTR(pScrn);
401 pSmi->PciInfo = xf86GetPciInfoForEntity(pEnt->index);
402 pSmi->Chipset = PCI_DEV_DEVICE_ID(pSmi->PciInfo);
404 if (IS_MSOC(pSmi)) {
405 pSmi->Save = SMI501_Save;
406 pSmi->save = xnfcalloc(sizeof(MSOCRegRec), 1);
407 pSmi->mode = xnfcalloc(sizeof(MSOCRegRec), 1);
410 pSmi->Save = SMILynx_Save;
411 pSmi->save = xnfcalloc(sizeof(SMIRegRec), 1);
412 pSmi->mode = xnfcalloc(sizeof(SMIRegRec), 1);
416 if (!IS_MSOC(pSmi))
426 pSmi->PciInfo = xf86GetPciInfoForEntity(pEnt->index);
431 if (!IS_MSOC(pSmi)) {
445 pSmi->PIOBase = hwp->PIOOffset;
447 pSmi->PIOBase = 0;
480 pSmi->Bpp = pScrn->bitsPerPixel >> 3;
518 pScrn->rgbBits = IS_MSOC(pSmi) ? 8 : 6;
525 if (!(pSmi->Options = malloc(sizeof(SMIOptions))))
528 memcpy(pSmi->Options, SMIOptions, sizeof(SMIOptions));
529 xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pSmi->Options);
533 pSmi->PCIBurst = TRUE;
534 if (xf86GetOptValBool(pSmi->Options, OPTION_PCI_BURST, &pSmi->PCIBurst))
537 pSmi->PCIBurst ? "en" : "dis");
541 pSmi->PCIRetry = pSmi->PCIBurst ? TRUE : FALSE;
542 if (xf86GetOptValBool(pSmi->Options, OPTION_PCI_RETRY, &pSmi->PCIRetry)) {
544 if (pSmi->PCIRetry && !pSmi->PCIBurst) {
547 pSmi->PCIRetry = FALSE;
551 pSmi->PCIRetry ? "en" : "dis");
553 if (xf86ReturnOptValBool(pSmi->Options, OPTION_NOACCEL, FALSE)) {
554 pSmi->NoAccel = TRUE;
558 pSmi->NoAccel = FALSE;
561 if (IS_MSOC(pSmi)) {
563 if (xf86GetOptValBool(pSmi->Options, OPTION_USE_FBDEV, &pSmi->UseFBDev))
566 pSmi->UseFBDev ? "enabled" : "disabled");
570 pSmi->HwCursor = TRUE;
572 if (xf86ReturnOptValBool(pSmi->Options, OPTION_SWCURSOR, FALSE))
573 pSmi->HwCursor = FALSE;
574 else if (!xf86GetOptValBool(pSmi->Options, OPTION_HWCURSOR, &pSmi->HwCursor))
578 pSmi->HwCursor ? "Hard" : "Soft");
580 if (xf86GetOptValInteger(pSmi->Options, OPTION_VIDEOKEY, &pSmi->videoKey)) {
582 "0x%08X\n", pSmi->videoKey);
584 pSmi->videoKey = (1 << pScrn->offset.red) |
590 if (xf86ReturnOptValBool(pSmi->Options, OPTION_BYTESWAP, FALSE)) {
591 pSmi->ByteSwap = TRUE;
594 pSmi->ByteSwap = FALSE;
598 if (xf86ReturnOptValBool(pSmi->Options, OPTION_INTERLACED, FALSE)) {
599 pSmi->interlaced = TRUE;
602 pSmi->interlaced = FALSE;
606 if (IS_MSOC(pSmi))
607 pSmi->useBIOS = FALSE;
608 else if (xf86GetOptValBool(pSmi->Options, OPTION_USEBIOS, &pSmi->useBIOS)) {
610 pSmi->useBIOS ? "enabled" : "disabled");
612 else if(pSmi->Chipset == SMI_LYNX3DM){
614 pSmi->useBIOS = FALSE;
618 pSmi->useBIOS = TRUE;
621 if (pSmi->useBIOS) {
623 pSmi->pInt10 = xf86InitInt10(pEnt->index);
626 if (pSmi->pInt10 && xf86LoadSubModule(pScrn, "vbe")) {
627 pSmi->pVbe = VBEInit(pSmi->pInt10, pEnt->index);
630 if(!pSmi->pVbe){
632 pSmi->useBIOS = FALSE;
645 pSmi->Chipset = xf86StringToToken(SMIChipsets, pScrn->chipset);
649 pSmi->Chipset = pEnt->device->chipID;
650 pScrn->chipset = (char *) xf86TokenToString(SMIChipsets, pSmi->Chipset);
653 pSmi->Chipset);
657 pSmi->Chipset = PCI_DEV_DEVICE_ID(pSmi->PciInfo);
658 pScrn->chipset = (char *) xf86TokenToString(SMIChipsets, pSmi->Chipset);
662 pSmi->ChipRev = pEnt->device->chipRev;
664 pSmi->ChipRev);
667 pSmi->ChipRev = PCI_DEV_REVISION(pSmi->PciInfo);
676 "recognised\n", pSmi->Chipset);
680 if (pSmi->Chipset < 0) {
689 pSmi->PciTag = pciTag(pSmi->PciInfo->bus, pSmi->PciInfo->device,
690 pSmi->PciInfo->func);
694 if(pSmi->Chipset == SMI_LYNX3DM &&
696 pSmi->Dualhead = TRUE;
698 pSmi->Dualhead = FALSE;
700 if (xf86GetOptValBool(pSmi->Options, OPTION_DUALHEAD, &pSmi->Dualhead))
703 if (IS_MSOC(pSmi)) {
704 pSmi->lcd = TRUE;
705 if (pSmi->Dualhead && pSmi->UseFBDev) {
708 pSmi->Dualhead = FALSE;
719 if (pSmi->Dualhead && pSmi->HwCursor) {
722 pSmi->HwCursor = FALSE;
725 else if (SMI_LYNXM_SERIES(pSmi->Chipset)) {
727 if (pSmi->Dualhead) {
728 pSmi->useBIOS = FALSE;
730 pSmi->HwCursor = FALSE;
740 pSmi->Dualhead ? "en" : "dis");
742 if (!pSmi->NoAccel) {
746 pSmi->useEXA = TRUE;
747 if ((strptr = (char *)xf86GetOptValString(pSmi->Options,
751 pSmi->useEXA = FALSE;
754 pSmi->useEXA = TRUE;
759 pSmi->useEXA ? "EXA" : "XAA");
762 if (IS_MSOC(pSmi)) {
763 pSmi->CSCVideo = !pSmi->useEXA || !pSmi->Dualhead;
765 if (xf86GetOptValBool(pSmi->Options, OPTION_CSCVIDEO, &pSmi->CSCVideo)) {
769 if (pSmi->CSCVideo && pSmi->useEXA && pSmi->Dualhead) {
772 pSmi->CSCVideo = FALSE;
777 pSmi->CSCVideo ? "en" : "dis");
788 if(!IS_MSOC(pSmi)){
814 pSmi->clockRange.next = NULL;
815 pSmi->clockRange.minClock = 20000;
817 if (SMI_LYNXM_SERIES(pSmi->Chipset) ||
818 IS_MSOC(pSmi))
819 pSmi->clockRange.maxClock = 200000;
821 pSmi->clockRange.maxClock = 135000;
823 pSmi->clockRange.clockIndex = -1;
824 pSmi->clockRange.interlaceAllowed = FALSE;
825 pSmi->clockRange.doubleScanAllowed = FALSE;
834 if (!xf86InitialConfiguration (pScrn, !pSmi->NoAccel && pSmi->useEXA)){
844 int aligned_pitch = (pScrn->virtualX*pSmi->Bpp + 15) & ~15;
846 if(aligned_pitch * pScrn->virtualY > pSmi->FBReserved){
861 if(pSmi->pVbe){
862 vbeFree(pSmi->pVbe);
863 pSmi->pVbe = NULL;
865 if(pSmi->pInt10){
866 xf86FreeInt10(pSmi->pInt10);
867 pSmi->pInt10 = NULL;
879 if (!pSmi->NoAccel) {
880 if (!pSmi->useEXA) {
883 pSmi->NoAccel = 1;
903 if (pSmi->HwCursor) {
922 SMIPtr pSmi = SMIPTR(pScrn);
929 pSmi->Save(pScrn);
933 -1,-1,-1,-1,-1, pSmi->FBBase + pSmi->FBOffset);
935 pScrn->pixmapPrivate.ptr=pSmi->FBBase + pSmi->FBOffset;
938 if(pSmi->useEXA)
939 pSmi->EXADriverPtr->memoryBase=pSmi->FBBase;
954 if (!pSmi->NoAccel)
970 SMIPtr pSmi = SMIPTR(pScrn);
983 if(pSmi->useEXA)
984 pSmi->EXADriverPtr->memoryBase=NULL;
987 memset(pSmi->FBBase, 0, pSmi->videoRAMBytes);
989 if (!IS_MSOC(pSmi)) {
992 SMILynx_WriteMode(pScrn, &hwp->SavedReg, pSmi->save);
995 SMI501_WriteMode(pScrn, pSmi->save);
1007 SMIPtr pSmi = SMIPTR(pScrn);
1009 pSmi->lcdWidth = 0;
1010 pSmi->lcdHeight = 0;
1011 if ((s = xf86GetOptValString(pSmi->Options, OPTION_PANEL_SIZE)) != NULL) {
1016 pSmi->lcdWidth = width;
1017 pSmi->lcdHeight = height;
1021 if (pSmi->lcdWidth == 0 || pSmi->lcdHeight == 0) {
1024 if (pSmi->Chipset == SMI_COUGAR3DR) {
1025 if (pSmi->pInt10 != NULL) {
1026 pSmi->pInt10->num = 0x10;
1027 pSmi->pInt10->ax = 0x5F00;
1028 pSmi->pInt10->bx = 0;
1029 pSmi->pInt10->cx = 0;
1030 pSmi->pInt10->dx = 0;
1031 xf86ExecX86int10(pSmi->pInt10);
1032 if (pSmi->pInt10->ax == 0x005F) {
1033 switch (pSmi->pInt10->cx & 0x0F) {
1035 pSmi->lcdWidth = 640;
1036 pSmi->lcdHeight = 480;
1039 pSmi->lcdWidth = 800;
1040 pSmi->lcdHeight = 600;
1043 pSmi->lcdWidth = 1024;
1044 pSmi->lcdHeight = 768;
1047 pSmi->lcdWidth = 1280;
1048 pSmi->lcdHeight = 1024;
1051 pSmi->lcdWidth = 1600;
1052 pSmi->lcdHeight = 1200;
1055 pSmi->lcdWidth = 1400;
1056 pSmi->lcdHeight = 1050;
1062 pSmi->lcdWidth, pSmi->lcdHeight);
1071 if (pSmi->lcd == 0)
1078 pSmi->lcd = 1;
1082 if (IS_MSOC(pSmi)) {
1083 pSmi->lcdWidth = (READ_SCR(pSmi, PANEL_WWIDTH) >> 16) & 2047;
1084 pSmi->lcdHeight = (READ_SCR(pSmi, PANEL_WHEIGHT) >> 16) & 2047;
1088 pSmi->lcd = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA,
1091 if (VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA,
1093 pSmi->lcd <<= 1;
1095 switch (VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA,
1098 pSmi->lcdWidth = 640;
1099 pSmi->lcdHeight = 480;
1102 pSmi->lcdWidth = 800;
1103 pSmi->lcdHeight = 600;
1106 if (VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA,
1108 pSmi->lcdWidth = 1024;
1109 pSmi->lcdHeight = 600;
1112 pSmi->lcdWidth = 1024;
1113 pSmi->lcdHeight = 768;
1117 pSmi->lcdWidth = 1280;
1118 pSmi->lcdHeight = 1024;
1124 if (!pSmi->lcdWidth && (pSmi->lcdWidth = pScrn->virtualX) == 0)
1125 pSmi->lcdWidth = 1024;
1126 if (!pSmi->lcdHeight && (pSmi->lcdHeight = pScrn->virtualY) == 0)
1127 pSmi->lcdHeight = 768;
1130 (pSmi->lcd == 0) ? "OFF" : (pSmi->lcd == 1) ? "TFT" : "DSTN",
1131 pSmi->lcdWidth, pSmi->lcdHeight);
1141 SMIPtr pSmi = SMIPTR(pScrn);
1144 if (pSmi->Chipset == SMI_LYNXEMplus){
1147 pSmi->MCLK = 157000;
1149 } else if (IS_MSOC(pSmi)) {
1153 if (!xf86IsPrimaryPci(pSmi->PciInfo) &&
1154 (READ_SCR(pSmi, DEVICE_ID) & 0xFF) >= 0xC0) {
1155 pSmi->MCLK = 112000;
1156 pSmi->MXCLK = 144000;
1160 pSmi->MCLK = 0;
1161 pSmi->MXCLK = 0;
1165 if (xf86GetOptValFreq(pSmi->Options, OPTION_MCLK, OPTUNITS_MHZ, &real)) {
1166 if (IS_MSOC(pSmi) || (int)real <= 120) {
1167 pSmi->MCLK = (int)(real * 1000.0);
1174 mclk = pSmi->MCLK;
1176 if (IS_MSOC(pSmi)) {
1177 clock.value = READ_SCR(pSmi, CURRENT_CLOCK);
1178 if (xf86GetOptValFreq(pSmi->Options, OPTION_MXCLK,
1180 pSmi->MXCLK = (int)(real * 1000.0);
1184 if (pSmi->MCLK == 0) {
1185 if (IS_MSOC(pSmi))
1192 m = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x6A);
1193 n = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x6B);
1211 if (IS_MSOC(pSmi)) {
1212 if (pSmi->MXCLK == 0) {
1218 mxclk = pSmi->MXCLK;
1226 SMIPtr pSmi = SMIPTR(pScrn);
1231 switch (pSmi->Chipset) {
1233 memBase = PCI_REGION_BASE(pSmi->PciInfo, 1, REGION_MEM);
1234 pSmi->MapSize = 0x200000;
1237 memBase = PCI_REGION_BASE(pSmi->PciInfo, 0, REGION_MEM) + 0x680000;
1238 pSmi->MapSize = 0x180000;
1242 memBase = PCI_REGION_BASE(pSmi->PciInfo, 0, REGION_MEM) + 0x400000;
1243 pSmi->MapSize = 0x400000;
1246 memBase = PCI_REGION_BASE(pSmi->PciInfo, 0, REGION_MEM);
1247 pSmi->MapSize = 0x200000;
1250 memBase = PCI_REGION_BASE(pSmi->PciInfo, 1, REGION_MEM);
1251 pSmi->MapSize = 0x200000;
1254 memBase = PCI_REGION_BASE(pSmi->PciInfo, 0, REGION_MEM) + 0x400000;
1255 pSmi->MapSize = 0x10000;
1260 pSmi->MapBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, pSmi->PciTag,
1261 memBase, pSmi->MapSize);
1264 void **result = (void**)&pSmi->MapBase;
1265 int err = pci_device_map_range(pSmi->PciInfo,
1267 pSmi->MapSize,
1272 pSmi->MapBase = NULL;
1276 if (pSmi->MapBase == NULL) {
1282 switch (pSmi->Chipset) {
1284 pSmi->DPRBase = pSmi->MapBase + 0x000000;
1285 pSmi->VPRBase = pSmi->MapBase + 0x000800;
1286 pSmi->CPRBase = pSmi->MapBase + 0x001000;
1287 pSmi->FPRBase = pSmi->MapBase + 0x005800;
1288 pSmi->IOBase = pSmi->MapBase + 0x0C0000;
1289 pSmi->DataPortBase = pSmi->MapBase + 0x100000;
1290 pSmi->DataPortSize = 0x100000;
1293 pSmi->DPRBase = pSmi->MapBase + 0x000000;
1294 pSmi->VPRBase = pSmi->MapBase + 0x000800;
1295 pSmi->CPRBase = pSmi->MapBase + 0x001000;
1296 pSmi->IOBase = pSmi->MapBase + 0x040000;
1297 pSmi->DataPortBase = pSmi->MapBase + 0x080000;
1298 pSmi->DataPortSize = 0x100000;
1302 pSmi->DPRBase = pSmi->MapBase + 0x008000;
1303 pSmi->VPRBase = pSmi->MapBase + 0x00C000;
1304 pSmi->CPRBase = pSmi->MapBase + 0x00E000;
1305 pSmi->IOBase = pSmi->MapBase + 0x300000;
1306 pSmi->DataPortBase = pSmi->MapBase /*+ 0x100000*/;
1307 pSmi->DataPortSize = 0x8000 /*0x200000*/;
1310 pSmi->DPRBase = pSmi->MapBase + 0x000000;
1311 pSmi->VPRBase = pSmi->MapBase + 0x000800;
1312 pSmi->CPRBase = pSmi->MapBase + 0x001000;
1313 pSmi->IOBase = pSmi->MapBase + 0x0C0000;
1314 pSmi->DataPortBase = pSmi->MapBase + 0x100000;
1315 pSmi->DataPortSize = 0x100000;
1318 pSmi->DPRBase = pSmi->MapBase + 0x100000;
1319 pSmi->VPRBase = pSmi->MapBase + 0x000000;
1320 pSmi->CPRBase = pSmi->MapBase + 0x090000;
1321 pSmi->DCRBase = pSmi->MapBase + 0x080000;
1322 pSmi->SCRBase = pSmi->MapBase + 0x000000;
1323 pSmi->IOBase = 0;
1324 pSmi->DataPortBase = pSmi->MapBase + 0x110000;
1325 pSmi->DataPortSize = 0x10000;
1328 pSmi->DPRBase = pSmi->MapBase + 0x8000;
1329 pSmi->VPRBase = pSmi->MapBase + 0xC000;
1330 pSmi->CPRBase = pSmi->MapBase + 0xE000;
1331 pSmi->IOBase = NULL;
1332 pSmi->DataPortBase = pSmi->MapBase;
1333 pSmi->DataPortSize = 0x8000;
1340 "Logical MMIO at %p - %p\n", pSmi->MapBase,
1341 pSmi->MapBase + pSmi->MapSize - 1);
1344 pSmi->DPRBase, pSmi->VPRBase, pSmi->IOBase);
1346 "DataPort=%p - %p\n", pSmi->DataPortBase,
1347 pSmi->DataPortBase + pSmi->DataPortSize - 1);
1358 SMIPtr pSmi = SMIPTR(pScrn);
1365 aperture_base = PCI_REGION_BASE(pSmi->PciInfo, 0, REGION_MEM) + mem_skip;
1366 mem_max = min(mem_max , PCI_REGION_SIZE(pSmi->PciInfo, 0) - mem_skip);
1369 mem = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, pSmi->PciTag,
1375 if(pci_device_map_range(pSmi->PciInfo, aperture_base, mem_max,
1395 pci_device_unmap_range(pSmi->PciInfo, mem, mem_max);
1404 SMIPtr pSmi = SMIPTR(pScrn);
1408 pSmi->videoRAMKBytes = pScrn->videoRam;
1418 if (IS_MSOC(pSmi)) {
1419 config = (READ_SCR(pSmi, DRAM_CTL) >> 13) & 7;
1420 pSmi->videoRAMKBytes = msoc_table[config] * 1024 -
1424 config = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x71);
1425 switch (pSmi->Chipset) {
1427 pSmi->videoRAMKBytes = lynx3d_table[config >> 6] * 1024 +
1431 pSmi->videoRAMKBytes = SMI_ProbeMem(pScrn, 0, 0x400000) / 1024;
1434 pSmi->videoRAMKBytes = lynx3dm_table[config >> 6] * 1024;
1439 pSmi->videoRAMKBytes = 16 * 1024;
1442 pSmi->videoRAMKBytes = default_table[config >> 6] * 1024;
1449 pSmi->videoRAMBytes = pSmi->videoRAMKBytes * 1024;
1450 pScrn->videoRam = pSmi->videoRAMKBytes;
1452 "videoram: %dkB\n", pSmi->videoRAMKBytes);
1460 SMIPtr pSmi = SMIPTR(pScrn);
1465 if (pSmi->MapBase == NULL && SMI_MapMmio(pScrn) == FALSE)
1468 pScrn->memPhysBase = PCI_REGION_BASE(pSmi->PciInfo, 0, REGION_MEM);
1470 if (pSmi->Chipset == SMI_LYNX3DM)
1471 pSmi->fbMapOffset = 0x200000;
1473 pSmi->fbMapOffset = 0x0;
1476 pSmi->FBBase = xf86MapPciMem(pScrn->scrnIndex,
1478 pSmi->PciTag,
1479 pScrn->memPhysBase + pSmi->fbMapOffset,
1480 pSmi->videoRAMBytes);
1483 void **result = (void**)&pSmi->FBBase;
1484 int err = pci_device_map_range(pSmi->PciInfo,
1486 pSmi->fbMapOffset,
1487 pSmi->videoRAMBytes,
1497 if (pSmi->FBBase == NULL) {
1505 pScrn->memPhysBase, (unsigned long)pSmi->fbMapOffset);
1507 "Logical frame buffer at %p - %p\n", pSmi->FBBase,
1508 pSmi->FBBase + pSmi->videoRAMBytes - 1);
1510 if (IS_MSOC(pSmi)) {
1513 pSmi->FBReserved = pSmi->FBCursorOffset = pSmi->videoRAMBytes -
1514 (pSmi->Dualhead ? SMI501_CURSOR_SIZE << 1 : SMI501_ARGB_CURSOR_SIZE);
1516 pSmi->FBReserved = pSmi->FBCursorOffset = pSmi->videoRAMBytes -
1517 (pSmi->Dualhead ? SMI501_CURSOR_SIZE << 1 : SMI501_CURSOR_SIZE);
1520 if (pSmi->useEXA) {
1521 pSmi->batch_active = FALSE;
1522 pSmi->batch_length = 4096;
1523 pSmi->FBReserved -= pSmi->batch_length << 3;
1524 pSmi->batch_offset = pSmi->FBReserved;
1525 pSmi->batch_handle = (int64_t *)(pSmi->FBBase + pSmi->batch_offset);
1526 pSmi->batch_finish = -1;
1527 pSmi->batch_index = 0;
1539 pSmi->FBCursorOffset = pSmi->videoRAMBytes - SMILYNX_CURSOR_SIZE;
1541 if (VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x30) & 0x01)/* #1074 */ {
1543 fifoOffset |= VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA,
1545 fifoOffset |= VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA,
1547 fifoOffset |= (VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA,
1549 pSmi->FBReserved = fifoOffset; /* PDR#1074 */
1552 pSmi->FBReserved = pSmi->videoRAMBytes - 2048;
1555 (unsigned long)pSmi->FBCursorOffset);
1559 if (pSmi->IOBase != NULL)
1560 vgaHWSetMmioFuncs(hwp, pSmi->MapBase, pSmi->IOBase - pSmi->MapBase);
1564 if (xf86IsPrimaryPci(pSmi->PciInfo)) {
1568 pSmi->PrimaryVidMapped = TRUE;
1573 (unsigned long)pSmi->FBReserved);
1585 SMIPtr pSmi = SMIPTR(pScrn);
1590 if (pSmi->PrimaryVidMapped) {
1592 pSmi->PrimaryVidMapped = FALSE;
1597 if (pSmi->MapBase) {
1599 xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pSmi->MapBase,
1600 pSmi->MapSize);
1602 pci_device_unmap_range(pSmi->PciInfo, (pointer)pSmi->MapBase,
1603 pSmi->MapSize);
1605 pSmi->MapBase = NULL;
1608 if (pSmi->FBBase) {
1610 xf86UnMapVidMem(pScrn->scrnIndex, (pointer) pSmi->FBBase,
1611 pSmi->videoRAMBytes);
1613 pci_device_unmap_range(pSmi->PciInfo, (pointer)pSmi->FBBase,
1614 pSmi->videoRAMBytes);
1616 pSmi->FBBase = NULL;
1628 SMIPtr pSmi = SMIPTR(pScrn);
1639 if (!pSmi->pInt10 && pSmi->useBIOS) {
1640 pSmi->pInt10 = xf86InitInt10(pEnt->index);
1642 if (!pSmi->pVbe && pSmi->pInt10 && xf86LoaderCheckSymbol("VBEInit")) {
1643 pSmi->pVbe = VBEInit(pSmi->pInt10, pEnt->index);
1647 pSmi->Save(pScrn);
1653 pScrn->displayWidth = ((pScrn->virtualX * pSmi->Bpp + 15) & ~15) / pSmi->Bpp;
1655 pSmi->fbArea = NULL;
1656 pSmi->FBOffset = 0;
1657 pScrn->fbOffset = pSmi->FBOffset + pSmi->fbMapOffset;
1660 memset(pSmi->FBBase, 0, pSmi->videoRAMBytes);
1690 pSmi->FBBase, pScrn->virtualX, pScrn->virtualY, pScrn->displayWidth);
1691 if(!fbScreenInit(pScreen, pSmi->FBBase, pScrn->virtualX, pScrn->virtualY, pScrn->xDpi,
1722 if (pSmi->NoAccel || !pSmi->useEXA) {
1726 numLines = pSmi->FBReserved / (pScrn->displayWidth * pSmi->Bpp);
1741 if (!pSmi->NoAccel) {
1742 if (pSmi->useEXA && !SMI_EXAInit(pScreen))
1744 else if (!pSmi->useEXA && !SMI_XAAInit(pScreen))
1757 xf86DiDGAInit(pScreen, (unsigned long)(pSmi->FBBase + pScrn->fbOffset));
1766 if (pSmi->HwCursor) {
1769 if (IS_MSOC(pSmi)) {
1774 if (!pSmi->Dualhead)
1805 pSmi->CloseScreen = pScreen->CloseScreen;
1808 if ((IS_MSOC(pSmi) &&
1810 (!IS_MSOC(pSmi) &&
1838 SMIPtr pSmi = SMIPTR(pScrn);
1843 if (pSmi->HwCursor)
1851 if (pSmi->XAAInfoRec != NULL) {
1852 XAADestroyInfoRec(pSmi->XAAInfoRec);
1855 if (pSmi->EXADriverPtr) {
1857 pSmi->EXADriverPtr = NULL;
1859 if (pSmi->pVbe != NULL) {
1860 vbeFree(pSmi->pVbe);
1861 pSmi->pVbe = NULL;
1863 if (pSmi->pInt10 != NULL) {
1864 xf86FreeInt10(pSmi->pInt10);
1865 pSmi->pInt10 = NULL;
1867 if (pSmi->ptrAdaptor != NULL) {
1868 free(pSmi->ptrAdaptor);
1870 if (pSmi->BlockHandler != NULL) {
1871 pScreen->BlockHandler = pSmi->BlockHandler;
1875 pScreen->CloseScreen = pSmi->CloseScreen;
1923 SMIPtr pSmi = SMIPTR(pScrn);
1929 if (!pSmi->NoAccel)
1988 SMIPtr pSmi = SMIPTR(pScrn);
1991 if (!IS_MSOC(pSmi)) {
1992 if (!(tmp = VGAIN8(pSmi, VGA_DAC_MASK)))
1994 pSmi->DACmask = tmp;
1995 VGAOUT8(pSmi, VGA_DAC_MASK, 0);
2002 SMIPtr pSmi = SMIPTR(pScrn);
2004 if (!IS_MSOC(pSmi)) {
2005 VGAOUT8(pSmi, VGA_DAC_MASK, pSmi->DACmask);
2014 SMIPtr pSmi = SMIPTR(pScrn);
2018 if (!IS_MSOC(pSmi)) {
2029 outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x18);
2030 tmp = inb(pSmi->PIOBase + VGA_SEQ_DATA);
2031 pSmi->SR18Value = tmp; /* PDR#521 */
2032 outb(pSmi->PIOBase + VGA_SEQ_DATA, tmp | 0x11);
2035 outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x21);
2036 tmp = inb(pSmi->PIOBase + VGA_SEQ_DATA);
2037 pSmi->SR21Value = tmp; /* PDR#521 */
2038 outb(pSmi->PIOBase + VGA_SEQ_DATA, tmp & ~0x03);
2049 SMIPtr pSmi = SMIPTR(pScrn);
2053 if (!IS_MSOC(pSmi)) {
2059 outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x21);
2060 outb(pSmi->PIOBase + VGA_SEQ_DATA, pSmi->SR21Value); /* PDR#521 */
2063 outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x18);
2064 outb(pSmi->PIOBase + VGA_SEQ_DATA, pSmi->SR18Value); /* PDR#521 */
2085 SMIPtr pSmi = SMIPTR(pScrn);
2089 if(IS_MSOC(pSmi))
2098 SMIPtr pSmi = SMIPTR(pScrn);
2106 if(IS_MSOC(pSmi))
2115 xf86ErrorFVerb(VERBLEV, " %08lX", (unsigned long)READ_DPR(pSmi, i));
2121 xf86ErrorFVerb(VERBLEV, " %08lX", (unsigned long)READ_VPR(pSmi, i));
2127 xf86ErrorFVerb(VERBLEV, " %08lX", (unsigned long)READ_CPR(pSmi, i));