From: Mark Yao Date: Tue, 6 Jun 2017 06:14:08 +0000 (+0800) Subject: drm/rockchip: limit gem buffer to 32bit mapping X-Git-Tag: release-20171130_firefly~4^2~422 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=333b831b9eb5eb96dcf89da839b6607aa98120f5;p=firefly-linux-kernel-4.4.55.git drm/rockchip: limit gem buffer to 32bit mapping Change-Id: I64537668aa10a2e26bdd19ac79bc417aa6c4a437 Signed-off-by: Mark Yao --- diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c index 12bc70d44257..3a26e9a0f68d 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c @@ -24,6 +24,7 @@ #include #include #include +#include #include "rockchip_drm_drv.h" #include "rockchip_drm_gem.h" @@ -432,6 +433,7 @@ int rockchip_gem_mmap(struct file *filp, struct vm_area_struct *vma) static struct rockchip_gem_object * rockchip_gem_alloc_object(struct drm_device *drm, unsigned int size) { + struct address_space *mapping; struct rockchip_gem_object *rk_obj; struct drm_gem_object *obj; @@ -445,6 +447,9 @@ rockchip_gem_alloc_object(struct drm_device *drm, unsigned int size) drm_gem_object_init(drm, obj, size); + mapping = file_inode(obj->filp)->i_mapping; + mapping_set_gfp_mask(mapping, mapping_gfp_mask(mapping) | __GFP_DMA32); + return rk_obj; }