summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/msm
diff options
context:
space:
mode:
authorLucas Stach2019-02-28 07:23:29 +0100
committerRob Clark2019-04-18 19:04:09 +0200
commit0abdba47dc1df708c365421d481734d3f7fecb01 (patch)
tree5674005645d92e3308350866aac56e5236073a3b /drivers/gpu/drm/msm
parentLinux 5.1-rc4 (diff)
downloadkernel-qcow2-linux-0abdba47dc1df708c365421d481734d3f7fecb01.tar.gz
kernel-qcow2-linux-0abdba47dc1df708c365421d481734d3f7fecb01.tar.xz
kernel-qcow2-linux-0abdba47dc1df708c365421d481734d3f7fecb01.zip
drm/msm: don't allocate pages from the MOVABLE zone
The pages backing the GEM objects are kept pinned in place as long as they are alive, so they must not be allocated from the MOVABLE zone. Blocking page migration for too long will cause the VM subsystem headaches and will outright break CMA, as a few pinned pages in CMA will lead to failure to find the required large contiguous regions. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Rob Clark <robdclark@chromium.org>
Diffstat (limited to 'drivers/gpu/drm/msm')
-rw-r--r--drivers/gpu/drm/msm/msm_gem.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c
index 18ca651ab942..76940a9da980 100644
--- a/drivers/gpu/drm/msm/msm_gem.c
+++ b/drivers/gpu/drm/msm/msm_gem.c
@@ -1026,6 +1026,13 @@ static struct drm_gem_object *_msm_gem_new(struct drm_device *dev,
ret = drm_gem_object_init(dev, obj, size);
if (ret)
goto fail;
+ /*
+ * Our buffers are kept pinned, so allocating them from the
+ * MOVABLE zone is a really bad idea, and conflicts with CMA.
+ * See comments above new_inode() why this is required _and_
+ * expected if you're going to pin these pages.
+ */
+ mapping_set_gfp_mask(obj->filp->f_mapping, GFP_HIGHUSER);
}
return obj;