From 333b831b9eb5eb96dcf89da839b6607aa98120f5 Mon Sep 17 00:00:00 2001 From: Mark Yao Date: Tue, 6 Jun 2017 14:14:08 +0800 Subject: [PATCH] drm/rockchip: limit gem buffer to 32bit mapping Change-Id: I64537668aa10a2e26bdd19ac79bc417aa6c4a437 Signed-off-by: Mark Yao --- drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 5 +++++ 1 file changed, 5 insertions(+) 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; } -- 2.34.1