summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYusuf Khan <yusisamerican@gmail.com>2024-02-17 14:35:11 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2024-03-17 20:52:28 +0000
commitd06264d7a350846584dd12b11203769c61c23023 (patch)
tree3e28399be4a370880203494af8ee6c892a294e5e
parentc8ab8f7868c1891a146e9f679278b990f1e23516 (diff)
treewide: #if -> #ifdef
I think the latest version of gcc got stricter in regards to this for some reason. Signed-off-by: Yusuf Khan <yusisamerican@gmail.com>
-rw-r--r--src/g80_driver.c14
-rw-r--r--src/g80_type.h2
-rw-r--r--src/nv_const.h2
-rw-r--r--src/nv_dac.c2
-rw-r--r--src/nv_driver.c24
-rw-r--r--src/nv_hw.c4
-rw-r--r--src/nv_setup.c6
-rw-r--r--src/nv_type.h2
-rw-r--r--src/riva_driver.c6
-rw-r--r--src/riva_setup.c2
-rw-r--r--src/riva_type.h2
11 files changed, 33 insertions, 33 deletions
diff --git a/src/g80_driver.c b/src/g80_driver.c
index b52fb40..10b81db 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
+#ifdef 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
+#ifdef 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
+#ifdef 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
+#ifdef 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
+#ifdef 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
+#ifdef 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
+#ifdef 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..6c7b750 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
+#ifdef XSERVER_LIBPCIACCESS
struct pci_device *pPci;
#endif
volatile CARD32 * reg;
diff --git a/src/nv_const.h b/src/nv_const.h
index 8f9799c..6f3dfd0 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
+#ifdef 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..c7a0f01 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
+#ifdef 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 070ec4c..26c9666 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
+#ifdef 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
+#ifdef 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
+#ifdef XSERVER_LIBPCIACCESS
NULL,
#else
NVProbe,
@@ -118,7 +118,7 @@ _X_EXPORT DriverRec NV = {
NULL,
0,
NULL,
-#if XSERVER_LIBPCIACCESS
+#ifdef 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
+#ifdef XSERVER_LIBPCIACCESS
HaveDriverFuncs
#else
0
@@ -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;
@@ -785,14 +785,14 @@ NVGetScrnInfoRec(PciChipsets *chips, int chip)
static CARD32
-#if XSERVER_LIBPCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
NVGetPCIXpressChip (struct pci_device *dev)
#else
NVGetPCIXpressChip (pciVideoPtr pVideo)
#endif
{
volatile CARD32 *regs;
-#if XSERVER_LIBPCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
uint32_t pciid, pcicmd;
void *tmp;
@@ -902,7 +902,7 @@ NVIsSupported(CARD32 id)
}
/* Mandatory */
-#if XSERVER_LIBPCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
static Bool
NVPciProbe(DriverPtr drv, int entity, struct pci_device *dev, intptr_t data)
{
@@ -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
@@ -2101,7 +2101,7 @@ NVMapMem(ScrnInfoPtr pScrn)
{
NVPtr pNv = NVPTR(pScrn);
-#if XSERVER_LIBPCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
void *tmp;
pci_device_map_range(pNv->PciInfo, pNv->FbAddress, pNv->FbMapSize,
@@ -2148,7 +2148,7 @@ NVUnmapMem(ScrnInfoPtr pScrn)
pNv = NVPTR(pScrn);
-#if XSERVER_LIBPCIACCESS
+#ifdef 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 6fcadc0..c013220 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
+#ifdef 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
+#ifdef 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..6a7c048 100644
--- a/src/nv_setup.c
+++ b/src/nv_setup.c
@@ -287,7 +287,7 @@ static void nv10GetConfig (NVPtr pNv)
}
#endif
-#if XSERVER_LIBPCIACCESS
+#ifdef 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
+#ifdef XSERVER_LIBPCIACCESS
int err;
#endif
@@ -378,7 +378,7 @@ NVCommonSetup(ScrnInfoPtr pScrn)
pVga->MMIOBase = (CARD8 *)pNv;
pVga->MMIOOffset = 0;
-#if XSERVER_LIBPCIACCESS
+#ifdef 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..e34ff41 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
+#ifdef XSERVER_LIBPCIACCESS
struct pci_device *PciInfo;
#else
pciVideoPtr PciInfo;
diff --git a/src/riva_driver.c b/src/riva_driver.c
index 232568c..7026b11 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
@@ -825,7 +825,7 @@ RivaMapMem(ScrnInfoPtr pScrn)
/*
* Map IO registers to virtual address space
*/
-#if XSERVER_LIBPCIACCESS
+#ifdef 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
+#ifdef 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..badc088 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
+#ifdef 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..f835722 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
+#ifdef XSERVER_LIBPCIACCESS
struct pci_device *PciInfo;
#else
pciVideoPtr PciInfo;