Merge branch 'etnaviv/next' of https://git.pengutronix.de/git/lst/linux into drm...
[sfrench/cifs-2.6.git] / drivers / gpu / drm / etnaviv / etnaviv_gem.c
index f0efc5db793f2bb8eddffaf7f3ad7920f63b1cc7..9a3bea738330208841b4e2a7a50aa73f8999c64d 100644 (file)
@@ -752,7 +752,7 @@ static struct page **etnaviv_gem_userptr_do_get_pages(
        uintptr_t ptr;
        unsigned int flags = 0;
 
-       pvec = drm_malloc_ab(npages, sizeof(struct page *));
+       pvec = kvmalloc_array(npages, sizeof(struct page *), GFP_KERNEL);
        if (!pvec)
                return ERR_PTR(-ENOMEM);
 
@@ -776,7 +776,7 @@ static struct page **etnaviv_gem_userptr_do_get_pages(
 
        if (ret < 0) {
                release_pages(pvec, pinned, 0);
-               drm_free_large(pvec);
+               kvfree(pvec);
                return ERR_PTR(ret);
        }
 
@@ -827,7 +827,7 @@ static int etnaviv_gem_userptr_get_pages(struct etnaviv_gem_object *etnaviv_obj)
        mm = get_task_mm(etnaviv_obj->userptr.task);
        pinned = 0;
        if (mm == current->mm) {
-               pvec = drm_malloc_ab(npages, sizeof(struct page *));
+               pvec = kvmalloc_array(npages, sizeof(struct page *), GFP_KERNEL);
                if (!pvec) {
                        mmput(mm);
                        return -ENOMEM;
@@ -836,7 +836,7 @@ static int etnaviv_gem_userptr_get_pages(struct etnaviv_gem_object *etnaviv_obj)
                pinned = __get_user_pages_fast(etnaviv_obj->userptr.ptr, npages,
                                               !etnaviv_obj->userptr.ro, pvec);
                if (pinned < 0) {
-                       drm_free_large(pvec);
+                       kvfree(pvec);
                        mmput(mm);
                        return pinned;
                }
@@ -849,7 +849,7 @@ static int etnaviv_gem_userptr_get_pages(struct etnaviv_gem_object *etnaviv_obj)
        }
 
        release_pages(pvec, pinned, 0);
-       drm_free_large(pvec);
+       kvfree(pvec);
 
        work = kmalloc(sizeof(*work), GFP_KERNEL);
        if (!work) {
@@ -883,7 +883,7 @@ static void etnaviv_gem_userptr_release(struct etnaviv_gem_object *etnaviv_obj)
                int npages = etnaviv_obj->base.size >> PAGE_SHIFT;
 
                release_pages(etnaviv_obj->pages, npages, 0);
-               drm_free_large(etnaviv_obj->pages);
+               kvfree(etnaviv_obj->pages);
        }
        put_task_struct(etnaviv_obj->userptr.task);
 }