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/i915 Pass waitok/nowait flags...



details:   https://anonhg.NetBSD.org/src/rev/e2db9d563ab4
branches:  trunk
changeset: 366323:e2db9d563ab4
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 14:49:39 2018 +0000

description:
Pass waitok/nowait flags to bus_dma.  Use boundary=0.

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/i915_gem_gtt.c |  20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

diffs (54 lines):

diff -r 0c393736934b -r e2db9d563ab4 sys/external/bsd/drm2/dist/drm/i915/i915_gem_gtt.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_gem_gtt.c        Mon Aug 27 14:49:22 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_gem_gtt.c        Mon Aug 27 14:49:39 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_gem_gtt.c,v 1.11 2018/08/27 07:17:35 riastradh Exp $      */
+/*     $NetBSD: i915_gem_gtt.c,v 1.12 2018/08/27 14:49:39 riastradh Exp $      */
 
 /*
  * Copyright © 2010 Daniel Vetter
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_gem_gtt.c,v 1.11 2018/08/27 07:17:35 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_gem_gtt.c,v 1.12 2018/08/27 14:49:39 riastradh Exp $");
 
 #include <linux/bitmap.h>
 #include <linux/err.h>
@@ -325,24 +325,30 @@
                            struct i915_page_dma *p, gfp_t flags)
 {
 #ifdef __NetBSD__
+       int busdmaflags = 0;
        int error;
        int nseg = 1;
 
-       error = bus_dmamem_alloc(dev->dmat, PAGE_SIZE, PAGE_SIZE, PAGE_SIZE,
-           &p->seg, nseg, &nseg, BUS_DMA_WAITOK);
+       if (flags & __GFP_WAIT)
+               busdmaflags |= BUS_DMA_WAITOK;
+       else
+               busdmaflags |= BUS_DMA_NOWAIT;
+
+       error = bus_dmamem_alloc(dev->dmat, PAGE_SIZE, PAGE_SIZE, 0, &p->seg,
+           nseg, &nseg, busdmaflags);
        if (error) {
 fail0:         p->map = NULL;
                return -error;  /* XXX errno NetBSD->Linux */
        }
        KASSERT(nseg == 1);
-       error = bus_dmamap_create(dev->dmat, PAGE_SIZE, 1, PAGE_SIZE,
-           PAGE_SIZE, BUS_DMA_WAITOK, &p->map);
+       error = bus_dmamap_create(dev->dmat, PAGE_SIZE, 1, PAGE_SIZE, 0,
+           busdmaflags, &p->map);
        if (error) {
 fail1:         bus_dmamem_free(dev->dmat, &p->seg, 1);
                goto fail0;
        }
        error = bus_dmamap_load_raw(dev->dmat, p->map, &p->seg, 1, PAGE_SIZE,
-           BUS_DMA_WAITOK);
+           busdmaflags);
        if (error) {
 fail2: __unused
                bus_dmamap_destroy(dev->dmat, p->map);



Home | Main Index | Thread Index | Old Index