~ubuntu-branches/ubuntu/quantal/xserver-xorg-video-vesa/quantal

« back to all changes in this revision

Viewing changes to src/vesa.c

  • Committer: Package Import Robot
  • Author(s): Cyril Brulebois
  • Date: 2012-04-02 01:52:58 UTC
  • mfrom: (1.2.3) (0.5.5 sid)
  • Revision ID: package-import@ubuntu.com-20120402015258-t0jmnppjkpdyd2n9
Tags: 1:2.3.1-1
* New upstream release.
* Upload to unstable, so lower xserver-xorg-dev build-dep.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1260
1260
    pScrn->fbOffset = pVesa->mapOff;
1261
1261
 
1262
1262
#ifdef XSERVER_LIBPCIACCESS
1263
 
    if ((pVesa->mapPhys != 0xa0000) && (pVesa->pciInfo != NULL)) {
1264
 
        (void) pci_device_map_range(pVesa->pciInfo, pScrn->memPhysBase,
1265
 
                                    pVesa->mapSize,
1266
 
                                    (PCI_DEV_MAP_FLAG_WRITABLE
1267
 
                                     | PCI_DEV_MAP_FLAG_WRITE_COMBINE),
1268
 
                                    & pVesa->base);
1269
 
    }
1270
 
    else
1271
 
        pVesa->base = xf86MapDomainMemory(pScrn->scrnIndex, 0, pVesa->pciInfo,
1272
 
                                          pScrn->memPhysBase, pVesa->mapSize);
1273
 
 
1274
 
    if (pVesa->base) {
1275
 
        if (pVesa->mapPhys != 0xa0000)
1276
 
            pVesa->VGAbase = xf86MapDomainMemory(pScrn->scrnIndex, 0,
1277
 
                                                 pVesa->pciInfo,
1278
 
                                                 0xa0000, 0x10000);
1279
 
        else
1280
 
            pVesa->VGAbase = pVesa->base;
1281
 
 
 
1263
    if (pVesa->pciInfo != NULL) {
 
1264
        if (pVesa->mapPhys != 0xa0000) {
 
1265
            (void) pci_device_map_range(pVesa->pciInfo, pScrn->memPhysBase,
 
1266
                                        pVesa->mapSize,
 
1267
                                        (PCI_DEV_MAP_FLAG_WRITABLE
 
1268
                                         | PCI_DEV_MAP_FLAG_WRITE_COMBINE),
 
1269
                                        & pVesa->base);
 
1270
 
 
1271
            if (pVesa->base)
 
1272
                (void) pci_device_map_legacy(pVesa->pciInfo, 0xa0000, 0x10000,
 
1273
                                             PCI_DEV_MAP_FLAG_WRITABLE,
 
1274
                                             & pVesa->VGAbase);
 
1275
        }
 
1276
        else {
 
1277
            (void) pci_device_map_legacy(pVesa->pciInfo, pScrn->memPhysBase,
 
1278
                                         pVesa->mapSize,
 
1279
                                         PCI_DEV_MAP_FLAG_WRITABLE,
 
1280
                                         & pVesa->base);
 
1281
 
 
1282
            if (pVesa->base)
 
1283
                pVesa->VGAbase = pVesa->base;
 
1284
        }
1282
1285
    }
1283
1286
#else
1284
1287
    if (pVesa->mapPhys != 0xa0000 && pVesa->pEnt->location.type == BUS_PCI)
1299
1302
    }
1300
1303
#endif
1301
1304
 
 
1305
#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 12
1302
1306
    pVesa->ioBase = pScrn->domainIOBase;
 
1307
#else
 
1308
    pVesa->ioBase = 0;
 
1309
#endif
1303
1310
 
1304
1311
    xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, DEBUG_VERB,
1305
1312
                   "virtual address = %p,\n"
1321
1328
    if (pVesa->mapPhys != 0xa0000) {
1322
1329
        (void) pci_device_unmap_range(pVesa->pciInfo, pVesa->base,
1323
1330
                                      pVesa->mapSize);
1324
 
        xf86UnMapVidMem(pScrn->scrnIndex, pVesa->VGAbase, 0x10000);
 
1331
        (void) pci_device_unmap_legacy(pVesa->pciInfo, pVesa->VGAbase,
 
1332
                                       0x10000);
1325
1333
    }
1326
1334
    else {
1327
 
        xf86UnMapVidMem(pScrn->scrnIndex, pVesa->base, pVesa->mapSize);
 
1335
        (void) pci_device_unmap_legacy(pVesa->pciInfo, pVesa->base,
 
1336
                                       pVesa->mapSize);
1328
1337
    }
1329
1338
#else
1330
1339
    xf86UnMapVidMem(pScrn->scrnIndex, pVesa->base, pVesa->mapSize);