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;
#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)
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