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/ttm ttm_io_prot: follow linux...



details:   https://anonhg.NetBSD.org/src/rev/475094cf63a8
branches:  trunk
changeset: 1006825:475094cf63a8
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Tue Jan 28 23:21:05 2020 +0000

description:
ttm_io_prot: follow linux semantics and set either PMAP_WRITE_COMBINE or
PMAP_NOCACHE when existing cache flags are not set

diffstat:

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

diffs (39 lines):

diff -r 75b8eeaffaf2 -r 475094cf63a8 sys/external/bsd/drm2/dist/drm/ttm/ttm_bo_util.c
--- a/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo_util.c  Tue Jan 28 22:20:45 2020 +0000
+++ b/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo_util.c  Tue Jan 28 23:21:05 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ttm_bo_util.c,v 1.14 2018/08/30 01:19:49 riastradh Exp $       */
+/*     $NetBSD: ttm_bo_util.c,v 1.15 2020/01/28 23:21:05 jmcneill Exp $        */
 
 /**************************************************************************
  *
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ttm_bo_util.c,v 1.14 2018/08/30 01:19:49 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ttm_bo_util.c,v 1.15 2020/01/28 23:21:05 jmcneill Exp $");
 
 #include <drm/ttm/ttm_bo_driver.h>
 #include <drm/ttm/ttm_placement.h>
@@ -565,17 +565,11 @@
                return tmp;
 
 #ifdef __NetBSD__
-       switch (caching_flags & TTM_PL_MASK_CACHING) {
-       case TTM_PL_FLAG_CACHED:
-               return (tmp | PMAP_WRITE_BACK);
-       case TTM_PL_FLAG_WC:
+       tmp &= ~PMAP_CACHE_MASK;
+       if (caching_flags & TTM_PL_FLAG_WC)
                return (tmp | PMAP_WRITE_COMBINE);
-       case TTM_PL_FLAG_UNCACHED:
+       else
                return (tmp | PMAP_NOCACHE);
-       default:
-               panic("invalid caching flags: %"PRIx32"\n",
-                   (caching_flags & TTM_PL_MASK_CACHING));
-       }
 #else
 #if defined(__i386__) || defined(__x86_64__)
        if (caching_flags & TTM_PL_FLAG_WC)



Home | Main Index | Thread Index | Old Index