Limit gem object mapping to below 4G. This fixes two issues:
1. remove limit that gem can't be enabled with PAE
2. in x64, shmem page can be higher than 4G, but for example, 945G GTT
mapping can only handle 4G mapping.

Am I missing anything?

Signed-off-by: Shaohua Li <shaohua...@intel.com>
---
 drivers/gpu/drm/drm_gem.c       |    1 +
 drivers/gpu/drm/i915/i915_dma.c |    6 ------
 mm/shmem.c                      |    2 +-
 3 files changed, 2 insertions(+), 7 deletions(-)

Index: linux/drivers/gpu/drm/drm_gem.c
===================================================================
--- linux.orig/drivers/gpu/drm/drm_gem.c        2009-05-19 14:27:12.000000000 
+0800
+++ linux/drivers/gpu/drm/drm_gem.c     2009-05-19 14:29:47.000000000 +0800
@@ -141,6 +141,7 @@ drm_gem_object_alloc(struct drm_device *
                kfree(obj);
                return NULL;
        }
+       mapping_set_gfp_mask(obj->filp->f_mapping, GFP_USER|GFP_DMA32);
 
        kref_init(&obj->refcount);
        kref_init(&obj->handlecount);
Index: linux/drivers/gpu/drm/i915/i915_dma.c
===================================================================
--- linux.orig/drivers/gpu/drm/i915/i915_dma.c  2009-05-19 14:27:12.000000000 
+0800
+++ linux/drivers/gpu/drm/i915/i915_dma.c       2009-05-19 14:29:19.000000000 
+0800
@@ -1152,13 +1152,7 @@ int i915_driver_load(struct drm_device *
                         "performance may suffer.\n");
        }
 
-#ifdef CONFIG_HIGHMEM64G
-       /* don't enable GEM on PAE - needs agp + set_memory_* interface fixes */
-       dev_priv->has_gem = 0;
-#else
-       /* enable GEM by default */
        dev_priv->has_gem = 1;
-#endif
 
        dev->driver->get_vblank_counter = i915_get_vblank_counter;
        if (IS_GM45(dev))
Index: linux/mm/shmem.c
===================================================================
--- linux.orig/mm/shmem.c       2009-05-19 14:39:11.000000000 +0800
+++ linux/mm/shmem.c    2009-05-19 14:39:45.000000000 +0800
@@ -1241,7 +1241,7 @@ repeat:
                 * Try to preload while we can wait, to not make a habit of
                 * draining atomic reserves; but don't latch on to this cpu.
                 */
-               error = radix_tree_preload(gfp & ~__GFP_HIGHMEM);
+               error = radix_tree_preload(gfp & ~(__GFP_HIGHMEM|__GFP_DMA32));
                if (error)
                        goto failed;
                radix_tree_preload_end();

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to