summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2003-02-20 07:58:05 +0000
committerEric Anholt <anholt@freebsd.org>2003-02-20 07:58:05 +0000
commitb528efae821e5f695a36b3eab2ea781510da81f9 (patch)
tree2dba287eb37e7e16d2b204c8762953b59c1dc1e5
parent3796b2c83e05fafe429086d05859b2f69e4994bc (diff)
Make the allocation for the ATI PCI GART contiguous. It worked in the past
because we happened to only use one page of the table.
-rw-r--r--bsd-core/ati_pcigart.c8
-rw-r--r--bsd/ati_pcigart.h8
2 files changed, 10 insertions, 6 deletions
diff --git a/bsd-core/ati_pcigart.c b/bsd-core/ati_pcigart.c
index bfb8ab25..ba0b81a7 100644
--- a/bsd-core/ati_pcigart.c
+++ b/bsd-core/ati_pcigart.c
@@ -57,7 +57,8 @@ int DRM(ati_pcigart_init)( drm_device_t *dev,
goto done;
}
- address = malloc( (1 << ATI_PCIGART_TABLE_ORDER) * PAGE_SIZE, DRM(M_DRM), M_WAITOK );
+ address = (long)contigmalloc((1 << ATI_PCIGART_TABLE_ORDER) * PAGE_SIZE,
+ DRM(M_DRM), M_WAITOK, 0ul, 0xfffffffful, PAGE_SIZE, 0);
if ( !address ) {
DRM_ERROR( "cannot allocate PCI GART page!\n" );
goto done;
@@ -103,7 +104,8 @@ int DRM(ati_pcigart_cleanup)( drm_device_t *dev,
return 0;
}
- free( (void *)addr, DRM(M_DRM));
-
+#if __FreeBSD_version > 500000
+ contigfree( (void *)addr, (1 << ATI_PCIGART_TABLE_ORDER) * PAGE_SIZE, DRM(M_DRM)); /* Not available on 4.x */
+#endif
return 1;
}
diff --git a/bsd/ati_pcigart.h b/bsd/ati_pcigart.h
index bfb8ab25..ba0b81a7 100644
--- a/bsd/ati_pcigart.h
+++ b/bsd/ati_pcigart.h
@@ -57,7 +57,8 @@ int DRM(ati_pcigart_init)( drm_device_t *dev,
goto done;
}
- address = malloc( (1 << ATI_PCIGART_TABLE_ORDER) * PAGE_SIZE, DRM(M_DRM), M_WAITOK );
+ address = (long)contigmalloc((1 << ATI_PCIGART_TABLE_ORDER) * PAGE_SIZE,
+ DRM(M_DRM), M_WAITOK, 0ul, 0xfffffffful, PAGE_SIZE, 0);
if ( !address ) {
DRM_ERROR( "cannot allocate PCI GART page!\n" );
goto done;
@@ -103,7 +104,8 @@ int DRM(ati_pcigart_cleanup)( drm_device_t *dev,
return 0;
}
- free( (void *)addr, DRM(M_DRM));
-
+#if __FreeBSD_version > 500000
+ contigfree( (void *)addr, (1 << ATI_PCIGART_TABLE_ORDER) * PAGE_SIZE, DRM(M_DRM)); /* Not available on 4.x */
+#endif
return 1;
}