aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2017-01-25 01:26:52 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2017-01-26 04:45:14 -0500
commit2ce0264d61548b51d5d406ff9f414af10b9c7348 (patch)
tree79f3e0105e676fa13e59805273db7b2274ada28e /drivers/gpu
parent858b2c1bf820ebfba89c5e2867ab882bdb5b2f5a (diff)
drm: remove device_is_agp callback
With that the drm_pci_device_is_agp function becomes trivial, so inline that too. And while at it, move the drm_pci_agp_destroy declaration into drm-internal.h, since it's not used by drivers. Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20170125062657.19270-11-daniel.vetter@ffwll.ch
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/drm_internal.h1
-rw-r--r--drivers/gpu/drm/drm_pci.c2
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_abi16.c2
-rw-r--r--drivers/gpu/drm/radeon/radeon_cs.c3
-rw-r--r--drivers/gpu/drm/radeon/radeon_kms.c2
5 files changed, 6 insertions, 4 deletions
diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h
index a6213f814345..f37388cb2fde 100644
--- a/drivers/gpu/drm/drm_internal.h
+++ b/drivers/gpu/drm/drm_internal.h
@@ -31,6 +31,7 @@ void drm_lastclose(struct drm_device *dev);
31/* drm_pci.c */ 31/* drm_pci.c */
32int drm_irq_by_busid(struct drm_device *dev, void *data, 32int drm_irq_by_busid(struct drm_device *dev, void *data,
33 struct drm_file *file_priv); 33 struct drm_file *file_priv);
34void drm_pci_agp_destroy(struct drm_device *dev);
34 35
35/* drm_prime.c */ 36/* drm_prime.c */
36int drm_prime_handle_to_fd_ioctl(struct drm_device *dev, void *data, 37int drm_prime_handle_to_fd_ioctl(struct drm_device *dev, void *data,
diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
index 60af89446bc7..a3b356e70b35 100644
--- a/drivers/gpu/drm/drm_pci.c
+++ b/drivers/gpu/drm/drm_pci.c
@@ -191,7 +191,7 @@ int drm_irq_by_busid(struct drm_device *dev, void *data,
191static void drm_pci_agp_init(struct drm_device *dev) 191static void drm_pci_agp_init(struct drm_device *dev)
192{ 192{
193 if (drm_core_check_feature(dev, DRIVER_USE_AGP)) { 193 if (drm_core_check_feature(dev, DRIVER_USE_AGP)) {
194 if (drm_pci_device_is_agp(dev)) 194 if (pci_find_capability(dev->pdev, PCI_CAP_ID_AGP))
195 dev->agp = drm_agp_init(dev); 195 dev->agp = drm_agp_init(dev);
196 if (dev->agp) { 196 if (dev->agp) {
197 dev->agp->agp_mtrr = arch_phys_wc_add( 197 dev->agp->agp_mtrr = arch_phys_wc_add(
diff --git a/drivers/gpu/drm/nouveau/nouveau_abi16.c b/drivers/gpu/drm/nouveau/nouveau_abi16.c
index 7bd4683216d0..4df4f6ed4886 100644
--- a/drivers/gpu/drm/nouveau/nouveau_abi16.c
+++ b/drivers/gpu/drm/nouveau/nouveau_abi16.c
@@ -199,7 +199,7 @@ nouveau_abi16_ioctl_getparam(ABI16_IOCTL_ARGS)
199 if (!nvxx_device(device)->func->pci) 199 if (!nvxx_device(device)->func->pci)
200 getparam->value = 3; 200 getparam->value = 3;
201 else 201 else
202 if (drm_pci_device_is_agp(dev)) 202 if (pci_find_capability(dev->pdev, PCI_CAP_ID_AGP))
203 getparam->value = 0; 203 getparam->value = 0;
204 else 204 else
205 if (!pci_is_pcie(dev->pdev)) 205 if (!pci_is_pcie(dev->pdev))
diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c
index 510ea371dacc..a8442f7196d6 100644
--- a/drivers/gpu/drm/radeon/radeon_cs.c
+++ b/drivers/gpu/drm/radeon/radeon_cs.c
@@ -121,7 +121,8 @@ static int radeon_cs_parser_relocs(struct radeon_cs_parser *p)
121 VRAM, also but everything into VRAM on AGP cards and older 121 VRAM, also but everything into VRAM on AGP cards and older
122 IGP chips to avoid image corruptions */ 122 IGP chips to avoid image corruptions */
123 if (p->ring == R600_RING_TYPE_UVD_INDEX && 123 if (p->ring == R600_RING_TYPE_UVD_INDEX &&
124 (i == 0 || drm_pci_device_is_agp(p->rdev->ddev) || 124 (i == 0 || pci_find_capability(p->rdev->ddev->pdev,
125 PCI_CAP_ID_AGP) ||
125 p->rdev->family == CHIP_RS780 || 126 p->rdev->family == CHIP_RS780 ||
126 p->rdev->family == CHIP_RS880)) { 127 p->rdev->family == CHIP_RS880)) {
127 128
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c
index 116cf0d23595..56f35c06742c 100644
--- a/drivers/gpu/drm/radeon/radeon_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_kms.c
@@ -105,7 +105,7 @@ int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags)
105 dev->dev_private = (void *)rdev; 105 dev->dev_private = (void *)rdev;
106 106
107 /* update BUS flag */ 107 /* update BUS flag */
108 if (drm_pci_device_is_agp(dev)) { 108 if (pci_find_capability(dev->pdev, PCI_CAP_ID_AGP)) {
109 flags |= RADEON_IS_AGP; 109 flags |= RADEON_IS_AGP;
110 } else if (pci_is_pcie(dev->pdev)) { 110 } else if (pci_is_pcie(dev->pdev)) {
111 flags |= RADEON_IS_PCIE; 111 flags |= RADEON_IS_PCIE;