Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/riastradh-drm2]: src/sys/external/bsd/drm2/drm Fill in drm_detach some m...



details:   https://anonhg.NetBSD.org/src/rev/de6b23199f5b
branches:  riastradh-drm2
changeset: 788465:de6b23199f5b
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Jul 24 03:56:03 2013 +0000

description:
Fill in drm_detach some more.

diffstat:

 sys/external/bsd/drm2/drm/drm_drv.c |  21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)

diffs (49 lines):

diff -r 2bd299828eb6 -r de6b23199f5b sys/external/bsd/drm2/drm/drm_drv.c
--- a/sys/external/bsd/drm2/drm/drm_drv.c       Wed Jul 24 03:55:48 2013 +0000
+++ b/sys/external/bsd/drm2/drm/drm_drv.c       Wed Jul 24 03:56:03 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drm_drv.c,v 1.1.2.15 2013/07/24 03:55:17 riastradh Exp $       */
+/*     $NetBSD: drm_drv.c,v 1.1.2.16 2013/07/24 03:56:03 riastradh Exp $       */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_drv.c,v 1.1.2.15 2013/07/24 03:55:17 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_drv.c,v 1.1.2.16 2013/07/24 03:56:03 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -287,6 +287,10 @@
         */
        error = drm_fill_in_dev(dev, NULL, dev->driver);
        if (error) {
+               /*
+                * XXX This leaves the driver in a state such that
+                * detaching it will fail horribly.  Please fix!
+                */
                aprint_error_dev(parent, "unable to initialize drm: %d\n",
                    error);
                return;
@@ -332,6 +336,19 @@
                DRM_DEBUG("mtrr_del=%d\n", error);
        }
 
+       /* XXX The placement of this is pretty random...  */
+       if (dev->driver->unload != NULL)
+               (*dev->driver->unload)(dev);
+
+       /* XXX Move into dev->driver->bus->agp_destroy.  */
+       if (drm_core_has_AGP(dev) && (dev->agp != NULL)) {
+               kfree(dev->agp);
+               dev->agp = NULL;
+       }
+
+       /* XXX Remove the entries in this.  */
+       drm_ht_remove(&dev->map_hash);
+
        linux_mutex_destroy(&dev->ctxlist_mutex);
        linux_mutex_destroy(&dev->struct_mutex);
        spin_lock_destroy(&dev->event_lock);



Home | Main Index | Thread Index | Old Index