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 Remove redundant handling for tt_u...



details:   https://anonhg.NetBSD.org/src/rev/b2dbc6fa55bb
branches:  trunk
changeset: 822241:b2dbc6fa55bb
user:      maya <maya%NetBSD.org@localhost>
date:      Thu Mar 09 07:50:50 2017 +0000

description:
Remove redundant handling for tt_unbound case, and assert that it is the
unpopulated case.

All callers of ttm_bus_dma_populate (ttm_agp_tt_populate,
radeon_ttm_tt_populate, nouveau_ttm_tt_populate) return early if it isn't
unpopulated.

from riastradh@

diffstat:

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

diffs (47 lines):

diff -r be30dc284f2a -r b2dbc6fa55bb sys/external/bsd/drm2/ttm/ttm_bus_dma.c
--- a/sys/external/bsd/drm2/ttm/ttm_bus_dma.c   Thu Mar 09 07:42:36 2017 +0000
+++ b/sys/external/bsd/drm2/ttm/ttm_bus_dma.c   Thu Mar 09 07:50:50 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ttm_bus_dma.c,v 1.3 2017/03/09 07:42:36 maya Exp $     */
+/*     $NetBSD: ttm_bus_dma.c,v 1.4 2017/03/09 07:50:50 maya 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.3 2017/03/09 07:42:36 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ttm_bus_dma.c,v 1.4 2017/03/09 07:50:50 maya Exp $");
 
 #include <sys/bus.h>
 
@@ -55,23 +55,12 @@
 {
        int ret;
 
-       KASSERT(ttm_dma->ttm.state != tt_bound);
+       KASSERT(ttm_dma->ttm.state == tt_unpopulated);
 
-       /* Check the current state.  */
-       if (ttm_dma->ttm.state == tt_unbound) {
-               /*
-                * If it's populated, then if the pages are wired and
-                * loaded already, nothing to do.
-                */
-               if (!ISSET(ttm_dma->ttm.page_flags, TTM_PAGE_FLAG_SWAPPED))
-                       return 0;
-       } else if (ttm_dma->ttm.state == tt_unpopulated) {
-               /* If it's unpopulated, it can't be swapped.  */
-               KASSERT(!ISSET(ttm_dma->ttm.page_flags,
-                       TTM_PAGE_FLAG_SWAPPED));
-               /* Pretend it is now, for the sake of ttm_tt_wire.  */
-               ttm_dma->ttm.page_flags |= TTM_PAGE_FLAG_SWAPPED;
-       }
+       /* If it's unpopulated, it can't be swapped.  */
+       KASSERT(!ISSET(ttm_dma->ttm.page_flags, TTM_PAGE_FLAG_SWAPPED));
+       /* Pretend it is now, for the sake of ttm_tt_wire.  */
+       ttm_dma->ttm.page_flags |= TTM_PAGE_FLAG_SWAPPED;
 
        /* Wire the uvm pages and fill the ttm page array.  */
        ret = ttm_tt_wire(&ttm_dma->ttm);



Home | Main Index | Thread Index | Old Index