diff options
Diffstat (limited to 'drivers/char/drm/drm_scatter.c')
-rw-r--r-- | drivers/char/drm/drm_scatter.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/char/drm/drm_scatter.c b/drivers/char/drm/drm_scatter.c index 26d8f675ed5d..b2b0f3d41714 100644 --- a/drivers/char/drm/drm_scatter.c +++ b/drivers/char/drm/drm_scatter.c | |||
@@ -36,6 +36,15 @@ | |||
36 | 36 | ||
37 | #define DEBUG_SCATTER 0 | 37 | #define DEBUG_SCATTER 0 |
38 | 38 | ||
39 | static inline void *drm_vmalloc_dma(unsigned long size) | ||
40 | { | ||
41 | #if defined(__powerpc__) && defined(CONFIG_NOT_COHERENT_CACHE) | ||
42 | return __vmalloc(size, GFP_KERNEL, PAGE_KERNEL | _PAGE_NO_CACHE); | ||
43 | #else | ||
44 | return vmalloc_32(size); | ||
45 | #endif | ||
46 | } | ||
47 | |||
39 | void drm_sg_cleanup(struct drm_sg_mem * entry) | 48 | void drm_sg_cleanup(struct drm_sg_mem * entry) |
40 | { | 49 | { |
41 | struct page *page; | 50 | struct page *page; |
@@ -104,7 +113,7 @@ int drm_sg_alloc(struct drm_device *dev, struct drm_scatter_gather * request) | |||
104 | } | 113 | } |
105 | memset((void *)entry->busaddr, 0, pages * sizeof(*entry->busaddr)); | 114 | memset((void *)entry->busaddr, 0, pages * sizeof(*entry->busaddr)); |
106 | 115 | ||
107 | entry->virtual = vmalloc_32(pages << PAGE_SHIFT); | 116 | entry->virtual = drm_vmalloc_dma(pages << PAGE_SHIFT); |
108 | if (!entry->virtual) { | 117 | if (!entry->virtual) { |
109 | drm_free(entry->busaddr, | 118 | drm_free(entry->busaddr, |
110 | entry->pages * sizeof(*entry->busaddr), DRM_MEM_PAGES); | 119 | entry->pages * sizeof(*entry->busaddr), DRM_MEM_PAGES); |