Lines Matching refs:pVesa

120     VESAPtr pVesa = VESAGetRec(pScrn);
122 *size = pVesa->maxBytesPerScanline;
123 return ((CARD8 *)pVesa->base + row * pVesa->maxBytesPerScanline + offset);
131 VESAPtr pVesa = VESAGetRec(pScrn);
135 offset += pVesa->maxBytesPerScanline * row;
137 pVesa->windowAoffset = window * data->WinGranularity * 1024;
139 *size = data->WinSize * 1024 - (offset - pVesa->windowAoffset);
141 return (void *)((unsigned long)pVesa->base +
142 (offset - pVesa->windowAoffset));
355 VESAPtr pVesa = VESAGetRec(pScrn);
381 if (pVesa->strict_validation) {
401 VESASetModeParameters(pVesa->pVbe, p, mode);
508 VESAPtr pVesa;
515 pVesa = VESAGetRec(pScrn);
517 pVesa->pciInfo = dev;
627 VESAPtr pVesa = VESAGetRec(pScrn);
649 free(pVesa->monitor);
650 if (pVesa->vbeInfo)
651 VBEFreeVBEInfo(pVesa->vbeInfo);
652 free(pVesa->pal);
653 free(pVesa->savedPal);
654 free(pVesa->fonts);
662 VESAPtr pVesa = VESAGetRec(pScrn);
672 pVesa->mapSize, LOOKUP_BEST_REFRESH);
682 VESAPtr pVesa;
698 pVesa = VESAGetRec(pScrn);
699 pVesa->pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
705 if ((pVesa->pVbe = VBEExtendedInit(NULL, pVesa->pEnt->index,
711 if (pVesa->pEnt->location.type == BUS_PCI) {
712 pVesa->pciInfo = xf86GetPciInfoForEntity(pVesa->pEnt->index);
713 pVesa->pciTag = pciTag(pVesa->pciInfo->bus, pVesa->pciInfo->device,
714 pVesa->pciInfo->func);
723 if ((vbe = VBEGetVBEInfo(pVesa->pVbe)) == NULL)
725 pVesa->major = (unsigned)(vbe->VESAVersion >> 8);
726 pVesa->minor = vbe->VESAVersion & 0xff;
727 pVesa->vbeInfo = vbe;
733 depths = VBEFindSupportedDepths(pVesa->pVbe, pVesa->vbeInfo, &flags24,
762 vbeFree(pVesa->pVbe);
769 vbeFree(pVesa->pVbe);
774 vbeFree(pVesa->pVbe);
783 if (pVesa->major >= 2) {
786 vbeFree(pVesa->pVbe);
790 if ((pVesa->monitor = vbeDoEDID(pVesa->pVbe, pDDCModule)) != NULL) {
791 xf86PrintEDID(pVesa->monitor);
797 if ((pScrn->monitor->DDC = pVesa->monitor) != NULL)
798 xf86SetDDCproperties(pScrn, pVesa->monitor);
800 void *panelid = VBEReadPanelID(pVesa->pVbe);
813 pScrn->modePool = VBEGetModePool (pScrn, pVesa->pVbe, pVesa->vbeInfo,
821 pVesa->mapSize = vbe->TotalMemory * 65536;
824 vbeFree(pVesa->pVbe);
830 pVesa->strict_validation = TRUE;
836 pVesa->strict_validation = FALSE;
863 vbeFree(pVesa->pVbe);
872 if (mode->BytesPerScanline > pVesa->maxBytesPerScanline) {
873 pVesa->maxBytesPerScanline = mode->BytesPerScanline;
888 vbeFree(pVesa->pVbe);
893 if (!(pVesa->Options = malloc(sizeof(VESAOptions)))) {
894 vbeFree(pVesa->pVbe);
897 memcpy(pVesa->Options, VESAOptions, sizeof(VESAOptions));
898 xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pVesa->Options);
901 if (!xf86GetOptValBool(pVesa->Options, OPTION_SHADOW_FB, &pVesa->shadowFB))
903 switch (pVesa->pciInfo->vendor_id) {
909 pVesa->shadowFB = FALSE;
913 if (pVesa->pciInfo->subvendor_id == 0x1af4)
914 pVesa->shadowFB = FALSE;
916 pVesa->shadowFB = TRUE;
920 if (pVesa->pciInfo->device_id == 0x5353)
921 pVesa->shadowFB = FALSE;
923 pVesa->shadowFB = TRUE;
927 pVesa->shadowFB = TRUE;
935 pVesa->defaultRefresh = xf86ReturnOptValBool(pVesa->Options,
938 pVesa->ModeSetClearScreen =
939 xf86ReturnOptValBool(pVesa->Options,
942 if (!pVesa->defaultRefresh && !pVesa->strict_validation)
943 VBESetModeParameters(pScrn, pVesa->pVbe);
960 vbeFree(pVesa->pVbe);
970 if (pVesa->shadowFB) {
973 vbeFree(pVesa->pVbe);
980 vbeFree(pVesa->pVbe);
984 vbeFree(pVesa->pVbe);
993 VESAPtr pVesa = VESAGetRec(pScrn);
996 pScreen->CreateScreenResources = pVesa->CreateScreenResources;
1000 shadowAdd(pScreen, pScreen->GetScreenPixmap(pScreen), pVesa->update,
1001 pVesa->window, 0, 0);
1010 VESAPtr pVesa = VESAGetRec(pScrn);
1012 pVesa->accessEnabled = enable;
1013 pVesa->EnableDisableFBAccess(arg, enable);
1020 VESAPtr pVesa = VESAGetRec(pScrn);
1025 if ((pVesa->pVbe = VBEExtendedInit(NULL, pVesa->pEnt->index,
1030 if (pVesa->mapPhys == 0) {
1032 pScrn->videoRam = pVesa->mapSize;
1033 pVesa->mapPhys = mode->PhysBasePtr;
1034 pVesa->mapOff = 0;
1037 if (pVesa->mapPhys == 0) {
1038 pVesa->mapPhys = 0xa0000;
1039 pVesa->mapSize = 0x10000;
1043 if (pVesa->mapPhys != 0xa0000) {
1044 pVesa->mapPhys = 0xa0000;
1045 pVesa->mapSize = 0x10000;
1054 if (pVesa->shadowFB && pScrn->bitsPerPixel == 4)
1057 if (pVesa->shadowFB) {
1058 pVesa->shadow = calloc(1, pScrn->displayWidth * pScrn->virtualY *
1060 if (!pVesa->shadow) {
1069 pVesa->savedPal = VBESetGetPaletteData(pVesa->pVbe, FALSE, 0, 256,
1110 pVesa->shadowFB ? pVesa->shadow : pVesa->base,
1147 if (pVesa->shadowFB) {
1148 if (pVesa->mapPhys == 0xa0000) { /* Windowed */
1149 pVesa->update = vesaUpdatePacked;
1150 pVesa->window = VESAWindowWindowed;
1153 pVesa->update = vesaUpdatePacked;
1154 pVesa->window = VESAWindowLinear;
1159 pVesa->CreateScreenResources = pScreen->CreateScreenResources;
1162 else if (pVesa->mapPhys == 0xa0000) {
1183 pVesa->vbeInfo->Capabilities[0] & 0x01 ? 8 : 6,
1187 pVesa->accessEnabled = TRUE;
1188 pVesa->EnableDisableFBAccess = pScrn->EnableDisableFBAccess;
1191 pVesa->CloseScreen = pScreen->CloseScreen;
1226 VESAPtr pVesa = VESAGetRec(pScrn);
1230 if (pVesa->savedPal)
1231 VBESetGetPaletteData(pVesa->pVbe, TRUE, 0, 256,
1232 pVesa->savedPal, FALSE, TRUE);
1235 if (pVesa->shadowFB && pVesa->shadow) {
1237 free(pVesa->shadow);
1239 if (pVesa->pDGAMode) {
1240 free(pVesa->pDGAMode);
1241 pVesa->pDGAMode = NULL;
1242 pVesa->nDGAMode = 0;
1246 pScrn->EnableDisableFBAccess = pVesa->EnableDisableFBAccess;
1247 pScreen->CreateScreenResources = pVesa->CreateScreenResources;
1248 pScreen->CloseScreen = pVesa->CloseScreen;
1256 VESAPtr pVesa = VESAGetRec(pScrn);
1257 Bool ret, disableAccess = pVesa->ModeSetClearScreen && pVesa->accessEnabled;
1271 VESAPtr pVesa;
1275 pVesa = VESAGetRec(pScrn);
1284 mode = data->mode | (pVesa->ModeSetClearScreen ? 0 : (1U << 15));
1287 if (pVesa->mapPhys != 0xa0000)
1290 if (VBESetVBEMode(pVesa->pVbe, mode, data->block) == FALSE) {
1293 VBESetVBEMode(pVesa->pVbe, (mode & ~(1 << 11)), NULL) == TRUE) {
1308 pVesa->bankSwitchWindowB =
1312 VBESetLogicalScanline(pVesa->pVbe, pScrn->displayWidth);
1314 if (pScrn->bitsPerPixel == 8 && pVesa->vbeInfo->Capabilities[0] & 0x01 &&
1316 VBESetGetDACPaletteFormat(pVesa->pVbe, 8);
1327 VESAPtr pVesa = VESAGetRec(pScrn);
1329 VBESetDisplayStart(pVesa->pVbe, x, y, TRUE);
1342 VESAPtr pVesa = VESAGetRec(pScrn);
1344 if (pVesa->base != NULL)
1347 pScrn->memPhysBase = pVesa->mapPhys;
1348 pScrn->fbOffset = pVesa->mapOff;
1351 if (pVesa->pciInfo != NULL) {
1352 if (pVesa->mapPhys != 0xa0000) {
1353 (void) pci_device_map_range(pVesa->pciInfo, pScrn->memPhysBase,
1354 pVesa->mapSize,
1357 & pVesa->base);
1359 if (pVesa->base)
1360 (void) pci_device_map_legacy(pVesa->pciInfo, 0xa0000, 0x10000,
1362 & pVesa->VGAbase);
1365 (void) pci_device_map_legacy(pVesa->pciInfo, pScrn->memPhysBase,
1366 pVesa->mapSize,
1368 & pVesa->base);
1370 if (pVesa->base)
1371 pVesa->VGAbase = pVesa->base;
1375 if (pVesa->mapPhys != 0xa0000 && pVesa->pEnt->location.type == BUS_PCI)
1376 pVesa->base = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER,
1377 pVesa->pciTag, pScrn->memPhysBase,
1378 pVesa->mapSize);
1380 pVesa->base = xf86MapDomainMemory(pScrn->scrnIndex, 0, pVesa->pciTag,
1381 pScrn->memPhysBase, pVesa->mapSize);
1383 if (pVesa->base) {
1384 if (pVesa->mapPhys != 0xa0000)
1385 pVesa->VGAbase = xf86MapDomainMemory(pScrn->scrnIndex, 0,
1386 pVesa->pciTag,
1389 pVesa->VGAbase = pVesa->base;
1394 pVesa->ioBase = pScrn->domainIOBase;
1396 pVesa->ioBase = 0;
1402 pVesa->base, pVesa->VGAbase,
1403 pScrn->memPhysBase, pVesa->mapSize);
1405 return (pVesa->base != NULL);
1411 VESAPtr pVesa = VESAGetRec(pScrn);
1413 if (pVesa->base == NULL)
1417 if (pVesa->mapPhys != 0xa0000) {
1418 (void) pci_device_unmap_range(pVesa->pciInfo, pVesa->base,
1419 pVesa->mapSize);
1420 (void) pci_device_unmap_legacy(pVesa->pciInfo, pVesa->VGAbase,
1424 (void) pci_device_unmap_legacy(pVesa->pciInfo, pVesa->base,
1425 pVesa->mapSize);
1428 xf86UnMapVidMem(pScrn->scrnIndex, pVesa->base, pVesa->mapSize);
1429 if (pVesa->mapPhys != 0xa0000)
1430 xf86UnMapVidMem(pScrn->scrnIndex, pVesa->VGAbase, 0x10000);
1432 pVesa->base = NULL;
1440 VESAPtr pVesa = VESAGetRec(pScrn);
1444 if (!pVesa->savedPal) {
1447 (void)inb(pVesa->ioBase + VGA_IOBASE_COLOR + VGA_IN_STAT_1_OFFSET); \
1448 (void)inb(pVesa->ioBase + VGA_IOBASE_COLOR + VGA_IN_STAT_1_OFFSET); \
1453 outb(pVesa->ioBase + VGA_DAC_WRITE_ADDR, idx);
1455 outb(pVesa->ioBase + VGA_DAC_DATA, colors[idx].red);
1457 outb(pVesa->ioBase + VGA_DAC_DATA, colors[idx].green);
1459 outb(pVesa->ioBase + VGA_DAC_DATA, colors[idx].blue);
1465 if (pVesa->pal == NULL)
1466 pVesa->pal = calloc(1, sizeof(CARD32) * 256);
1473 pVesa->pal[j] = colors[j].blue |
1477 VBESetGetPaletteData(pVesa->pVbe, TRUE, base, idx - base,
1478 pVesa->pal + base, FALSE, TRUE);
1484 VBESetGetPaletteData(pVesa->pVbe, TRUE, base, idx - base,
1485 pVesa->pal + base, FALSE, TRUE);
1492 WriteAttr(VESAPtr pVesa, int index, int value)
1494 (void) inb(pVesa->ioBase + VGA_IOBASE_COLOR + VGA_IN_STAT_1_OFFSET);
1497 outb(pVesa->ioBase + VGA_ATTR_INDEX, index);
1498 outb(pVesa->ioBase + VGA_ATTR_DATA_W, value);
1502 ReadAttr(VESAPtr pVesa, int index)
1504 (void) inb(pVesa->ioBase + VGA_IOBASE_COLOR + VGA_IN_STAT_1_OFFSET);
1507 outb(pVesa->ioBase + VGA_ATTR_INDEX, index);
1508 return (inb(pVesa->ioBase + VGA_ATTR_DATA_R));
1511 #define WriteMiscOut(value) outb(pVesa->ioBase + VGA_MISC_OUT_W, value)
1512 #define ReadMiscOut() inb(pVesa->ioBase + VGA_MISC_OUT_R)
1513 #define WriteSeq(index, value) outb(pVesa->ioBase + VGA_SEQ_INDEX, index);\
1514 outb(pVesa->ioBase + VGA_SEQ_DATA, value)
1517 ReadSeq(VESAPtr pVesa, int index)
1519 outb(pVesa->ioBase + VGA_SEQ_INDEX, index);
1521 return (inb(pVesa->ioBase + VGA_SEQ_DATA));
1525 outb(pVesa->ioBase + VGA_GRAPH_INDEX, index); \
1526 outb(pVesa->ioBase + VGA_GRAPH_DATA, value)
1529 ReadGr(VESAPtr pVesa, int index)
1531 outb(pVesa->ioBase + VGA_GRAPH_INDEX, index);
1533 return (inb(pVesa->ioBase + VGA_GRAPH_DATA));
1537 outb(pVesa->ioBase + (VGA_IOBASE_COLOR + VGA_CRTC_INDEX_OFFSET), index); \
1538 outb(pVesa->ioBase + (VGA_IOBASE_COLOR + VGA_CRTC_DATA_OFFSET), value)
1541 SeqReset(VESAPtr pVesa, Bool start)
1554 VESAPtr pVesa = VESAGetRec(pScrn);
1557 if (pVesa->fonts != NULL)
1561 attr10 = ReadAttr(pVesa, 0x10);
1565 pVesa->fonts = malloc(16384);
1569 gr4 = ReadGr(pVesa, 0x04);
1570 gr5 = ReadGr(pVesa, 0x05);
1571 gr6 = ReadGr(pVesa, 0x06);
1572 seq2 = ReadSeq(pVesa, 0x02);
1573 seq4 = ReadSeq(pVesa, 0x04);
1578 scrn = ReadSeq(pVesa, 0x01) | 0x20;
1579 SeqReset(pVesa, TRUE);
1581 SeqReset(pVesa, FALSE);
1583 WriteAttr(pVesa, 0x10, 0x01); /* graphics mode */
1591 slowbcopy_frombus(pVesa->VGAbase, pVesa->fonts, 8192);
1599 slowbcopy_frombus(pVesa->VGAbase, pVesa->fonts + 8192, 8192);
1601 scrn = ReadSeq(pVesa, 0x01) & ~0x20;
1602 SeqReset(pVesa, TRUE);
1604 SeqReset(pVesa, FALSE);
1607 WriteAttr(pVesa, 0x10, attr10);
1619 VESAPtr pVesa = VESAGetRec(pScrn);
1622 if (pVesa->fonts == NULL)
1625 if (pVesa->mapPhys == 0xa0000 && pVesa->curBank != 0)
1630 attr10 = ReadAttr(pVesa, 0x10);
1631 gr1 = ReadGr(pVesa, 0x01);
1632 gr3 = ReadGr(pVesa, 0x03);
1633 gr4 = ReadGr(pVesa, 0x04);
1634 gr5 = ReadGr(pVesa, 0x05);
1635 gr6 = ReadGr(pVesa, 0x06);
1636 gr8 = ReadGr(pVesa, 0x08);
1637 seq2 = ReadSeq(pVesa, 0x02);
1638 seq4 = ReadSeq(pVesa, 0x04);
1643 scrn = ReadSeq(pVesa, 0x01) | 0x20;
1644 SeqReset(pVesa, TRUE);
1646 SeqReset(pVesa, FALSE);
1648 WriteAttr(pVesa, 0x10, 0x01); /* graphics mode */
1661 slowbcopy_tobus(pVesa->fonts, pVesa->VGAbase, 8192);
1668 slowbcopy_tobus(pVesa->fonts + 8192, pVesa->VGAbase, 8192);
1670 scrn = ReadSeq(pVesa, 0x01) & ~0x20;
1671 SeqReset(pVesa, TRUE);
1673 SeqReset(pVesa, FALSE);
1677 WriteAttr(pVesa, 0x10, attr10);
1692 VESAPtr pVesa = VESAGetRec(pScrn);
1699 unsigned char scrn = ReadSeq(pVesa, 0x01);
1705 SeqReset(pVesa, TRUE);
1707 SeqReset(pVesa, FALSE);
1717 VESAPtr pVesa = VESAGetRec(pScrn);
1719 if (pVesa->curBank == iBank)
1721 if (!VBEBankSwitch(pVesa->pVbe, iBank, 0))
1723 if (pVesa->bankSwitchWindowB) {
1724 if (!VBEBankSwitch(pVesa->pVbe, iBank, 1))
1727 pVesa->curBank = iBank;
1735 VESAPtr pVesa;
1740 pVesa = VESAGetRec(pScrn);
1745 (function == MODE_SAVE && pVesa->state == NULL)) {
1748 (void)VBEGetVBEMode(pVesa->pVbe, &pVesa->stateMode);
1751 if (pVesa->major > 1) {
1752 if (!VBESaveRestore(pVesa->pVbe,function,(pointer)&pVesa->state,
1753 &pVesa->stateSize,&pVesa->statePage))
1763 if (pVesa->major > 1) {
1765 memcpy(pVesa->state, pVesa->pstate, pVesa->stateSize);
1767 if ((retval = VBESaveRestore(pVesa->pVbe,function,
1768 (pointer)&pVesa->state,
1769 &pVesa->stateSize,&pVesa->statePage))
1772 if (pVesa->pstate == NULL)
1773 pVesa->pstate = malloc(pVesa->stateSize);
1774 memcpy(pVesa->pstate, pVesa->state, pVesa->stateSize);
1779 VBESetVBEMode(pVesa->pVbe, pVesa->stateMode, NULL);
1795 VESAPtr pVesa = VESAGetRec(pScrn);
1800 VBEDPMSSet(pVesa->pVbe, mode);
1818 VESAPtr pVesa = VESAGetRec(pScrn);
1821 *ApertureBase = (unsigned char *)(long)(pVesa->mapPhys);
1822 *ApertureSize = pVesa->mapSize;
1823 *ApertureOffset = pVesa->mapOff;
1882 VESAPtr pVesa = VESAGetRec(pScrn);
1887 pDGAMode = realloc(pVesa->pDGAMode,
1888 (pVesa->nDGAMode + 1) * sizeof(DGAModeRec));
1892 pVesa->pDGAMode = pDGAMode;
1893 pDGAMode += pVesa->nDGAMode;
1896 ++pVesa->nDGAMode;
1912 pDGAMode->bytesPerScanline = pVesa->maxBytesPerScanline;
1922 pDGAMode->address = pVesa->base;
1931 VESAPtr pVesa = VESAGetRec(pScrn);
1933 if (pScrn->depth < 8 || pVesa->mapPhys == 0xa0000L)
1936 if (!pVesa->nDGAMode)
1940 pVesa->pDGAMode, pVesa->nDGAMode));