diff options
author | Dave Airlie <airlied@redhat.com> | 2008-03-07 11:59:21 +1100 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2008-03-07 11:59:21 +1100 |
commit | f96baf1e1ec10768ea2027f75ebaef46f7d7f30a (patch) | |
tree | 1c387c45449a42e5692dcc3d1a62e39dcd8ca53f /linux-core/drm_scatter.c | |
parent | ccae12a837e7b17c4e9211295ecbd18807020742 (diff) | |
parent | 2540ea7dc6c0c4f0ebca3370d6ec7359e4276e13 (diff) |
Merge branch 'master' of ../../drm into modesetting-101
Diffstat (limited to 'linux-core/drm_scatter.c')
-rw-r--r-- | linux-core/drm_scatter.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/linux-core/drm_scatter.c b/linux-core/drm_scatter.c index 77b9f95d..dfae4b84 100644 --- a/linux-core/drm_scatter.c +++ b/linux-core/drm_scatter.c @@ -36,6 +36,15 @@ #define DEBUG_SCATTER 0 +static inline void *drm_vmalloc_dma(unsigned long size) +{ +#if defined(__powerpc__) && defined(CONFIG_NOT_COHERENT_CACHE) + return __vmalloc(size, GFP_KERNEL, PAGE_KERNEL | _PAGE_NO_CACHE); +#else + return vmalloc_32(size); +#endif +} + void drm_sg_cleanup(struct drm_sg_mem *entry) { struct page *page; @@ -105,7 +114,7 @@ int drm_sg_alloc(struct drm_device *dev, struct drm_scatter_gather * request) } memset((void *)entry->busaddr, 0, pages * sizeof(*entry->busaddr)); - entry->virtual = vmalloc_32(pages << PAGE_SHIFT); + entry->virtual = drm_vmalloc_dma(pages << PAGE_SHIFT); if (!entry->virtual) { drm_free(entry->busaddr, entry->pages * sizeof(*entry->busaddr), DRM_MEM_PAGES); |