kill the stupid pci capability defines, we have our own. Don't wrap
authoroga <oga@openbsd.org>
Sun, 17 Aug 2008 16:56:14 +0000 (16:56 +0000)
committeroga <oga@openbsd.org>
Sun, 17 Aug 2008 16:56:14 +0000 (16:56 +0000)
pci_read_capability while i'm at it.

sys/dev/pci/drm/drmP.h
sys/dev/pci/drm/drm_agpsupport.c

index ee0cd62..c823dbb 100644 (file)
@@ -193,15 +193,6 @@ extern int ticks;          /* really should be in a header */
 
 extern struct cfdriver drm_cd;
 
-/* Capabilities taken from src/sys/dev/pci/pcireg.h. */
-#ifndef PCIY_AGP
-#define PCIY_AGP       0x02
-#endif
-
-#ifndef PCIY_EXPRESS
-#define PCIY_EXPRESS   0x10
-#endif
-
 typedef unsigned long dma_addr_t;
 typedef u_int64_t u64;
 typedef u_int32_t u32;
index 8a9e38d..9685aca 100644 (file)
 
 #include "drmP.h"
 
-int    drm_device_find_capability(struct drm_device *, int);
-struct drm_agp_mem *drm_agp_lookup_entry(struct drm_device *, void *);
-
-/* Returns 1 if AGP or 0 if not. */
-int
-drm_device_find_capability(struct drm_device *dev, int cap)
-{
-       return pci_get_capability(dev->pa.pa_pc, dev->pa.pa_tag, cap,
-           NULL, NULL);
-}
+struct drm_agp_mem     *drm_agp_lookup_entry(struct drm_device *, void *);
 
 int
 drm_device_is_agp(struct drm_device *dev)
@@ -60,13 +51,15 @@ drm_device_is_agp(struct drm_device *dev)
                        return ret;
        }
 
-       return (drm_device_find_capability(dev, PCIY_AGP));
+       return (pci_get_capability(dev->pa.pa_pc, dev->pa.pa_tag, PCI_CAP_AGP,
+           NULL, NULL));
 }
 
 int
 drm_device_is_pcie(struct drm_device *dev)
 {
-       return (drm_device_find_capability(dev, PCIY_EXPRESS));
+       return (pci_get_capability(dev->pa.pa_pc, dev->pa.pa_tag,
+           PCI_CAP_PCIEXPRESS, NULL, NULL));
 }
 
 int