]> git.baikalelectronics.ru Git - kernel.git/commit
drm/cma-helper: Set VM_DONTEXPAND for mmap
authorRobin Murphy <robin.murphy@arm.com>
Wed, 13 Oct 2021 14:36:54 +0000 (10:36 -0400)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 11 Feb 2022 17:11:59 +0000 (12:11 -0500)
commite210a59613476ee1d709e7e75e700149b80937a9
tree28aab61646c7fbf513d6fa5db6ac402b6b20b69a
parent68209523fd3c9e1a9586f5b508484c3c495a2eeb
drm/cma-helper: Set VM_DONTEXPAND for mmap

drm_gem_cma_mmap() cannot assume every implementation of dma_mmap_wc()
will end up calling remap_pfn_range() (which happens to set the relevant
vma flag, among others), so in order to make sure expectations around
VM_DONTEXPAND are met, let it explicitly set the flag like most other
GEM mmap implementations do.

This avoids repeated warnings on a small minority of systems where the
display is behind an IOMMU, and has a simple driver which does not
override drm_gem_cma_default_funcs. Arm hdlcd is an in-tree affected
driver. Out-of-tree, the Apple DCP driver is affected; this fix is
required for DCP to be mainlined.

[Alyssa: Update commit message.]

Fixes: be7f44f3f2eb ("drm: add mmap() to drm_gem_object_funcs")
Acked-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211013143654.39031-1-alyssa@rosenzweig.io
drivers/gpu/drm/drm_gem_cma_helper.c