diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-03-30 14:27:01 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-03-30 14:27:01 -0700 |
commit | f698f1f7ad69f700dd1c754aa2b4aa7acbd51703 (patch) | |
tree | 53892eb15e0b2380d6c4e6f8321d0b8bea8de4c0 /drivers/char/drm/drm_scatter.c | |
parent | a77df5cd1cde203ef11c8e5a3ca47def5f5a1687 (diff) | |
parent | 6876b3bacaaa4c73fb8752b47c84b2b7fad5422a (diff) |
Merge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6
* 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
drm: fix for non-coherent DMA PowerPC
drm: radeon: fix sparse integer as NULL pointer warnings in radeon_mem.c
drm/i915: fix oops on agp=off
drm/r300: fix bug in r300 userspace hardware wait emission
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 26d8f675ed5..b2b0f3d4171 100644 --- a/drivers/char/drm/drm_scatter.c +++ b/drivers/char/drm/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; @@ -104,7 +113,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); |