提交 398b4706 编写于 作者: A Alan Cox 提交者: Dave Airlie

gma500: Set the mapping mask

Some boards such as the Intel D2700MUD allow you to have over 4GB of RAM.
The GTT on the PVR based devices is 32bit however. Hugh Dickins points out
that we should therefore be setting the mapping gfp mask.

This is not the whole fix for the problem. Some further shmem patches will
be needed to deal with the corner cases.
Signed-off-by: NAlan Cox <alan@linux.intel.com>
Signed-off-by: NDave Airlie <airlied@redhat.com>
上级 ae0a246a
...@@ -124,6 +124,8 @@ static int psb_gem_create(struct drm_file *file, ...@@ -124,6 +124,8 @@ static int psb_gem_create(struct drm_file *file,
dev_err(dev->dev, "GEM init failed for %lld\n", size); dev_err(dev->dev, "GEM init failed for %lld\n", size);
return -ENOMEM; return -ENOMEM;
} }
/* Limit the object to 32bit mappings */
mapping_set_gfp_mask(r->gem.filp->f_mapping, GFP_KERNEL | __GFP_DMA32);
/* Give the object a handle so we can carry it more easily */ /* Give the object a handle so we can carry it more easily */
ret = drm_gem_handle_create(file, &r->gem, &handle); ret = drm_gem_handle_create(file, &r->gem, &handle);
if (ret) { if (ret) {
......
...@@ -39,6 +39,10 @@ static inline uint32_t psb_gtt_mask_pte(uint32_t pfn, int type) ...@@ -39,6 +39,10 @@ static inline uint32_t psb_gtt_mask_pte(uint32_t pfn, int type)
{ {
uint32_t mask = PSB_PTE_VALID; uint32_t mask = PSB_PTE_VALID;
/* Ensure we explode rather than put an invalid low mapping of
a high mapping page into the gtt */
BUG_ON(pfn & ~(0xFFFFFFFF >> PAGE_SHIFT));
if (type & PSB_MMU_CACHED_MEMORY) if (type & PSB_MMU_CACHED_MEMORY)
mask |= PSB_PTE_CACHED; mask |= PSB_PTE_CACHED;
if (type & PSB_MMU_RO_MEMORY) if (type & PSB_MMU_RO_MEMORY)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册