Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/riastradh-drm2]: src/sys/external/bsd/drm2/dist/drm/i915 Use the cached ...
details: https://anonhg.NetBSD.org/src/rev/838c4175a79b
branches: riastradh-drm2
changeset: 788560:838c4175a79b
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sun Sep 08 16:22:29 2013 +0000
description:
Use the cached mmio bar information to map the GTT.
diffstat:
sys/external/bsd/drm2/dist/drm/i915/i915_dma.c | 30 ++++++++++++-------------
1 files changed, 14 insertions(+), 16 deletions(-)
diffs (41 lines):
diff -r 78df951040e5 -r 838c4175a79b sys/external/bsd/drm2/dist/drm/i915/i915_dma.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_dma.c Sun Sep 08 16:20:45 2013 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_dma.c Sun Sep 08 16:22:29 2013 +0000
@@ -1599,23 +1599,21 @@
mmio_size = 2*1024*1024;
#ifdef __NetBSD__
- /* XXX Maybe it would be better to just use pci_mapreg_map... */
- {
- bus_addr_t addr;
- bus_size_t size;
+ if (dev->bus_maps[mmio_bar].bm_size < mmio_size) {
+ DRM_ERROR("MMIO BAR %d is too small"
+ ": %"PRIxMAX" < %"PRIxMAX"\n",
+ mmio_bar,
+ (uintmax_t)dev->bus_maps[mmio_bar].bm_size,
+ (uintmax_t)mmio_size);
+ ret = -EIO;
+ goto put_gmch;
+ }
- if (pci_mapreg_info(dev->pdev->pd_pa.pa_pc,
- dev->pdev->pd_pa.pa_tag, PCI_BAR(mmio_bar),
- PCI_MAPREG_TYPE_MEM,
- &addr, &size, NULL /* XXX flags? */)) {
- ret = -EIO; /* XXX */
- goto put_gmch;
- }
-
- ret = drm_addmap(dev, addr, size, _DRM_REGISTERS,
- (_DRM_KERNEL | _DRM_DRIVER), &dev_priv->regs_map);
- if (ret)
- goto put_gmch;
+ ret = drm_addmap(dev, dev->bus_maps[mmio_bar].bm_base, mmio_size,
+ _DRM_REGISTERS, (_DRM_KERNEL | _DRM_DRIVER), &dev_priv->regs_map);
+ if (ret) {
+ DRM_ERROR("Failed to map MMIO BAR %d: %d\n", mmio_bar, ret);
+ goto put_gmch;
}
#else
dev_priv->regs = pci_iomap(dev->pdev, mmio_bar, mmio_size);
Home |
Main Index |
Thread Index |
Old Index