path: root/drivers/gpu/drm
diff options
authorDavid Herrmann <>2013-07-26 12:09:32 +0200
committerChanho Park <>2014-11-21 19:13:41 +0900
commit2655346fdff2712760761cd9ebf7960fc578fbfe (patch)
tree98969bc25c93acbc4717f9e5ad4cc5d632345b68 /drivers/gpu/drm
parent898a1b66ae2363830f7f510bf1d085522c22bd5a (diff)
drm/gem: fix mmap vma size calculations
The VMA manager is page-size based so drm_vma_node_size() returns the size in pages. However, drm_gem_mmap_obj() requires the size in bytes. Apply PAGE_SHIFT so we no longer get EINVAL during mmaps due to too small buffers. This bug was introduced in commit: 0de23977cfeb5b357ec884ba15417ae118ff9e9b "drm/gem: convert to new unified vma manager" Fixes i915 gtt mmap failure reported by Sedat Dilek in: Re: linux-next: Tree for Jul 25 [ call-trace: drm | drm-intel related? ] Cc: Daniel Vetter <> Cc: Chris Wilson <> Signed-off-by: David Herrmann <> Reported-by: Sedat Dilek <> Tested-by: Sedat Dilek <> Signed-off-by: Dave Airlie <>
Diffstat (limited to 'drivers/gpu/drm')
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
index 2cb316bd2cd..29e348af296 100644
--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -731,7 +731,7 @@ int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma)
obj = container_of(node, struct drm_gem_object, vma_node);
- ret = drm_gem_mmap_obj(obj, drm_vma_node_size(node), vma);
+ ret = drm_gem_mmap_obj(obj, drm_vma_node_size(node) << PAGE_SHIFT, vma);