drm: remove device_is_agp callback
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 25 Jan 2017 06:26:52 +0000 (07:26 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 26 Jan 2017 09:45:14 +0000 (10:45 +0100)
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
drivers/gpu/drm/drm_internal.h
drivers/gpu/drm/drm_pci.c
drivers/gpu/drm/nouveau/nouveau_abi16.c
drivers/gpu/drm/radeon/radeon_cs.c
drivers/gpu/drm/radeon/radeon_kms.c
include/drm/drmP.h
include/drm/drm_drv.h

index a6213f8143454f6b64f1408fda891e10924da747..f37388cb2fde4c8490688d657ff6e0869ca5082b 100644 (file)
@@ -31,6 +31,7 @@ void drm_lastclose(struct drm_device *dev);
 /* drm_pci.c */
 int drm_irq_by_busid(struct drm_device *dev, void *data,
                     struct drm_file *file_priv);
+void drm_pci_agp_destroy(struct drm_device *dev);
 
 /* drm_prime.c */
 int drm_prime_handle_to_fd_ioctl(struct drm_device *dev, void *data,
index 60af89446bc7418ac49af9619dd252bacff86cc0..a3b356e70b35c5469bf8c395be3f5fd874c99a07 100644 (file)
@@ -191,7 +191,7 @@ int drm_irq_by_busid(struct drm_device *dev, void *data,
 static void drm_pci_agp_init(struct drm_device *dev)
 {
        if (drm_core_check_feature(dev, DRIVER_USE_AGP)) {
-               if (drm_pci_device_is_agp(dev))
+               if (pci_find_capability(dev->pdev, PCI_CAP_ID_AGP))
                        dev->agp = drm_agp_init(dev);
                if (dev->agp) {
                        dev->agp->agp_mtrr = arch_phys_wc_add(
index 7bd4683216d016dcbc78aa088a2b7bd67d4453a5..4df4f6ed48863abfb81b3ede8b7be34c7115f874 100644 (file)
@@ -199,7 +199,7 @@ nouveau_abi16_ioctl_getparam(ABI16_IOCTL_ARGS)
                if (!nvxx_device(device)->func->pci)
                        getparam->value = 3;
                else
-               if (drm_pci_device_is_agp(dev))
+               if (pci_find_capability(dev->pdev, PCI_CAP_ID_AGP))
                        getparam->value = 0;
                else
                if (!pci_is_pcie(dev->pdev))
index 510ea371dacc6f063fa6f80b8131b53437ef35eb..a8442f7196d6fee625795df3cb2ae08de4155bad 100644 (file)
@@ -121,7 +121,8 @@ static int radeon_cs_parser_relocs(struct radeon_cs_parser *p)
                   VRAM, also but everything into VRAM on AGP cards and older
                   IGP chips to avoid image corruptions */
                if (p->ring == R600_RING_TYPE_UVD_INDEX &&
-                   (i == 0 || drm_pci_device_is_agp(p->rdev->ddev) ||
+                   (i == 0 || pci_find_capability(p->rdev->ddev->pdev,
+                                                  PCI_CAP_ID_AGP) ||
                     p->rdev->family == CHIP_RS780 ||
                     p->rdev->family == CHIP_RS880)) {
 
index 116cf0d23595efd465bf65dca24166a3e1e69415..56f35c06742c6394ac1f700317885fdfac64addf 100644 (file)
@@ -105,7 +105,7 @@ int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags)
        dev->dev_private = (void *)rdev;
 
        /* update BUS flag */
-       if (drm_pci_device_is_agp(dev)) {
+       if (pci_find_capability(dev->pdev, PCI_CAP_ID_AGP)) {
                flags |= RADEON_IS_AGP;
        } else if (pci_is_pcie(dev->pdev)) {
                flags |= RADEON_IS_PCIE;
index e5882d5a68e5b19aa955ed786a5546efdcc1c500..21a3a666a2fd445e3114f05538ff2ab2b70b6183 100644 (file)
@@ -790,21 +790,6 @@ extern void drm_sysfs_hotplug_event(struct drm_device *dev);
 
 /*@}*/
 
-/* PCI section */
-static __inline__ int drm_pci_device_is_agp(struct drm_device *dev)
-{
-       if (dev->driver->device_is_agp != NULL) {
-               int err = (*dev->driver->device_is_agp) (dev);
-
-               if (err != 2) {
-                       return err;
-               }
-       }
-
-       return pci_find_capability(dev->pdev, PCI_CAP_ID_AGP);
-}
-void drm_pci_agp_destroy(struct drm_device *dev);
-
 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);
 #ifdef CONFIG_PCI
index 5ab2459b43450dd0ac8c500de75f23749710db07..af75fc6ec830cc18080985e7cc8a8876c59ffbe2 100644 (file)
@@ -150,20 +150,6 @@ struct drm_driver {
         */
        void (*disable_vblank) (struct drm_device *dev, unsigned int pipe);
 
-       /**
-        * @device_is_agp:
-        *
-        * Called by drm_device_is_agp().  Typically used to determine if a card
-        * is really attached to AGP or not.
-        *
-        * Returns:
-        *
-        * One of three values is returned depending on whether or not the
-        * card is absolutely not AGP (return of 0), absolutely is AGP
-        * (return of 1), or may or may not be AGP (return of 2).
-        */
-       int (*device_is_agp) (struct drm_device *dev);
-
        /**
         * @get_scanout_position:
         *