diff options
author | Owain Ainsworth <oga@cvs.openbsd.org> | 2008-11-22 22:10:43 +0000 |
---|---|---|
committer | Owain Ainsworth <oga@cvs.openbsd.org> | 2008-11-22 22:10:43 +0000 |
commit | 5c0fec0066b99dfbda64cd0d0f710db110a7b3cb (patch) | |
tree | 38a3dc7ec38f5ecb80260d092a31eabd88a9e451 /sys | |
parent | efaaf8fdb0ae277917aee89ce3717ef1fa793fa0 (diff) |
drm_device_is_pcie is only needed in one place: radeondrm_attach
so just inline it there.
also remove dev->pci_vendor and dev->pci_device, and insert pci_device
into the one place any of them are needed (inteldrm's interface can give
this info to the X driver. to remove that you'd need to fix X too).
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/drm/drmP.h | 4 | ||||
-rw-r--r-- | sys/dev/pci/drm/drm_agpsupport.c | 7 | ||||
-rw-r--r-- | sys/dev/pci/drm/drm_drv.c | 2 | ||||
-rw-r--r-- | sys/dev/pci/drm/i915_dma.c | 2 | ||||
-rw-r--r-- | sys/dev/pci/drm/i915_drv.c | 7 | ||||
-rw-r--r-- | sys/dev/pci/drm/i915_drv.h | 4 |
6 files changed, 7 insertions, 19 deletions
diff --git a/sys/dev/pci/drm/drmP.h b/sys/dev/pci/drm/drmP.h index 9f7deb67352..36be9d770f0 100644 --- a/sys/dev/pci/drm/drmP.h +++ b/sys/dev/pci/drm/drmP.h @@ -504,9 +504,6 @@ struct drm_device { const struct drm_driver_info *driver; - u_int16_t pci_device; /* PCI device id */ - u_int16_t pci_vendor; /* PCI vendor id */ - char *unique; /* Unique identifier: e.g., busid */ int unique_len; /* Length of unique field */ struct vga_pci_softc *vga_softc; @@ -664,7 +661,6 @@ void drm_handle_vblank(struct drm_device *, int); /* AGP/PCI Express/GART support (drm_agpsupport.c) */ int drm_device_is_agp(struct drm_device *); -int drm_device_is_pcie(struct drm_device *); struct drm_agp_head *drm_agp_init(void); void drm_agp_takedown(struct drm_device *); int drm_agp_acquire(struct drm_device *); diff --git a/sys/dev/pci/drm/drm_agpsupport.c b/sys/dev/pci/drm/drm_agpsupport.c index f00cd9d92d0..d33c568a928 100644 --- a/sys/dev/pci/drm/drm_agpsupport.c +++ b/sys/dev/pci/drm/drm_agpsupport.c @@ -58,13 +58,6 @@ drm_device_is_agp(struct drm_device *dev) } int -drm_device_is_pcie(struct drm_device *dev) -{ - return (pci_get_capability(dev->pa.pa_pc, dev->pa.pa_tag, - PCI_CAP_PCIEXPRESS, NULL, NULL)); -} - -int drm_agp_info(struct drm_device * dev, struct drm_agp_info *info) { struct agp_info *kern; diff --git a/sys/dev/pci/drm/drm_drv.c b/sys/dev/pci/drm/drm_drv.c index f44cfb50e0c..f7747181f7b 100644 --- a/sys/dev/pci/drm/drm_drv.c +++ b/sys/dev/pci/drm/drm_drv.c @@ -117,8 +117,6 @@ drm_attach(struct device *parent, struct device *self, void *aux) dev->pci_bus = pa->pa_bus; dev->pci_slot = pa->pa_device; dev->pci_func = pa->pa_function; - dev->pci_vendor = PCI_VENDOR(dev->pa.pa_id); - dev->pci_device = PCI_PRODUCT(dev->pa.pa_id); rw_init(&dev->dev_lock, "drmdevlk"); mtx_init(&dev->drw_lock, IPL_NONE); diff --git a/sys/dev/pci/drm/i915_dma.c b/sys/dev/pci/drm/i915_dma.c index af8d4dca8e9..4b88d860158 100644 --- a/sys/dev/pci/drm/i915_dma.c +++ b/sys/dev/pci/drm/i915_dma.c @@ -712,7 +712,7 @@ int i915_getparam(struct drm_device *dev, void *data, value = READ_BREADCRUMB(dev_priv); break; case I915_PARAM_CHIPSET_ID: - value = dev->pci_device; + value = dev_priv->pci_device; break; default: DRM_ERROR("Unknown parameter %d\n", param->param); diff --git a/sys/dev/pci/drm/i915_drv.c b/sys/dev/pci/drm/i915_drv.c index 4ed73f84fd5..8ef0d25ab51 100644 --- a/sys/dev/pci/drm/i915_drv.c +++ b/sys/dev/pci/drm/i915_drv.c @@ -127,16 +127,15 @@ inteldrm_attach(struct device *parent, struct device *self, void *aux) struct pci_attach_args *pa = aux; struct vga_pci_bar *bar; drm_pci_id_list_t *id_entry; - int mmio_bar; id_entry = drm_find_description(PCI_VENDOR(pa->pa_id), PCI_PRODUCT(pa->pa_id), inteldrm_pciidlist); dev_priv->flags = id_entry->driver_private; - - mmio_bar = IS_I9XX(dev_priv) ? 0 : 1; + dev_priv->pci_device = PCI_PRODUCT(pa->pa_id); /* Add register map (needed for suspend/resume) */ - bar = vga_pci_bar_info((struct vga_pci_softc *)parent, mmio_bar); + bar = vga_pci_bar_info((struct vga_pci_softc *)parent, + IS_I9XX(dev_priv) ? 0 : 1); if (bar == NULL) { printf(": can't get BAR info\n"); return; diff --git a/sys/dev/pci/drm/i915_drv.h b/sys/dev/pci/drm/i915_drv.h index e0951b7a6da..2999a80e582 100644 --- a/sys/dev/pci/drm/i915_drv.h +++ b/sys/dev/pci/drm/i915_drv.h @@ -81,6 +81,9 @@ typedef struct drm_i915_private { struct device *drmdev; bus_dma_tag_t dmat; + u_long flags; + u_int16_t pci_device; + struct vga_pci_bar *regs; drm_local_map_t *sarea; @@ -109,7 +112,6 @@ typedef struct drm_i915_private { u_int32_t irq_mask_reg; u_int32_t pipestat[2]; - u_long flags; int tex_lru_log_granularity; int allow_batchbuffer; struct mem_block *agp_heap; |