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.
This commit is contained in:
jmcneill 2006-08-13 20:24:51 +00:00
parent ac96fed0c2
commit d7fd667c03
2 changed files with 23 additions and 3 deletions

View File

@ -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 <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/systm.h>
@ -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)
{

View File

@ -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;