aboutsummaryrefslogtreecommitdiffstats
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
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
-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
-rw-r--r--include/drm/drmP.h15
-rw-r--r--include/drm/drm_drv.h14
7 files changed, 6 insertions, 33 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;
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index e5882d5a68e5..21a3a666a2fd 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -790,21 +790,6 @@ extern void drm_sysfs_hotplug_event(struct drm_device *dev);
790 790
791/*@}*/ 791/*@}*/
792 792
793/* PCI section */
794static __inline__ int drm_pci_device_is_agp(struct drm_device *dev)
795{
796 if (dev->driver->device_is_agp != NULL) {
797 int err = (*dev->driver->device_is_agp) (dev);
798
799 if (err != 2) {
800 return err;
801 }
802 }
803
804 return pci_find_capability(dev->pdev, PCI_CAP_ID_AGP);
805}
806void drm_pci_agp_destroy(struct drm_device *dev);
807
808extern int drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver); 793extern int drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver);
809extern void drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver); 794extern void drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver);
810#ifdef CONFIG_PCI 795#ifdef CONFIG_PCI
diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h
index 5ab2459b4345..af75fc6ec830 100644
--- a/include/drm/drm_drv.h
+++ b/include/drm/drm_drv.h
@@ -151,20 +151,6 @@ struct drm_driver {
151 void (*disable_vblank) (struct drm_device *dev, unsigned int pipe); 151 void (*disable_vblank) (struct drm_device *dev, unsigned int pipe);
152 152
153 /** 153 /**
154 * @device_is_agp:
155 *
156 * Called by drm_device_is_agp(). Typically used to determine if a card
157 * is really attached to AGP or not.
158 *
159 * Returns:
160 *
161 * One of three values is returned depending on whether or not the
162 * card is absolutely not AGP (return of 0), absolutely is AGP
163 * (return of 1), or may or may not be AGP (return of 2).
164 */
165 int (*device_is_agp) (struct drm_device *dev);
166
167 /**
168 * @get_scanout_position: 154 * @get_scanout_position:
169 * 155 *
170 * Called by vblank timestamping code. 156 * Called by vblank timestamping code.