diff options
author | Owain Ainsworth <oga@cvs.openbsd.org> | 2008-11-18 16:08:52 +0000 |
---|---|---|
committer | Owain Ainsworth <oga@cvs.openbsd.org> | 2008-11-18 16:08:52 +0000 |
commit | b9a7e4cb5170126292dad507d7764a69d6ebd3af (patch) | |
tree | 0424c4d41711309de7e34c94af8d35528747140f /sys/dev/pci/drm/i915_dma.c | |
parent | 6e4b2da84f235d686234ccec866b7862309769a3 (diff) |
instead of going through the drm_map interface, just map the mmio
registers directly (via the memory sharing interface that intagp uses).
It doesn't need to be in a map structure.
Idea taken from some of intel's work.
Diffstat (limited to 'sys/dev/pci/drm/i915_dma.c')
-rw-r--r-- | sys/dev/pci/drm/i915_dma.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/dev/pci/drm/i915_dma.c b/sys/dev/pci/drm/i915_dma.c index fc5489a2e90..8b2cef262e7 100644 --- a/sys/dev/pci/drm/i915_dma.c +++ b/sys/dev/pci/drm/i915_dma.c @@ -817,8 +817,9 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) base = drm_get_resource_start(dev, mmio_bar); size = drm_get_resource_len(dev, mmio_bar); - ret = drm_addmap(dev, base, size, _DRM_REGISTERS, - _DRM_KERNEL | _DRM_DRIVER, &dev_priv->mmio_map); + dev_priv->regs = vga_pci_bar_map(dev->vga_softc, base, size, 0); + if (dev_priv->regs == NULL) + return (ENOMEM); /* Init HWS */ if (!I915_NEED_GFX_HWS(dev)) { @@ -838,8 +839,8 @@ int i915_driver_unload(struct drm_device *dev) i915_free_hws(dev); - if (dev_priv->mmio_map) - drm_rmmap(dev, dev_priv->mmio_map); + if (dev_priv->regs != NULL) + vga_pci_bar_unmap(dev_priv->regs); DRM_SPINUNINIT(&dev_priv->user_irq_lock); |