summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/via
diff options
context:
space:
mode:
authorLorenzo Stoakes <lstoakes@gmail.com>2017-02-27 21:50:08 +0000
committerDaniel Vetter <daniel.vetter@ffwll.ch>2017-02-28 10:00:50 +0100
commit0eb9acda36ac41e43afd152a96c2e769200bc264 (patch)
tree72241712b927da7eef78890a7a5735eea511463b /drivers/gpu/drm/via
parentac7d3af84b24eb20d2ac945c525147d24d7b230b (diff)
drm/via: use get_user_pages_unlocked()
Moving from get_user_pages() to get_user_pages_unlocked() simplifies the code and takes advantage of VM_FAULT_RETRY functionality when faulting in pages. Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20170227215008.21457-1-lstoakes@gmail.com
Diffstat (limited to 'drivers/gpu/drm/via')
-rw-r--r--drivers/gpu/drm/via/via_dmablit.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/gpu/drm/via/via_dmablit.c b/drivers/gpu/drm/via/via_dmablit.c
index 1a3ad769f8c8..98aae9809249 100644
--- a/drivers/gpu/drm/via/via_dmablit.c
+++ b/drivers/gpu/drm/via/via_dmablit.c
@@ -238,13 +238,9 @@ via_lock_all_dma_pages(drm_via_sg_info_t *vsg, drm_via_dmablit_t *xfer)
vsg->pages = vzalloc(sizeof(struct page *) * vsg->num_pages);
if (NULL == vsg->pages)
return -ENOMEM;
- down_read(&current->mm->mmap_sem);
- ret = get_user_pages((unsigned long)xfer->mem_addr,
- vsg->num_pages,
- (vsg->direction == DMA_FROM_DEVICE) ? FOLL_WRITE : 0,
- vsg->pages, NULL);
-
- up_read(&current->mm->mmap_sem);
+ ret = get_user_pages_unlocked((unsigned long)xfer->mem_addr,
+ vsg->num_pages, vsg->pages,
+ (vsg->direction == DMA_FROM_DEVICE) ? FOLL_WRITE : 0);
if (ret != vsg->num_pages) {
if (ret < 0)
return ret;