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 Replace drm_ioremap by drm_core_iorema...



details:   https://anonhg.NetBSD.org/src/rev/15f4d5a7bb8c
branches:  trunk
changeset: 807960:15f4d5a7bb8c
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Apr 29 04:38:55 2015 +0000

description:
Replace drm_ioremap by drm_core_ioremap, reducing diff a little.

diffstat:

 sys/external/bsd/drm2/dist/drm/drm_bufs.c     |   8 ++++----
 sys/external/bsd/drm2/dist/include/drm/drmP.h |   4 +---
 sys/external/bsd/drm2/drm/drm_memory.c        |  15 ++++++++-------
 sys/external/bsd/drm2/pci/drm_pci.c           |   6 +++---
 4 files changed, 16 insertions(+), 17 deletions(-)

diffs (133 lines):

diff -r 1d5a324f53fc -r 15f4d5a7bb8c sys/external/bsd/drm2/dist/drm/drm_bufs.c
--- a/sys/external/bsd/drm2/dist/drm/drm_bufs.c Wed Apr 29 03:35:09 2015 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_bufs.c Wed Apr 29 04:38:55 2015 +0000
@@ -213,7 +213,7 @@
                }
                if (map->type == _DRM_REGISTERS) {
 #ifdef __NetBSD__
-                       map->handle = drm_ioremap(dev, map);
+                       drm_core_ioremap(map, dev);
 #else
                        if (map->flags & _DRM_WRITE_COMBINING)
                                map->handle = ioremap_wc(map->offset,
@@ -351,7 +351,7 @@
        if (!list) {
                if (map->type == _DRM_REGISTERS)
 #ifdef __NetBSD__
-                       drm_iounmap(dev, map);
+                       drm_core_ioremapfree(map, dev);
 #else
                        iounmap(map->handle);
 #endif
@@ -372,7 +372,7 @@
        if (ret) {
                if (map->type == _DRM_REGISTERS)
 #ifdef __NetBSD__              /* XXX What about other map types...?  */
-                       drm_iounmap(dev, map);
+                       drm_core_ioremapfree(map, dev);
 #else
                        iounmap(map->handle);
 #endif
@@ -494,7 +494,7 @@
        switch (map->type) {
        case _DRM_REGISTERS:
 #ifdef __NetBSD__
-               drm_iounmap(dev, map);
+               drm_core_ioremapfree(map, dev);
 #else
                iounmap(map->handle);
 #endif
diff -r 1d5a324f53fc -r 15f4d5a7bb8c sys/external/bsd/drm2/dist/include/drm/drmP.h
--- a/sys/external/bsd/drm2/dist/include/drm/drmP.h     Wed Apr 29 03:35:09 2015 +0000
+++ b/sys/external/bsd/drm2/dist/include/drm/drmP.h     Wed Apr 29 04:38:55 2015 +0000
@@ -1437,9 +1437,7 @@
 
                                /* Memory management support (drm_memory.h) */
 #include <drm/drm_memory.h>
-#ifdef __NetBSD__              /* XXX move to drm_memory.h */
-extern void *drm_ioremap(struct drm_device *dev, struct drm_local_map *map);
-extern void drm_iounmap(struct drm_device *dev, struct drm_local_map *map);
+#ifdef __NetBSD__
 extern int drm_limit_dma_space(struct drm_device *, resource_size_t,
     resource_size_t);
 #endif
diff -r 1d5a324f53fc -r 15f4d5a7bb8c sys/external/bsd/drm2/drm/drm_memory.c
--- a/sys/external/bsd/drm2/drm/drm_memory.c    Wed Apr 29 03:35:09 2015 +0000
+++ b/sys/external/bsd/drm2/drm/drm_memory.c    Wed Apr 29 04:38:55 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drm_memory.c,v 1.6 2014/07/16 20:56:25 riastradh Exp $ */
+/*     $NetBSD: drm_memory.c,v 1.7 2015/04/29 04:38:55 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.6 2014/07/16 20:56:25 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_memory.c,v 1.7 2015/04/29 04:38:55 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "agp_i810.h"
@@ -74,8 +74,8 @@
        return false;
 }
 
-void *
-drm_ioremap(struct drm_device *dev, struct drm_local_map *map)
+void
+drm_core_ioremap(struct drm_local_map *map, struct drm_device *dev)
 {
        const bus_space_tag_t bst = dev->bst;
        unsigned int unit;
@@ -125,19 +125,20 @@
        }
 
        /* Failure!  */
-       return NULL;
+       return;
 
 win:   map->lm_data.bus_space.bst = bst;
-       return bus_space_vaddr(bst, map->lm_data.bus_space.bsh);
+       map->handle = bus_space_vaddr(bst, map->lm_data.bus_space.bsh);
 }
 
 void
-drm_iounmap(struct drm_device *dev, struct drm_local_map *map)
+drm_core_ioremapfree(struct drm_local_map *map, struct drm_device *dev)
 {
        if (map->lm_data.bus_space.bus_map != NULL) {
                bus_space_unmap(map->lm_data.bus_space.bst,
                    map->lm_data.bus_space.bsh, map->size);
                map->lm_data.bus_space.bus_map = NULL;
+               map->handle = NULL;
        }
 }
 
diff -r 1d5a324f53fc -r 15f4d5a7bb8c sys/external/bsd/drm2/pci/drm_pci.c
--- a/sys/external/bsd/drm2/pci/drm_pci.c       Wed Apr 29 03:35:09 2015 +0000
+++ b/sys/external/bsd/drm2/pci/drm_pci.c       Wed Apr 29 04:38:55 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drm_pci.c,v 1.12 2015/03/06 13:44:18 riastradh Exp $   */
+/*     $NetBSD: drm_pci.c,v 1.13 2015/04/29 04:38:55 riastradh Exp $   */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_pci.c,v 1.12 2015/03/06 13:44:18 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_pci.c,v 1.13 2015/04/29 04:38:55 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/errno.h>
@@ -140,7 +140,7 @@
                        continue;
                }
 
-               /* Inquire about it.  We'll map it in drm_ioremap.  */
+               /* Inquire about it.  We'll map it in drm_core_ioremap.  */
                if (pci_mapreg_info(pa->pa_pc, pa->pa_tag, reg, type,
                        &bm->bm_base, &bm->bm_size, &bm->bm_flags) != 0) {
                        aprint_debug_dev(self, "map %u failed\n", unit);



Home | Main Index | Thread Index | Old Index