Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove non-XSERVER_LIBPCIACCESS paths, we depend on a new xserver anyway

  • Loading branch information...
commit 1e22673f43acd0f02ba36e189b39e28b635cd50c 1 parent aafb62f
Ben Skeggs authored
View
10 configure.ac
@@ -73,15 +73,7 @@ PKG_CHECK_MODULES(XORG, [xorg-server >= 1.4.99.901] xproto fontsproto libdrm xf8
sdkdir=$(pkg-config --variable=sdkdir xorg-server)
# Checks for libraries.
-AC_CHECK_DECL(XSERVER_LIBPCIACCESS,
- [XSERVER_LIBPCIACCESS=yes],[XSERVER_LIBPCIACCESS=no],
- [#include "xorg/xorg-server.h"])
-
-if test x$XSERVER_LIBPCIACCESS = xyes; then
- PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.10])
-fi
-
-AM_CONDITIONAL(XSERVER_LIBPCIACCESS, test "x$XSERVER_LIBPCIACCESS" = xyes)
+PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.10])
# Checks for header files.
AC_HEADER_STDC
View
4 src/nv_bios.c
@@ -180,11 +180,7 @@ static void load_vbios_pramin(NVPtr pNv, uint8_t *data)
static void load_vbios_pci(NVPtr pNv, uint8_t *data)
{
-#if XSERVER_LIBPCIACCESS
pci_device_read_rom(pNv->PciInfo, data);
-#else
- xf86ReadPciBIOS(0, pNv->PciTag, 0, data, NV_PROM_SIZE);
-#endif
}
struct methods {
View
171 src/nv_driver.c
@@ -37,9 +37,6 @@
/* Mandatory functions */
static const OptionInfoRec * NVAvailableOptions(int chipid, int busid);
static void NVIdentify(int flags);
-#ifndef XSERVER_LIBPCIACCESS
-static Bool NVProbe(DriverPtr drv, int flags);
-#endif /* XSERVER_LIBPCIACCESS */
static Bool NVPreInit(ScrnInfoPtr pScrn, int flags);
static Bool NVScreenInit(int Index, ScreenPtr pScreen, int argc,
char **argv);
@@ -61,8 +58,6 @@ static Bool NVUnmapMem(ScrnInfoPtr pScrn);
static void NVSave(ScrnInfoPtr pScrn);
static void NVRestore(ScrnInfoPtr pScrn);
-#ifdef XSERVER_LIBPCIACCESS
-
#define NOUVEAU_PCI_DEVICE(_vendor_id, _device_id) \
{ (_vendor_id), (_device_id), PCI_MATCH_ANY, PCI_MATCH_ANY, 0x00030000, 0x00ffffff, 0 }
@@ -77,8 +72,6 @@ static Bool NVPciProbe ( DriverPtr drv,
struct pci_device *dev,
intptr_t match_data );
-#endif /* XSERVER_LIBPCIACCESS */
-
/*
* This contains the functions needed by the server after loading the
* driver module. It must be supplied, and gets added the driver list by
@@ -91,19 +84,13 @@ _X_EXPORT DriverRec NV = {
NV_VERSION,
NV_DRIVER_NAME,
NVIdentify,
-#ifdef XSERVER_LIBPCIACCESS
NULL,
-#else
- NVProbe,
-#endif /* XSERVER_LIBPCIACCESS */
NVAvailableOptions,
NULL,
0,
NULL,
-#ifdef XSERVER_LIBPCIACCESS
nouveau_device_match,
NVPciProbe
-#endif /* XSERVER_LIBPCIACCESS */
};
struct NvFamily
@@ -210,36 +197,6 @@ NVIdentify(int flags)
}
}
-
-#ifndef XSERVER_LIBPCIACCESS
-static Bool
-NVGetScrnInfoRec(PciChipsets *chips, int chip)
-{
- ScrnInfoPtr pScrn;
-
- pScrn = xf86ConfigPciEntity(NULL, 0, chip,
- chips, NULL, NULL, NULL,
- NULL, NULL);
-
- if(!pScrn) return FALSE;
-
- pScrn->driverVersion = NV_VERSION;
- pScrn->driverName = NV_DRIVER_NAME;
- pScrn->name = NV_NAME;
-
- pScrn->Probe = NVProbe;
- pScrn->PreInit = NVPreInit;
- pScrn->ScreenInit = NVScreenInit;
- pScrn->SwitchMode = NVSwitchMode;
- pScrn->AdjustFrame = NVAdjustFrame;
- pScrn->EnterVT = NVEnterVT;
- pScrn->LeaveVT = NVLeaveVT;
- pScrn->FreeScreen = NVFreeScreen;
-
- return TRUE;
-}
-#endif
-
/* This returns architecture in hexdecimal, so NV40 is 0x40 */
static int NVGetArchitecture(volatile uint32_t *regs)
{
@@ -291,8 +248,6 @@ static uint32_t NVGetPCIID(volatile uint32_t *regs)
return pci_id;
}
-#ifdef XSERVER_LIBPCIACCESS
-
static Bool NVPciProbe ( DriverPtr drv,
int entity_num,
struct pci_device *dev,
@@ -348,104 +303,8 @@ static Bool NVPciProbe ( DriverPtr drv,
return FALSE;
}
-#endif /* XSERVER_LIBPCIACCESS */
-
#define MAX_CHIPS MAXSCREENS
-#ifndef XSERVER_LIBPCIACCESS
-/* Mandatory */
-static Bool
-NVProbe(DriverPtr drv, int flags)
-{
- int i;
- GDevPtr *devSections;
- int *usedChips;
- SymTabRec NVChipsets[MAX_CHIPS + 1];
- PciChipsets NVPciChipsets[MAX_CHIPS + 1];
- pciVideoPtr *ppPci;
- int numDevSections;
- int numUsed;
- Bool foundScreen = FALSE;
-
- if ((numDevSections = xf86MatchDevice(NV_DRIVER_NAME, &devSections)) <= 0)
- return FALSE; /* no matching device section */
-
- if (!(ppPci = xf86GetPciVideoInfo()))
- return FALSE; /* no PCI cards found */
-
- numUsed = 0;
-
- /* Create the NVChipsets and NVPciChipsets from found devices */
- while (*ppPci && (numUsed < MAX_CHIPS)) {
- if (((*ppPci)->vendor == PCI_VENDOR_NVIDIA_SGS) ||
- ((*ppPci)->vendor == PCI_VENDOR_NVIDIA))
- {
- volatile uint32_t *regs;
- uint32_t pcicmd;
-
- PCI_DEV_READ_LONG(*ppPci, PCI_CMD_STAT_REG, &pcicmd);
- /* Enable reading memory? */
- PCI_DEV_WRITE_LONG(*ppPci, PCI_CMD_STAT_REG, pcicmd | PCI_CMD_MEM_ENABLE);
-
- regs = xf86MapPciMem(-1, VIDMEM_MMIO, PCI_DEV_TAG(*ppPci), PCI_DEV_MEM_BASE(*ppPci, 0), 0x90000);
- int pciid = NVGetPCIID(regs);
-
- int architecture = NVGetArchitecture(regs);
- char name[25];
- sprintf(name, "NVIDIA NV%02X", architecture);
- /* NV04 upto NV98 is known. */
- if (architecture >= 0x04 && architecture <= 0x9F) {
- NVChipsets[numUsed].token = pciid;
- NVChipsets[numUsed].name = name;
- NVPciChipsets[numUsed].numChipset = pciid;
- /* AGP bridge chips need their bridge chip id to be detected */
- NVPciChipsets[numUsed].PCIid = PCI_DEV_PCI_ID(*ppPci);
- NVPciChipsets[numUsed].resList = RES_SHARED_VGA;
- numUsed++;
- }
- xf86UnMapVidMem(-1, (pointer)regs, 0x90000);
-
- /* Reset previous state */
- PCI_DEV_WRITE_LONG(*ppPci, PCI_CMD_STAT_REG, pcicmd);
- }
- ppPci++;
- }
-
- /* terminate the list */
- NVChipsets[numUsed].token = -1;
- NVChipsets[numUsed].name = NULL;
- NVPciChipsets[numUsed].numChipset = -1;
- NVPciChipsets[numUsed].PCIid = -1;
- NVPciChipsets[numUsed].resList = RES_UNDEFINED;
-
- numUsed = xf86MatchPciInstances(NV_NAME, 0, NVChipsets, NVPciChipsets,
- devSections, numDevSections, drv,
- &usedChips);
-
- if (numUsed <= 0) {
- return FALSE;
- }
-
- if (flags & PROBE_DETECT) {
- foundScreen = TRUE;
- } else {
- for (i = 0; i < numUsed; i++) {
- pciVideoPtr pPci;
-
- pPci = xf86GetPciInfoForEntity(usedChips[i]);
- if (NVGetScrnInfoRec(NVPciChipsets, usedChips[i])) {
- foundScreen = TRUE;
- }
- }
- }
-
- xfree(devSections);
- xfree(usedChips);
-
- return foundScreen;
-}
-#endif /* XSERVER_LIBPCIACCESS */
-
Bool
NVSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
{
@@ -860,32 +719,14 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
/* Find the PCI info for this screen */
pNv->PciInfo = xf86GetPciInfoForEntity(pNv->pEnt->index);
-#ifndef XSERVER_LIBPCIACCESS
- pNv->PciTag = pciTag(pNv->PciInfo->bus, pNv->PciInfo->device,
- pNv->PciInfo->func);
-#endif /* XSERVER_LIBPCIACCESS */
-
pNv->Primary = xf86IsPrimaryPci(pNv->PciInfo);
volatile uint32_t *regs = NULL;
-#ifdef XSERVER_LIBPCIACCESS
pci_device_map_range(pNv->PciInfo, PCI_DEV_MEM_BASE(pNv->PciInfo, 0),
0x90000, 0, (void *)&regs);
pNv->Chipset = NVGetPCIID(regs) & 0xffff;
pNv->NVArch = NVGetArchitecture(regs);
pci_device_unmap_range(pNv->PciInfo, (void *) regs, 0x90000);
-#else
- CARD32 pcicmd;
- PCI_DEV_READ_LONG(pNv->PciInfo, PCI_CMD_STAT_REG, &pcicmd);
- /* Enable reading memory? */
- PCI_DEV_WRITE_LONG(pNv->PciInfo, PCI_CMD_STAT_REG, pcicmd | PCI_CMD_MEM_ENABLE);
- regs = xf86MapPciMem(-1, VIDMEM_MMIO, pNv->PciTag, PCI_DEV_MEM_BASE(pNv->PciInfo, 0), 0x90000);
- pNv->Chipset = NVGetPCIID(regs) & 0xffff;
- pNv->NVArch = NVGetArchitecture(regs);
- xf86UnMapVidMem(-1, (pointer)regs, 0x90000);
- /* Reset previous state */
- PCI_DEV_WRITE_LONG(pNv->PciInfo, PCI_CMD_STAT_REG, pcicmd);
-#endif /* XSERVER_LIBPCIACCESS */
pScrn->chipset = malloc(sizeof(char) * 25);
sprintf(pScrn->chipset, "NVIDIA NV%02X", pNv->NVArch);
@@ -1266,19 +1107,12 @@ NVMapMemSW(ScrnInfoPtr pScrn)
pNv->VRAMSize = pNv->RamAmountKBytes * 1024;
VRAMReserved = pNv->VRAMSize - (1 * 1024 * 1024);
pNv->AGPSize = 0;
-#ifdef XSERVER_LIBPCIACCESS
pNv->VRAMPhysical = pNv->PciInfo->regions[1].base_addr;
pci_device_map_range(pNv->PciInfo, pNv->VRAMPhysical,
pNv->PciInfo->regions[1].size,
PCI_DEV_MAP_FLAG_WRITABLE |
PCI_DEV_MAP_FLAG_WRITE_COMBINE, &map);
pNv->VRAMMap = map;
-#else
- pNv->VRAMPhysical = pNv->PciInfo->memBase[1];
- pNv->VRAMMap = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER,
- pNv->PciTag, pNv->VRAMPhysical,
- pNv->PciInfo->size[1]);
-#endif
Cursor0Offset = VRAMReserved;
Cursor1Offset = Cursor0Offset + (64 * 64 * 4);
@@ -1466,13 +1300,8 @@ NVUnmapMem(ScrnInfoPtr pScrn)
NVPtr pNv = NVPTR(pScrn);
if (!pNv->dev) {
-#ifdef XSERVER_LIBPCIACCESS
pci_device_unmap_range(pNv->PciInfo, pNv->VRAMMap,
pNv->PciInfo->regions[1].size);
-#else
- xf86UnMapVidMem(-1, (pointer)pNv->VRAMMap,
- pNv->PciInfo->size[1]);
-#endif
}
nouveau_bo_ref(NULL, &pNv->FB);
View
26 src/nv_pcicompat.h
@@ -1,11 +1,7 @@
#ifndef __NV_PCICOMPAT_H__
#define __NV_PCICOMPAT_H__
-#ifdef XSERVER_LIBPCIACCESS
#include <pciaccess.h>
-#endif
-
-#ifdef XSERVER_LIBPCIACCESS
#define PCI_DEV_VENDOR_ID(_device) ((_device)->vendor_id)
#define PCI_DEV_DEVICE_ID(_device) ((_device)->device_id)
@@ -25,28 +21,6 @@
#define PCI_SLOT_READ_LONG(_slot, _offset) __extension__ ({ uint32_t _pci_slot_read_ret; pci_device_cfg_read_u32(pci_device_find_by_slot(0, 0, 0, _slot), &_pci_slot_read_ret, _offset); _pci_slot_read_ret; })
-#else /* PRE_PCIACCESS */
-
-#define PCI_DEV_VENDOR_ID(_device) ((_device)->vendor)
-#define PCI_DEV_DEVICE_ID(_device) ((_device)->chipType)
-#define PCI_DEV_REVISION(_device) ((_device)->chipRev)
-
-#define PCI_DEV_FUNC(_device) ((_device)->func)
-#define PCI_DEV_BUS(_device) ((_device)->bus)
-#define PCI_DEV_DEV(_device) ((_device)->device)
-
-#define PCI_DEV_TAG(_device) (pciTag(PCI_DEV_BUS(_device), PCI_DEV_DEV(_device), PCI_DEV_FUNC(_device)))
-
-#define PCI_DEV_MEM_BASE(_device, _area) ((_device)->memBase[(_area)])
-#define PCI_DEV_IO_BASE(_device, _area) ((_device)->IOBase[(_area)])
-
-#define PCI_DEV_READ_LONG(_device, _offset, _dest_ptr) (*(_dest_ptr) = pciReadLong(PCI_DEV_TAG(_device), _offset))
-#define PCI_DEV_WRITE_LONG(_device, _offset, _src) (pciWriteLong(PCI_DEV_TAG(_device), _offset, _src))
-
-#define PCI_SLOT_READ_LONG(_slot, _offset) (pciReadLong(pciTag(0, 0, _slot), _offset))
-
-#endif /* XSERVER_LIBPCIACCESS */
-
#define PCI_DEV_PCI_ID(_device) ((PCI_DEV_VENDOR_ID(_device) << 16) | PCI_DEV_DEVICE_ID(_device))
#endif /* __NV_PCICOMPAT_H__ */
View
9 src/nv_setup.c
@@ -74,18 +74,9 @@ NVCommonSetup(ScrnInfoPtr pScrn)
NVPtr pNv = NVPTR(pScrn);
uint16_t implementation = pNv->Chipset & 0x0ff0;
-#ifndef XSERVER_LIBPCIACCESS
- pNv->REGS = xf86MapPciMem(pScrn->scrnIndex,
- VIDMEM_MMIO | VIDMEM_READSIDEEFFECT,
- pNv->PciTag, pNv->IOAddress, 0x01000000);
- pNv->FB_BAR = xf86MapPciMem(pScrn->scrnIndex,
- VIDMEM_MMIO | VIDMEM_READSIDEEFFECT,
- pNv->PciTag, pNv->VRAMPhysical, 0x10000);
-#else
/* 0x01000000 is the size */
pci_device_map_range(pNv->PciInfo, pNv->IOAddress, 0x01000000, PCI_DEV_MAP_FLAG_WRITABLE, (void *)&pNv->REGS);
pci_device_map_range(pNv->PciInfo, pNv->VRAMPhysical, 0x10000, PCI_DEV_MAP_FLAG_WRITABLE, (void *)&pNv->FB_BAR);
-#endif /* XSERVER_LIBPCIACCESS */
pNv->alphaCursor = (pNv->NVArch >= 0x11);
View
5 src/nv_type.h
@@ -98,12 +98,7 @@ typedef struct _NVRec {
uint32_t saved_vga_font[4][16384];
uint32_t Architecture;
EntityInfoPtr pEnt;
-#ifndef XSERVER_LIBPCIACCESS
- pciVideoPtr PciInfo;
- PCITAG PciTag;
-#else
struct pci_device *PciInfo;
-#endif /* XSERVER_LIBPCIACCESS */
int Chipset;
int NVArch;
Bool Primary;
Please sign in to comment.
Something went wrong with that request. Please try again.