drm/rockchip: use __GFP_DMA32 for shmem-backed gem

Rockchip requires bo-pages to be in the DMA32 zone. Explicitly request this
by setting __GFP_DMA32 as mapping-gfp-mask during shmem initialization.
This drops HIGHMEM from the gfp-mask and uses DMA32 instead. shmem-core
takes care to relocate pages during swap-in in case they have been loaded
into the wrong zone.

It is _not_ possible to pass __GFP_DMA32 to shmem_read_mapping_page_gfp()
as the page might have already been swapped-in at that time. The zone-mask
must be set during initialization and be kept constant for now.

Change-Id: I6db4f9e8ed716a1f7c90c7d92920122a484bf45d
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
This commit is contained in:
Jianqun Xu
2017-12-12 18:41:42 +08:00
parent bbea8b144e
commit 024bde41c3

View File

@@ -592,11 +592,8 @@ rockchip_gem_alloc_object(struct drm_device *drm, unsigned int size)
drm_gem_object_init(drm, obj, size);
if (IS_ENABLED(CONFIG_ARM_LPAE)) {
mapping = file_inode(obj->filp)->i_mapping;
mapping_set_gfp_mask(mapping,
mapping_gfp_mask(mapping) | __GFP_DMA32);
}
mapping = file_inode(obj->filp)->i_mapping;
mapping_set_gfp_mask(mapping, GFP_USER | __GFP_DMA32);
return rk_obj;
}