Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/wscons delete virtual screens on detach - this allow...



details:   https://anonhg.NetBSD.org/src/rev/3410a0e03d6d
branches:  trunk
changeset: 773444:3410a0e03d6d
user:      drochner <drochner%NetBSD.org@localhost>
date:      Thu Feb 02 13:11:25 2012 +0000

description:
delete virtual screens on detach - this allows to hot-unplug
a udl@usb monitor without crash

diffstat:

 sys/dev/wscons/wsdisplay.c |  13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r 01ce9229a60b -r 3410a0e03d6d sys/dev/wscons/wsdisplay.c
--- a/sys/dev/wscons/wsdisplay.c        Thu Feb 02 13:07:33 2012 +0000
+++ b/sys/dev/wscons/wsdisplay.c        Thu Feb 02 13:11:25 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wsdisplay.c,v 1.134 2011/04/24 16:27:01 rmind Exp $ */
+/* $NetBSD: wsdisplay.c,v 1.135 2012/02/02 13:11:25 drochner Exp $ */
 
 /*
  * Copyright (c) 1996, 1997 Christopher G. Demetriou.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.134 2011/04/24 16:27:01 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.135 2012/02/02 13:11:25 drochner Exp $");
 
 #include "opt_wsdisplay_compat.h"
 #include "opt_wsmsgattrs.h"
@@ -592,6 +592,15 @@
 wsdisplay_emul_detach(device_t dev, int how)
 {
        struct wsdisplay_softc *sc = device_private(dev);
+       int flag, i, res;
+
+       flag = (how & DETACH_FORCE ? WSDISPLAY_DELSCR_FORCE : 0);
+       for (i = 0; i < WSDISPLAY_MAXSCREEN; i++)
+               if (sc->sc_scr[i]) {
+                       res = wsdisplay_delscreen(sc, i, flag);
+                       if (res)
+                               return res;
+               }
 
        cv_destroy(&sc->sc_flagscv);
        mutex_destroy(&sc->sc_flagsmtx);



Home | Main Index | Thread Index | Old Index