From d7fd667c034dcb1e4a31efc67d4e5bc71e5593e8 Mon Sep 17 00:00:00 2001 From: jmcneill Date: Sun, 13 Aug 2006 20:24:51 +0000 Subject: Provide a method for other display drivers to ask vga to free resources it had claimed while acting as the initial console device. This allows (for example) vga to be the initial console, and an accelerated framebuffer driver to take over later. --- sys/dev/ic/vga.c | 23 +++++++++++++++++++++-- sys/dev/ic/vgavar.h | 3 ++- 2 files changed, 23 insertions(+), 3 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/ic/vga.c b/sys/dev/ic/vga.c index d1bdf32cfd7..df09cc7af1f 100644 --- a/sys/dev/ic/vga.c +++ b/sys/dev/ic/vga.c @@ -1,4 +1,4 @@ -/* $NetBSD: vga.c,v 1.87 2006/04/15 17:48:23 jmmv Exp $ */ +/* $NetBSD: vga.c,v 1.88 2006/08/13 20:24:51 jmcneill Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -35,7 +35,7 @@ #include "opt_wsmsgattrs.h" #include -__KERNEL_RCSID(0, "$NetBSD: vga.c,v 1.87 2006/04/15 17:48:23 jmmv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vga.c,v 1.88 2006/08/13 20:24:51 jmcneill Exp $"); #include #include @@ -703,6 +703,25 @@ vga_cnattach(bus_space_tag_t iot, bus_space_tag_t memt, int type, int check) return (0); } +int +vga_cndetach(void) +{ + struct vga_config *vc; + struct vga_handle *vh; + + vc = &vga_console_vc; + vh = &vc->hdl; + + if (vgaconsole) { + bus_space_unmap(vh->vh_iot, vh->vh_ioh_vga, 0x10); + bus_space_unmap(vh->vh_iot, vh->vh_ioh_6845, 0x10); + + return 1; + } + + return 0; +} + int vga_is_console(bus_space_tag_t iot, int type) { diff --git a/sys/dev/ic/vgavar.h b/sys/dev/ic/vgavar.h index af71cdbb439..21566ab78bd 100644 --- a/sys/dev/ic/vgavar.h +++ b/sys/dev/ic/vgavar.h @@ -1,4 +1,4 @@ -/* $NetBSD: vgavar.h,v 1.24 2006/02/16 20:17:16 perry Exp $ */ +/* $NetBSD: vgavar.h,v 1.25 2006/08/13 20:24:51 jmcneill Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -190,6 +190,7 @@ void vga_common_attach(struct vga_softc *, bus_space_tag_t, int vga_is_console(bus_space_tag_t, int); int vga_cnattach(bus_space_tag_t, bus_space_tag_t, int, int); +int vga_cndetach(void); #ifndef VGA_RASTERCONSOLE struct wsscreen_descr; -- cgit