DRM: remove drm_pci_device_is_pcie
drm_pci_device_is_pcie duplicates the funcationality of pci_is_pcie. Convert callers of the former to the latter. This has the side benefit of removing an unnecessary search in the PCI configuration space due to using a saved PCIe capability offset. [airlied: update for new callsite] Signed-off-by: Jon Mason <jdmason@kudzu.us> Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
d52589b785
commit
58b6542b50
7 changed files with 7 additions and 14 deletions
|
@ -397,7 +397,7 @@ nouveau_mem_vram_init(struct drm_device *dev)
|
||||||
if (pci_dma_supported(dev->pdev, DMA_BIT_MASK(40)))
|
if (pci_dma_supported(dev->pdev, DMA_BIT_MASK(40)))
|
||||||
dma_bits = 40;
|
dma_bits = 40;
|
||||||
} else
|
} else
|
||||||
if (0 && drm_pci_device_is_pcie(dev) &&
|
if (0 && pci_is_pcie(dev->pdev) &&
|
||||||
dev_priv->chipset > 0x40 &&
|
dev_priv->chipset > 0x40 &&
|
||||||
dev_priv->chipset != 0x45) {
|
dev_priv->chipset != 0x45) {
|
||||||
if (pci_dma_supported(dev->pdev, DMA_BIT_MASK(39)))
|
if (pci_dma_supported(dev->pdev, DMA_BIT_MASK(39)))
|
||||||
|
|
|
@ -429,7 +429,7 @@ nouveau_sgdma_init(struct drm_device *dev)
|
||||||
u32 aper_size, align;
|
u32 aper_size, align;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (dev_priv->card_type >= NV_40 && drm_pci_device_is_pcie(dev))
|
if (dev_priv->card_type >= NV_40 && pci_is_pcie(dev->pdev))
|
||||||
aper_size = 512 * 1024 * 1024;
|
aper_size = 512 * 1024 * 1024;
|
||||||
else
|
else
|
||||||
aper_size = 64 * 1024 * 1024;
|
aper_size = 64 * 1024 * 1024;
|
||||||
|
@ -458,7 +458,7 @@ nouveau_sgdma_init(struct drm_device *dev)
|
||||||
dev_priv->gart_info.type = NOUVEAU_GART_HW;
|
dev_priv->gart_info.type = NOUVEAU_GART_HW;
|
||||||
dev_priv->gart_info.func = &nv50_sgdma_backend;
|
dev_priv->gart_info.func = &nv50_sgdma_backend;
|
||||||
} else
|
} else
|
||||||
if (0 && drm_pci_device_is_pcie(dev) &&
|
if (0 && pci_is_pcie(dev->pdev) &&
|
||||||
dev_priv->chipset > 0x40 && dev_priv->chipset != 0x45) {
|
dev_priv->chipset > 0x40 && dev_priv->chipset != 0x45) {
|
||||||
if (nv44_graph_class(dev)) {
|
if (nv44_graph_class(dev)) {
|
||||||
dev_priv->gart_info.func = &nv44_sgdma_backend;
|
dev_priv->gart_info.func = &nv44_sgdma_backend;
|
||||||
|
|
|
@ -1111,7 +1111,7 @@ int nouveau_ioctl_getparam(struct drm_device *dev, void *data,
|
||||||
case NOUVEAU_GETPARAM_BUS_TYPE:
|
case NOUVEAU_GETPARAM_BUS_TYPE:
|
||||||
if (drm_pci_device_is_agp(dev))
|
if (drm_pci_device_is_agp(dev))
|
||||||
getparam->value = NV_AGP;
|
getparam->value = NV_AGP;
|
||||||
else if (drm_pci_device_is_pcie(dev))
|
else if (pci_is_pcie(dev->pdev))
|
||||||
getparam->value = NV_PCIE;
|
getparam->value = NV_PCIE;
|
||||||
else
|
else
|
||||||
getparam->value = NV_PCI;
|
getparam->value = NV_PCI;
|
||||||
|
|
|
@ -42,7 +42,7 @@ int nv04_instmem_init(struct drm_device *dev)
|
||||||
rsvd *= dev_priv->engine.fifo.channels;
|
rsvd *= dev_priv->engine.fifo.channels;
|
||||||
|
|
||||||
/* pciegart table */
|
/* pciegart table */
|
||||||
if (drm_pci_device_is_pcie(dev))
|
if (pci_is_pcie(dev->pdev))
|
||||||
rsvd += 512 * 1024;
|
rsvd += 512 * 1024;
|
||||||
|
|
||||||
/* object storage */
|
/* object storage */
|
||||||
|
|
|
@ -2115,7 +2115,7 @@ int radeon_driver_load(struct drm_device *dev, unsigned long flags)
|
||||||
|
|
||||||
if (drm_pci_device_is_agp(dev))
|
if (drm_pci_device_is_agp(dev))
|
||||||
dev_priv->flags |= RADEON_IS_AGP;
|
dev_priv->flags |= RADEON_IS_AGP;
|
||||||
else if (drm_pci_device_is_pcie(dev))
|
else if (pci_is_pcie(dev->pdev))
|
||||||
dev_priv->flags |= RADEON_IS_PCIE;
|
dev_priv->flags |= RADEON_IS_PCIE;
|
||||||
else
|
else
|
||||||
dev_priv->flags |= RADEON_IS_PCI;
|
dev_priv->flags |= RADEON_IS_PCI;
|
||||||
|
|
|
@ -60,7 +60,7 @@ int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags)
|
||||||
/* update BUS flag */
|
/* update BUS flag */
|
||||||
if (drm_pci_device_is_agp(dev)) {
|
if (drm_pci_device_is_agp(dev)) {
|
||||||
flags |= RADEON_IS_AGP;
|
flags |= RADEON_IS_AGP;
|
||||||
} else if (drm_pci_device_is_pcie(dev)) {
|
} else if (pci_is_pcie(dev->pdev)) {
|
||||||
flags |= RADEON_IS_PCIE;
|
flags |= RADEON_IS_PCIE;
|
||||||
} else {
|
} else {
|
||||||
flags |= RADEON_IS_PCI;
|
flags |= RADEON_IS_PCI;
|
||||||
|
|
|
@ -1674,13 +1674,6 @@ static __inline__ int drm_pci_device_is_agp(struct drm_device *dev)
|
||||||
return pci_find_capability(dev->pdev, PCI_CAP_ID_AGP);
|
return pci_find_capability(dev->pdev, PCI_CAP_ID_AGP);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static __inline__ int drm_pci_device_is_pcie(struct drm_device *dev)
|
|
||||||
{
|
|
||||||
return pci_find_capability(dev->pdev, PCI_CAP_ID_EXP);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
extern int drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver);
|
extern int drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver);
|
||||||
extern void drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver);
|
extern void drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver);
|
||||||
extern int drm_get_pci_dev(struct pci_dev *pdev,
|
extern int drm_get_pci_dev(struct pci_dev *pdev,
|
||||||
|
|
Loading…
Reference in a new issue