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