CHROMIUM: drm/rockchip: Respect page offset for PRIME mmap calls
authorØrjan Eide <orjan.eide@arm.com>
Mon, 5 Sep 2016 11:49:12 +0000 (13:49 +0200)
committerHuang, Tao <huangtao@rock-chips.com>
Wed, 7 Dec 2016 06:32:27 +0000 (14:32 +0800)
commit4edac39a91be426ad550e4d75d55e249c8000a53
treea38cf4da981b8f3ed65a27a9c93c08cd5522294c
parent31bae78bcce53079d6fab80631ad15259bf5dc51
CHROMIUM: drm/rockchip: Respect page offset for PRIME mmap calls

When mapping external DMA-bufs through the PRIME mmap call, we might be
given an offset which has to be respected. However for the internal DRM
GEM mmap path, we have to ignore the fake mmap offset used to identify
the buffer only. Currently the code always zeroes out vma->vm_pgoff,
which breaks the former.

This patch fixes the problem by moving the vm_pgoff assignment to a
function that is used only for GEM mmap path, so that the PRIME path
retains the original offset.

BUG=chrome-os-partner:56615
TEST=graphics_GLBench

Change-Id: Iec6e996707b0fe7e95a019423a944d98c80beaab
Signed-off-by: rjan Eide <orjan.eide@arm.com>
Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/381332
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Randy Li <randy.li@rock-chips.com>
drivers/gpu/drm/rockchip/rockchip_drm_gem.c