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/ttm in ttm_bus_dma_populate(), move th...



details:   https://anonhg.NetBSD.org/src/rev/fd5cd753c10d
branches:  trunk
changeset: 456070:fd5cd753c10d
user:      chs <chs%NetBSD.org@localhost>
date:      Sun Apr 21 15:49:50 2019 +0000

description:
in ttm_bus_dma_populate(), move the clearing of TTM_PAGE_FLAG_SWAPPED to be
earlier to avoid wrongly asserting if bus_dmamap_load_pglist() fails.

diffstat:

 sys/external/bsd/drm2/ttm/ttm_bus_dma.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (38 lines):

diff -r 2dbd82581664 -r fd5cd753c10d sys/external/bsd/drm2/ttm/ttm_bus_dma.c
--- a/sys/external/bsd/drm2/ttm/ttm_bus_dma.c   Sun Apr 21 15:32:18 2019 +0000
+++ b/sys/external/bsd/drm2/ttm/ttm_bus_dma.c   Sun Apr 21 15:49:50 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ttm_bus_dma.c,v 1.7 2017/03/09 08:27:18 maya Exp $     */
+/*     $NetBSD: ttm_bus_dma.c,v 1.8 2019/04/21 15:49:50 chs Exp $      */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ttm_bus_dma.c,v 1.7 2017/03/09 08:27:18 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ttm_bus_dma.c,v 1.8 2019/04/21 15:49:50 chs Exp $");
 
 #include <sys/bus.h>
 
@@ -70,6 +70,9 @@
        /* Mark it populated but unbound.  */
        ttm_dma->ttm.state = tt_unbound;
 
+       /* Mark it wired.  */
+       ttm_dma->ttm.page_flags &= ~TTM_PAGE_FLAG_SWAPPED;
+
        /* Load the DMA map.  */
        /* XXX errno NetBSD->Linux */
        ret = -bus_dmamap_load_pglist(ttm_dma->ttm.bdev->dmat,
@@ -78,9 +81,6 @@
        if (ret)
                goto fail1;
 
-       /* Mark it wired.  */
-       ttm_dma->ttm.page_flags &= ~TTM_PAGE_FLAG_SWAPPED;
-
        /* Success!  */
        return 0;
 



Home | Main Index | Thread Index | Old Index