Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/dist/drm/radeon KASSERT about page-ali...



details:   https://anonhg.NetBSD.org/src/rev/69022244ef50
branches:  trunk
changeset: 337301:69022244ef50
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Fri Apr 10 17:44:35 2015 +0000

description:
KASSERT about page-alignment on initialization too.

diffstat:

 sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c |  8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diffs (25 lines):

diff -r 9acfb110f212 -r 69022244ef50 sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c
--- a/sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c        Fri Apr 10 17:28:42 2015 +0000
+++ b/sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c        Fri Apr 10 17:44:35 2015 +0000
@@ -450,6 +450,10 @@
                        mem->bus.offset = mem->start << PAGE_SHIFT;
                        mem->bus.base = rdev->mc.agp_base;
                        mem->bus.is_iomem = !rdev->ddev->agp->cant_use_aperture;
+                       KASSERTMSG((mem->bus.base & (PAGE_SIZE - 1)) == 0,
+                           "agp aperture is not page-aligned: %lx",
+                           mem->bus.base);
+                       KASSERT((mem->bus.offset & (PAGE_SIZE - 1)) == 0);
                }
 #endif
                break;
@@ -483,6 +487,10 @@
                mem->bus.base = (mem->bus.base & 0x0ffffffffUL) +
                        rdev->ddev->hose->dense_mem_base;
 #endif
+               KASSERTMSG((mem->bus.base & (PAGE_SIZE - 1)) == 0,
+                   "mc aperture is not page-aligned: %lx",
+                   mem->bus.base);
+               KASSERT((mem->bus.offset & (PAGE_SIZE - 1)) == 0);
                break;
        default:
                return -EINVAL;



Home | Main Index | Thread Index | Old Index