summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2008-08-17 16:56:15 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2008-08-17 16:56:15 +0000
commit7c398eb4b48e74579c900aa088978ef883dcacc6 (patch)
treeb393305d65ee014f43129ceeac007d7e247f4b56
parent9ec66eae195bcf59572a5017812b821395a08c28 (diff)
kill the stupid pci capability defines, we have our own. Don't wrap
pci_read_capability while i'm at it.
-rw-r--r--sys/dev/pci/drm/drmP.h9
-rw-r--r--sys/dev/pci/drm/drm_agpsupport.c17
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