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/drm Honour write-combining flag in drm...



details:   https://anonhg.NetBSD.org/src/rev/8a2622a02c9b
branches:  trunk
changeset: 330260:8a2622a02c9b
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Tue Jul 01 16:29:57 2014 +0000

description:
Honour write-combining flag in drm_ioremap.

diffstat:

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

diffs (46 lines):

diff -r 66b13eb73f5a -r 8a2622a02c9b sys/external/bsd/drm2/drm/drm_memory.c
--- a/sys/external/bsd/drm2/drm/drm_memory.c    Tue Jul 01 16:27:25 2014 +0000
+++ b/sys/external/bsd/drm2/drm/drm_memory.c    Tue Jul 01 16:29:57 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drm_memory.c,v 1.4 2014/06/12 15:05:29 riastradh Exp $ */
+/*     $NetBSD: drm_memory.c,v 1.5 2014/07/01 16:29:57 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_memory.c,v 1.4 2014/06/12 15:05:29 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_memory.c,v 1.5 2014/07/01 16:29:57 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "agp_i810.h"
@@ -85,6 +85,7 @@
         */
        for (unit = 0; unit < dev->bus_nmaps; unit++) {
                struct drm_bus_map *const bm = &dev->bus_maps[unit];
+               int flags = bm->bm_flags;
 
                /* Reject maps starting after the request.  */
                if (map->offset < bm->bm_base)
@@ -100,12 +101,16 @@
                        continue;
 
                /* Ensure we can map the space into virtual memory.  */
-               if (!ISSET(bm->bm_flags, BUS_SPACE_MAP_LINEAR))
+               if (!ISSET(flags, BUS_SPACE_MAP_LINEAR))
                        continue;
 
+               /* Reflect requested flags in the bus_space map.  */
+               if (ISSET(map->flags, _DRM_WRITE_COMBINING))
+                       flags |= BUS_SPACE_MAP_PREFETCHABLE;
+
                /* Map it.  */
-               if (bus_space_map(bst, map->offset, map->size,
-                       bm->bm_flags, &map->lm_data.bus_space.bsh))
+               if (bus_space_map(bst, map->offset, map->size, flags,
+                       &map->lm_data.bus_space.bsh))
                        break;
 
                map->lm_data.bus_space.bus_map = bm;



Home | Main Index | Thread Index | Old Index