1 Upstream: no (Too lazy)
2 Reason: Fixes building the package by getting rid of old cpp macros
3 that are no longer accepted
4 diff --git a/src/g80_driver.c b/src/g80_driver.c
5 index 719b96c..3b8e55b 100644
8 @@ -151,7 +151,7 @@ G80PreInit(ScrnInfoPtr pScrn, int flags)
12 -#if XSERVER_LIBPCIACCESS
13 +#if defined(XSERVER_LIBPCIACCESS)
14 struct pci_device *pPci;
17 @@ -184,14 +184,14 @@ G80PreInit(ScrnInfoPtr pScrn, int flags)
18 pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
19 if(pEnt->location.type != BUS_PCI) goto fail;
20 pPci = xf86GetPciInfoForEntity(pEnt->index);
21 -#if XSERVER_LIBPCIACCESS
22 +#if defined(XSERVER_LIBPCIACCESS)
23 /* Need this to unmap */
26 primary = xf86IsPrimaryPci(pPci);
28 /* The ROM size sometimes isn't read correctly, so fix it up here. */
29 -#if XSERVER_LIBPCIACCESS
30 +#if defined(XSERVER_LIBPCIACCESS)
31 if(pPci->rom_size == 0)
33 pPci->rom_size = 64 * 1024;
34 @@ -304,7 +304,7 @@ G80PreInit(ScrnInfoPtr pScrn, int flags)
35 pScrn->memPhysBase = MEMBASE(pPci, 1);
38 -#if XSERVER_LIBPCIACCESS
39 +#if defined(XSERVER_LIBPCIACCESS)
40 err = pci_device_map_range(pPci, pPci->regions[0].base_addr, G80_REG_SIZE,
41 PCI_DEV_MAP_FLAG_WRITABLE, &p);
43 @@ -336,7 +336,7 @@ G80PreInit(ScrnInfoPtr pScrn, int flags)
45 /* Determine the size of BAR1 */
46 /* Some configs have BAR1 < total RAM < 256 MB */
47 -#if XSERVER_LIBPCIACCESS
48 +#if defined(XSERVER_LIBPCIACCESS)
49 BAR1sizeKB = pPci->regions[1].size / 1024;
51 BAR1sizeKB = 1UL << (pPci->size[1] - 10);
52 @@ -366,7 +366,7 @@ G80PreInit(ScrnInfoPtr pScrn, int flags)
53 xf86DrvMsg(pScrn->scrnIndex, X_PROBED, " Mapped memory: %.1f MB\n",
54 pScrn->videoRam / 1024.0);
56 -#if XSERVER_LIBPCIACCESS
57 +#if defined(XSERVER_LIBPCIACCESS)
58 err = pci_device_map_range(pPci, pPci->regions[1].base_addr,
59 pScrn->videoRam * 1024,
60 PCI_DEV_MAP_FLAG_WRITABLE |
61 @@ -521,7 +521,7 @@ G80CloseScreen(CLOSE_SCREEN_ARGS_DECL)
63 if(xf86ServerIsExiting()) {
64 if(pNv->int10) xf86FreeInt10(pNv->int10);
65 -#if XSERVER_LIBPCIACCESS
66 +#if defined(XSERVER_LIBPCIACCESS)
67 pci_device_unmap_range(pNv->pPci, pNv->mem, pNv->videoRam * 1024);
68 pci_device_unmap_range(pNv->pPci, (void*)pNv->reg, G80_REG_SIZE);
70 diff --git a/src/g80_type.h b/src/g80_type.h
71 index f4b73a3..5b1f975 100644
74 @@ -41,7 +41,7 @@ typedef enum AccelMethod {
77 typedef struct G80Rec {
78 -#if XSERVER_LIBPCIACCESS
79 +#if defined(XSERVER_LIBPCIACCESS)
80 struct pci_device *pPci;
82 volatile CARD32 * reg;
83 diff --git a/src/nv_const.h b/src/nv_const.h
84 index 8f9799c..b0cc14f 100644
88 #define NV_DRIVER_NAME "nv"
90 /* libpciaccess gratuitous API changes */
91 -#if XSERVER_LIBPCIACCESS
92 +#if defined(XSERVER_LIBPCIACCESS)
93 #define MEMBASE(p,n) (p)->regions[n].base_addr
94 #define VENDOR_ID(p) (p)->vendor_id
95 #define DEVICE_ID(p) (p)->device_id
96 diff --git a/src/nv_dac.c b/src/nv_dac.c
97 index 2269ae3..8d79ed8 100644
100 @@ -42,7 +42,7 @@ NVDACPanelTweaks(NVPtr pNv, NVRegPtr state)
101 we can do is experiment and apply hacks. */
103 if(((pNv->Chipset & 0xffff) == 0x0328) && (state->bpp == 32)) {
104 -#if XSERVER_LIBPCIACCESS
105 +#if defined(XSERVER_LIBPCIACCESS)
106 if (((pNv->PciInfo->subvendor_id & 0xffff) == 0x1179) &&
107 ((pNv->PciInfo->subdevice_id & 0xffff) == 0x0020))
109 diff --git a/src/nv_driver.c b/src/nv_driver.c
110 index 3a74038..cf185f8 100644
111 --- a/src/nv_driver.c
112 +++ b/src/nv_driver.c
113 @@ -43,7 +43,7 @@ Bool G80GetScrnInfoRec(PciChipsets *chips, int chip);
114 /* Mandatory functions */
115 static const OptionInfoRec * NVAvailableOptions(int chipid, int busid);
116 static void NVIdentify(int flags);
117 -#if XSERVER_LIBPCIACCESS
118 +#if defined(XSERVER_LIBPCIACCESS)
119 static Bool NVPciProbe(DriverPtr, int entity, struct pci_device*, intptr_t data);
121 static Bool NVProbe(DriverPtr drv, int flags);
122 @@ -76,7 +76,7 @@ static void NVRestore(ScrnInfoPtr pScrn);
123 static Bool NVModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode);
124 static Bool NVSetModeVBE(ScrnInfoPtr pScrn, DisplayModePtr pMode);
126 -#if XSERVER_LIBPCIACCESS
127 +#if defined(XSERVER_LIBPCIACCESS)
128 /* For now, just match any NVIDIA display device and sort through them in the
131 @@ -109,7 +109,7 @@ _X_EXPORT DriverRec NV = {
135 -#if XSERVER_LIBPCIACCESS
136 +#if defined(XSERVER_LIBPCIACCESS)
140 @@ -118,7 +118,7 @@ _X_EXPORT DriverRec NV = {
144 -#if XSERVER_LIBPCIACCESS
145 +#if defined(XSERVER_LIBPCIACCESS)
149 @@ -712,7 +712,7 @@ nvSetup(pointer module, pointer opts, int *errmaj, int *errmin)
152 xf86AddDriver(&NV, module,
153 -#if XSERVER_LIBPCIACCESS
154 +#if defined(XSERVER_LIBPCIACCESS)
158 @@ -785,14 +785,14 @@ NVGetScrnInfoRec(PciChipsets *chips, int chip)
162 -#if XSERVER_LIBPCIACCESS
163 +#if defined(XSERVER_LIBPCIACCESS)
164 NVGetPCIXpressChip (struct pci_device *dev)
166 NVGetPCIXpressChip (pciVideoPtr pVideo)
169 volatile CARD32 *regs;
170 -#if XSERVER_LIBPCIACCESS
171 +#if defined(XSERVER_LIBPCIACCESS)
172 uint32_t pciid, pcicmd;
175 @@ -902,7 +902,7 @@ NVIsSupported(CARD32 id)
179 -#if XSERVER_LIBPCIACCESS
180 +#if defined(XSERVER_LIBPCIACCESS)
182 NVPciProbe(DriverPtr drv, int entity, struct pci_device *dev, intptr_t data)
184 @@ -2097,7 +2097,7 @@ NVMapMem(ScrnInfoPtr pScrn)
186 NVPtr pNv = NVPTR(pScrn);
188 -#if XSERVER_LIBPCIACCESS
189 +#if defined(XSERVER_LIBPCIACCESS)
192 pci_device_map_range(pNv->PciInfo, pNv->FbAddress, pNv->FbMapSize,
193 @@ -2144,7 +2144,7 @@ NVUnmapMem(ScrnInfoPtr pScrn)
197 -#if XSERVER_LIBPCIACCESS
198 +#if defined(XSERVER_LIBPCIACCESS)
199 pci_device_unmap_range(pNv->PciInfo, pNv->FbBase, pNv->FbMapSize);
201 xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pNv->FbBase, pNv->FbMapSize);
202 diff --git a/src/nv_hw.c b/src/nv_hw.c
203 index 9291912..90c7ac7 100644
206 @@ -653,7 +653,7 @@ static void nv30UpdateArbitrationSettings (
207 *lwm = graphics_lwm >> 3;
210 -#if XSERVER_LIBPCIACCESS
211 +#if defined(XSERVER_LIBPCIACCESS)
212 static inline uint32_t
213 pciaccessReadLong(struct pci_device *const dev, pciaddr_t offset) {
215 @@ -670,7 +670,7 @@ static void nForceUpdateArbitrationSettings (
219 -#if XSERVER_LIBPCIACCESS
220 +#if defined(XSERVER_LIBPCIACCESS)
221 struct pci_device *const dev1 = pci_device_find_by_slot(0, 0, 0, 1);
222 struct pci_device *const dev2 = pci_device_find_by_slot(0, 0, 0, 2);
223 struct pci_device *const dev3 = pci_device_find_by_slot(0, 0, 0, 3);
224 diff --git a/src/nv_setup.c b/src/nv_setup.c
225 index 92ca3ec..8c57675 100644
228 @@ -287,7 +287,7 @@ static void nv10GetConfig (NVPtr pNv)
232 -#if XSERVER_LIBPCIACCESS
233 +#if defined(XSERVER_LIBPCIACCESS)
235 /* [AGP]: I don't know if this is correct */
236 struct pci_device *dev = pci_device_find_by_slot(0, 0, 0, 1);
237 @@ -346,7 +346,7 @@ NVCommonSetup(ScrnInfoPtr pScrn)
238 int FlatPanel = -1; /* really means the CRTC is slaved */
239 Bool Television = FALSE;
241 -#if XSERVER_LIBPCIACCESS
242 +#if defined(XSERVER_LIBPCIACCESS)
246 @@ -378,7 +378,7 @@ NVCommonSetup(ScrnInfoPtr pScrn)
247 pVga->MMIOBase = (CARD8 *)pNv;
248 pVga->MMIOOffset = 0;
250 -#if XSERVER_LIBPCIACCESS
251 +#if defined(XSERVER_LIBPCIACCESS)
252 err = pci_device_map_range(pNv->PciInfo, pNv->IOAddress, 0x01000000,
253 PCI_DEV_MAP_FLAG_WRITABLE, &tmp);
255 diff --git a/src/nv_type.h b/src/nv_type.h
256 index e705d4c..68ca210 100644
259 @@ -78,7 +78,7 @@ typedef struct {
263 -#if XSERVER_LIBPCIACCESS
264 +#if defined(XSERVER_LIBPCIACCESS)
265 struct pci_device *PciInfo;
268 diff --git a/src/riva_driver.c b/src/riva_driver.c
269 index 759501e..910e63d 100644
270 --- a/src/riva_driver.c
271 +++ b/src/riva_driver.c
272 @@ -825,7 +825,7 @@ RivaMapMem(ScrnInfoPtr pScrn)
274 * Map IO registers to virtual address space
276 -#if XSERVER_LIBPCIACCESS
277 +#if defined(XSERVER_LIBPCIACCESS)
280 pci_device_map_range(pRiva->PciInfo, pRiva->IOAddress, 0x1000000,
281 @@ -890,7 +890,7 @@ RivaUnmapMem(ScrnInfoPtr pScrn)
283 * Unmap IO registers to virtual address space
285 -#if XSERVER_LIBPCIACCESS
286 +#if defined(XSERVER_LIBPCIACCESS)
287 pci_device_unmap_range(pRiva->PciInfo, pRiva->IOBase, 0x1000000);
288 pci_device_unmap_range(pRiva->PciInfo, pRiva->FbBase, pRiva->FbMapSize);
290 diff --git a/src/riva_setup.c b/src/riva_setup.c
291 index 533f6e8..602e6dc 100644
292 --- a/src/riva_setup.c
293 +++ b/src/riva_setup.c
294 @@ -233,7 +233,7 @@ Riva3Setup(ScrnInfoPtr pScrn)
295 pRiva->riva.EnableIRQ = 0;
296 pRiva->riva.IO = VGA_IOBASE_COLOR;
298 -#if XSERVER_LIBPCIACCESS
299 +#if defined(XSERVER_LIBPCIACCESS)
300 #define MAP(ptr, offset, size) { \
302 pci_device_map_range(pRiva->PciInfo, (offset), (size), \
303 diff --git a/src/riva_type.h b/src/riva_type.h
304 index 4adeb2b..ee999c8 100644
305 --- a/src/riva_type.h
306 +++ b/src/riva_type.h
307 @@ -53,7 +53,7 @@ typedef struct {
308 RIVA_HW_STATE SavedReg;
309 RIVA_HW_STATE ModeReg;
311 -#if XSERVER_LIBPCIACCESS
312 +#if defined(XSERVER_LIBPCIACCESS)
313 struct pci_device *PciInfo;
316 diff --git a/src/nv_driver.c b/src/nv_driver.c
317 index cf185f8..d35af55 100644
318 --- a/src/nv_driver.c
319 +++ b/src/nv_driver.c
320 @@ -766,7 +766,7 @@ NVGetScrnInfoRec(PciChipsets *chips, int chip)
321 pScrn->driverName = NV_DRIVER_NAME;
322 pScrn->name = NV_NAME;
324 -#if !XSERVER_LIBPCIACCESS
325 +#ifndef XSERVER_LIBPCIACCESS
326 pScrn->Probe = NVProbe;
328 pScrn->PreInit = NVPreInit;
329 @@ -1390,7 +1390,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
331 /* Find the PCI info for this screen */
332 pNv->PciInfo = xf86GetPciInfoForEntity(pNv->pEnt->index);
333 -#if !XSERVER_LIBPCIACCESS
334 +#ifndef XSERVER_LIBPCIACCESS
335 pNv->PciTag = pciTag(pNv->PciInfo->bus, pNv->PciInfo->device,
338 diff --git a/src/riva_driver.c b/src/riva_driver.c
339 index 910e63d..a365380 100644
340 --- a/src/riva_driver.c
341 +++ b/src/riva_driver.c
342 @@ -385,7 +385,7 @@ RivaPreInit(ScrnInfoPtr pScrn, int flags)
344 /* Find the PCI info for this screen */
345 pRiva->PciInfo = xf86GetPciInfoForEntity(pRiva->pEnt->index);
346 -#if !XSERVER_LIBPCIACCESS
347 +#ifndef XSERVER_LIBPCIACCESS
348 pRiva->PciTag = pciTag(pRiva->PciInfo->bus, pRiva->PciInfo->device,
349 pRiva->PciInfo->func);