From 02de966c3ae6174b8d3487b793ad46746033a439 Mon Sep 17 00:00:00 2001 From: oga Date: Sun, 17 Aug 2008 16:56:14 +0000 Subject: [PATCH] kill the stupid pci capability defines, we have our own. Don't wrap pci_read_capability while i'm at it. --- sys/dev/pci/drm/drmP.h | 9 --------- sys/dev/pci/drm/drm_agpsupport.c | 17 +++++------------ 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/sys/dev/pci/drm/drmP.h b/sys/dev/pci/drm/drmP.h index ee0cd62a24c..c823dbba9d7 100644 --- a/sys/dev/pci/drm/drmP.h +++ b/sys/dev/pci/drm/drmP.h @@ -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; diff --git a/sys/dev/pci/drm/drm_agpsupport.c b/sys/dev/pci/drm/drm_agpsupport.c index 8a9e38da066..9685aca11bb 100644 --- a/sys/dev/pci/drm/drm_agpsupport.c +++ b/sys/dev/pci/drm/drm_agpsupport.c @@ -35,16 +35,7 @@ #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 -- 2.20.1