Skip to content

Commit 024bde4

Browse files
committed
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>
1 parent bbea8b1 commit 024bde4

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

drivers/gpu/drm/rockchip/rockchip_drm_gem.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -592,11 +592,8 @@ rockchip_gem_alloc_object(struct drm_device *drm, unsigned int size)
592592

593593
drm_gem_object_init(drm, obj, size);
594594

595-
if (IS_ENABLED(CONFIG_ARM_LPAE)) {
596-
mapping = file_inode(obj->filp)->i_mapping;
597-
mapping_set_gfp_mask(mapping,
598-
mapping_gfp_mask(mapping) | __GFP_DMA32);
599-
}
595+
mapping = file_inode(obj->filp)->i_mapping;
596+
mapping_set_gfp_mask(mapping, GFP_USER | __GFP_DMA32);
600597

601598
return rk_obj;
602599
}

0 commit comments

Comments
 (0)