Skip to content

Commit

Permalink
drm/rockchip: unset pgoff when mmap'ing gems
Browse files Browse the repository at this point in the history
Commit 371f0f0 ("ARM: 8426/1: dma-mapping: add missing range check
 in dma_mmap()") introduced offset-checking for mappings, which collides
with the fake-offset the drm sets for gems.

Other drm-drivers set this offset to 0 before doing the mapping, so
this looks like the correct way to go for rockchip as well.

Fixes: 371f0f0 ("ARM: 8426/1: dma-mapping: add missing range check in dma_mmap()")
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
  • Loading branch information
Heiko Stuebner authored and Mark Yao committed Dec 2, 2015
1 parent d7b53fd commit a8594f2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/gpu/drm/rockchip/rockchip_drm_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ static int rockchip_drm_gem_object_mmap(struct drm_gem_object *obj,
* VM_PFNMAP flag that was set by drm_gem_mmap_obj()/drm_gem_mmap().
*/
vma->vm_flags &= ~VM_PFNMAP;
vma->vm_pgoff = 0;

ret = dma_mmap_attrs(drm->dev, vma, rk_obj->kvaddr, rk_obj->dma_addr,
obj->size, &rk_obj->dma_attrs);
Expand Down

0 comments on commit a8594f2

Please sign in to comment.