diff options
-rw-r--r-- | sys/dev/ic/vga.c | 8 | ||||
-rw-r--r-- | sys/dev/pci/vga_pci.c | 9 | ||||
-rw-r--r-- | sys/dev/pci/vga_pcivar.h | 4 |
3 files changed, 13 insertions, 8 deletions
diff --git a/sys/dev/ic/vga.c b/sys/dev/ic/vga.c index ce40fc657c4..eefaf51ed4a 100644 --- a/sys/dev/ic/vga.c +++ b/sys/dev/ic/vga.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vga.c,v 1.55 2011/04/03 15:46:30 miod Exp $ */ +/* $OpenBSD: vga.c,v 1.56 2013/03/18 10:12:40 kettenis Exp $ */ /* $NetBSD: vga.c,v 1.28.2.1 2000/06/30 16:27:47 simonb Exp $ */ /*- @@ -524,10 +524,14 @@ vga_extended_attach(struct device *self, bus_space_tag_t iot, struct wsemuldisplaydev_attach_args aa; console = vga_is_console(iot, type); + if (console) + vga_console_attached = 1; + + if (type == -1) + return NULL; if (console) { vc = &vga_console_vc; - vga_console_attached = 1; } else { vc = malloc(sizeof(*vc), M_DEVBUF, M_NOWAIT | M_ZERO); if (vc == NULL) diff --git a/sys/dev/pci/vga_pci.c b/sys/dev/pci/vga_pci.c index 2989798a77f..e4fcbf46966 100644 --- a/sys/dev/pci/vga_pci.c +++ b/sys/dev/pci/vga_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vga_pci.c,v 1.70 2013/03/04 21:52:36 kettenis Exp $ */ +/* $OpenBSD: vga_pci.c,v 1.71 2013/03/18 10:12:40 kettenis Exp $ */ /* $NetBSD: vga_pci.c,v 1.3 1998/06/08 06:55:58 thorpej Exp $ */ /* @@ -227,7 +227,6 @@ vga_pci_attach(struct device *parent, struct device *self, void *aux) struct pci_attach_args *pa = aux; pcireg_t reg; struct vga_pci_softc *sc = (struct vga_pci_softc *)self; - #if !defined(SMALL_KERNEL) && NACPI > 0 int prod, vend, subid, subprod, subvend, i; #endif @@ -239,12 +238,14 @@ vga_pci_attach(struct device *parent, struct device *self, void *aux) reg |= PCI_COMMAND_MASTER_ENABLE; pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, reg); + sc->sc_type = WSDISPLAY_TYPE_PCIVGA; + #ifdef VESAFB if (vesabios_softc != NULL && vesabios_softc->sc_nmodes > 0) { sc->sc_textmode = vesafb_get_mode(sc); printf(", vesafb\n"); sc->sc_vc = vga_extended_attach(self, pa->pa_iot, pa->pa_memt, - WSDISPLAY_TYPE_PCIVGA, vga_pci_mmap); + sc->sc_type, vga_pci_mmap); return; } #endif @@ -294,7 +295,7 @@ vga_pci_attach(struct device *parent, struct device *self, void *aux) #endif sc->sc_vc = vga_common_attach(self, pa->pa_iot, pa->pa_memt, - WSDISPLAY_TYPE_PCIVGA); + sc->sc_type); } int diff --git a/sys/dev/pci/vga_pcivar.h b/sys/dev/pci/vga_pcivar.h index defbc7a1ddb..ed3ec62b7b0 100644 --- a/sys/dev/pci/vga_pcivar.h +++ b/sys/dev/pci/vga_pcivar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vga_pcivar.h,v 1.15 2012/08/22 20:58:30 mpi Exp $ */ +/* $OpenBSD: vga_pcivar.h,v 1.16 2013/03/18 10:12:40 kettenis Exp $ */ /* $NetBSD: vga_pcivar.h,v 1.1 1998/03/22 15:16:19 drochner Exp $ */ /* @@ -55,6 +55,7 @@ struct vga_pci_bar { struct vga_pci_softc { struct device sc_dev; struct vga_config *sc_vc; + int sc_type; struct pci_attach_args pa; struct vga_pci_bar *bars[VGA_PCI_MAX_BARS]; @@ -79,7 +80,6 @@ struct vga_pci_softc { u_char sc_cmap_red[256]; /* saved color map */ u_char sc_cmap_green[256]; u_char sc_cmap_blue[256]; - #endif }; |