Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/dist/drm Sync drm_gem_get_pages: drm_m...



details:   https://anonhg.NetBSD.org/src/rev/6a1b587375a3
branches:  trunk
changeset: 1027876:6a1b587375a3
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 01:02:44 2021 +0000

description:
Sync drm_gem_get_pages: drm_malloc_ab -> kvmalloc_array.

diffstat:

 sys/external/bsd/drm2/dist/drm/drm_gem.c |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (43 lines):

diff -r 0d502a67b494 -r 6a1b587375a3 sys/external/bsd/drm2/dist/drm/drm_gem.c
--- a/sys/external/bsd/drm2/dist/drm/drm_gem.c  Sun Dec 19 01:02:34 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_gem.c  Sun Dec 19 01:02:44 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drm_gem.c,v 1.16 2021/12/18 23:44:57 riastradh Exp $   */
+/*     $NetBSD: drm_gem.c,v 1.17 2021/12/19 01:02:44 riastradh Exp $   */
 
 /*
  * Copyright © 2008 Intel Corporation
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_gem.c,v 1.16 2021/12/18 23:44:57 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_gem.c,v 1.17 2021/12/19 01:02:44 riastradh Exp $");
 
 #include <linux/types.h>
 #include <linux/slab.h>
@@ -600,12 +600,13 @@
        struct pglist pglist;
        struct vm_page *vm_page;
        struct page **pages;
-       unsigned i;
+       unsigned i, npages;
        int ret;
 
        KASSERT((obj->size & (PAGE_SIZE - 1)) != 0);
 
-       pages = drm_malloc_ab(obj->size >> PAGE_SHIFT, sizeof(*pages));
+       npages = obj->size >> PAGE_SHIFT;
+       pages = kvmalloc_array(npages, sizeof(*pages), GFP_KERNEL);
        if (pages == NULL) {
                ret = -ENOMEM;
                goto fail0;
@@ -623,7 +624,7 @@
 
        return pages;
 
-fail1: drm_free_large(pages);
+fail1: kvfree(pages);
 fail0: return ERR_PTR(ret);
 }
 #else



Home | Main Index | Thread Index | Old Index