]> git.baikalelectronics.ru Git - kernel.git/commit
drm/rockchip: use drm_gem_mmap helpers
authorDaniel Kurtz <djkurtz@chromium.org>
Tue, 7 Jul 2015 09:03:36 +0000 (17:03 +0800)
committerMark Yao <mark.yao@rock-chips.com>
Mon, 13 Jul 2015 05:54:03 +0000 (13:54 +0800)
commitccfe497d826b5766cbdaeb576179742c2b4f2e4a
tree0977d50d23afe9b3f447ec2e7f62ab9eaed7f171
parent740a590d3bf1257a80d4b0d0fca7e915e66c201d
drm/rockchip: use drm_gem_mmap helpers

Rather than (incompletely [0]) re-implementing drm_gem_mmap() and
drm_gem_mmap_obj() helpers, call them directly from the rockchip mmap
routines.

Once the core functions return successfully, the rockchip mmap routines
can still use dma_mmap_attrs() to simply mmap the entire buffer.

[0] Previously, we were performing the mmap() without first taking a
reference on the underlying gem buffer.  This could leak ptes if the gem
object is destroyed while userspace is still holding the mapping.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: stable@vger.kernel.org
drivers/gpu/drm/rockchip/rockchip_drm_gem.c