summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2013-07-26 10:09:32 (GMT)
committerInki Dae <inki.dae@samsung.com>2014-10-15 11:05:16 (GMT)
commit46632126975e9a4bdcfda7fa691d9e9077873f71 (patch)
treeb44168333070ab7b18650e3e18ee1dd141f867d5
parentb277690564bbbe1b9838f7831ba160c52e941f5b (diff)
downloadlinux-3.10-46632126975e9a4bdcfda7fa691d9e9077873f71.zip
linux-3.10-46632126975e9a4bdcfda7fa691d9e9077873f71.tar.gz
linux-3.10-46632126975e9a4bdcfda7fa691d9e9077873f71.tar.bz2
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 <daniel.vetter@ffwll.ch> Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Reported-by: Sedat Dilek <sedat.dilek@gmail.com> Tested-by: Sedat Dilek <sedat.dilek@gmail.com> Signed-off-by: Dave Airlie <airlied@gmail.com>
-rw-r--r--drivers/gpu/drm/drm_gem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
index 2cb316b..29e348a 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);
mutex_unlock(&dev->struct_mutex);