Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/external/bsd/drm/dist fix some confusion between highest...
details: https://anonhg.NetBSD.org/src/rev/25fb9f90e881
branches: trunk
changeset: 747368:25fb9f90e881
user: drochner <drochner%NetBSD.org@localhost>
date: Sat Sep 12 17:16:41 2009 +0000
description:
fix some confusion between highest DMA address and the boundary not to
be crossed in a transfer,
back out previous fixes which only added to the confusion
diffstat:
sys/external/bsd/drm/dist/bsd-core/drm_pci.c | 5 +++--
sys/external/bsd/drm/dist/shared-core/i915_dma.c | 15 +--------------
sys/external/bsd/drm/dist/shared-core/mach64_dma.c | 15 +--------------
3 files changed, 5 insertions(+), 30 deletions(-)
diffs (68 lines):
diff -r 400892c79d62 -r 25fb9f90e881 sys/external/bsd/drm/dist/bsd-core/drm_pci.c
--- a/sys/external/bsd/drm/dist/bsd-core/drm_pci.c Sat Sep 12 14:59:59 2009 +0000
+++ b/sys/external/bsd/drm/dist/bsd-core/drm_pci.c Sat Sep 12 17:16:41 2009 +0000
@@ -110,9 +110,10 @@
return NULL;
}
#elif defined(__NetBSD__)
- dmah->tag = dev->pa.pa_dmat;
+ KASSERT(maxaddr >= 0xffffffffUL); /* no way to tell bus_dma_alloc */
+ dmah->tag = dev->pa.pa_dmat; /* use 32-bit DMA tag */
- if ((ret = bus_dmamem_alloc(dmah->tag, size, align, maxaddr,
+ if ((ret = bus_dmamem_alloc(dmah->tag, size, align, 0,
dmah->segs, 1, &nsegs, BUS_DMA_WAITOK)) != 0) {
printf("drm: Unable to allocate %zu bytes of DMA, error %d\n",
size, ret);
diff -r 400892c79d62 -r 25fb9f90e881 sys/external/bsd/drm/dist/shared-core/i915_dma.c
--- a/sys/external/bsd/drm/dist/shared-core/i915_dma.c Sat Sep 12 14:59:59 2009 +0000
+++ b/sys/external/bsd/drm/dist/shared-core/i915_dma.c Sat Sep 12 17:16:41 2009 +0000
@@ -82,21 +82,8 @@
/* Program Hardware Status Page */
DRM_UNLOCK();
-/*
- * This fix is not correct in case where we have i386 and PAE, where
- * unfortunately we have > 32 bit address space, but bus_size_t is still
- * 32 bits. To fix this properly we would have to change bus_size_t to a
- * 64 bit quantity for PAE. Good enough for now. When that is fixed, we
- * should change BOUNDARY to:
- * ((paddr_t)(sizeof(paddr_t) > 4 ? 0x100000000ULL : 0ULL))
- */
-#ifdef _LP64
-#define BOUNDARY 0x100000000ULL
-#else
-#define BOUNDARY 0
-#endif
dev_priv->status_page_dmah =
- drm_pci_alloc(dev, PAGE_SIZE, PAGE_SIZE, BOUNDARY);
+ drm_pci_alloc(dev, PAGE_SIZE, PAGE_SIZE, 0xffffffff);
DRM_LOCK();
if (!dev_priv->status_page_dmah) {
DRM_ERROR("Can not allocate hardware status page\n");
diff -r 400892c79d62 -r 25fb9f90e881 sys/external/bsd/drm/dist/shared-core/mach64_dma.c
--- a/sys/external/bsd/drm/dist/shared-core/mach64_dma.c Sat Sep 12 14:59:59 2009 +0000
+++ b/sys/external/bsd/drm/dist/shared-core/mach64_dma.c Sat Sep 12 17:16:41 2009 +0000
@@ -837,21 +837,8 @@
#ifdef __FreeBSD__
DRM_UNLOCK();
#endif
-/*
- * This fix is not correct in case where we have i386 and PAE, where
- * unfortunately we have > 32 bit address space, but bus_size_t is still
- * 32 bits. To fix this properly we would have to change bus_size_t to a
- * 64 bit quantity for PAE. Good enough for now. When that is fixed, we
- * should change BOUNDARY to:
- * ((paddr_t)(sizeof(paddr_t) > 4 ? 0x100000000ULL : 0ULL))
- */
-#ifdef _LP64
-#define BOUNDARY 0x100000000ULL
-#else
-#define BOUNDARY 0
-#endif
cpu_addr_dmah =
- drm_pci_alloc(dev, 0x1000, 0x1000, BOUNDARY);
+ drm_pci_alloc(dev, 0x1000, 0x1000, 0xfffffffful);
#ifdef __FreeBSD__
DRM_LOCK();
#endif
Home |
Main Index |
Thread Index |
Old Index