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/shared-core PR/42041: Jasper Walla...



details:   https://anonhg.NetBSD.org/src/rev/10ec7b991ea8
branches:  trunk
changeset: 747316:10ec7b991ea8
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Sep 10 18:11:21 2009 +0000

description:
PR/42041: Jasper Wallace: Stopgap fix for kernel assert
("(boundary & (boundary - 1)) == 0") triggers with i915drm in recent -5 kernel

Read the comment in the code for a detailed explanation. This should be fixed
properly in the i386 bus code, but it is too intrusive to do for -5.
XXX: pullup for 5.x

diffstat:

 sys/external/bsd/drm/dist/shared-core/i915_dma.c   |  15 ++++++++++++++-
 sys/external/bsd/drm/dist/shared-core/mach64_dma.c |  15 ++++++++++++++-
 2 files changed, 28 insertions(+), 2 deletions(-)

diffs (52 lines):

diff -r 2703d08d348f -r 10ec7b991ea8 sys/external/bsd/drm/dist/shared-core/i915_dma.c
--- a/sys/external/bsd/drm/dist/shared-core/i915_dma.c  Thu Sep 10 15:02:49 2009 +0000
+++ b/sys/external/bsd/drm/dist/shared-core/i915_dma.c  Thu Sep 10 18:11:21 2009 +0000
@@ -82,8 +82,21 @@
 
        /* 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, 0xffffffff);
+               drm_pci_alloc(dev, PAGE_SIZE, PAGE_SIZE, BOUNDARY);
        DRM_LOCK();
        if (!dev_priv->status_page_dmah) {
                DRM_ERROR("Can not allocate hardware status page\n");
diff -r 2703d08d348f -r 10ec7b991ea8 sys/external/bsd/drm/dist/shared-core/mach64_dma.c
--- a/sys/external/bsd/drm/dist/shared-core/mach64_dma.c        Thu Sep 10 15:02:49 2009 +0000
+++ b/sys/external/bsd/drm/dist/shared-core/mach64_dma.c        Thu Sep 10 18:11:21 2009 +0000
@@ -837,8 +837,21 @@
 #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, 0xfffffffful);
+           drm_pci_alloc(dev, 0x1000, 0x1000, BOUNDARY);
 #ifdef __FreeBSD__
        DRM_LOCK();
 #endif



Home | Main Index | Thread Index | Old Index