diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2007-12-14 16:03:11 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2007-12-14 16:03:11 +0000 |
commit | 3d04553eec63c66e4df973d4c1d1f1ad8c33cb72 (patch) | |
tree | d3e56daf50b2be7729d2faf7e8851bf5ee125d28 /sys/arch/sgi | |
parent | aece76e54b2bde934f75a464b298adb78e1a53f5 (diff) |
Have gbe(4) attach as the console if the graphical console is selected via
ARCBIOS. Tested by jasper@.
ok miod@
Diffstat (limited to 'sys/arch/sgi')
-rw-r--r-- | sys/arch/sgi/dev/gbe.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/sys/arch/sgi/dev/gbe.c b/sys/arch/sgi/dev/gbe.c index d73f960abe4..c55304e4c7a 100644 --- a/sys/arch/sgi/dev/gbe.c +++ b/sys/arch/sgi/dev/gbe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gbe.c,v 1.2 2007/11/27 16:08:06 jasper Exp $ */ +/* $OpenBSD: gbe.c,v 1.3 2007/12/14 16:03:10 jsing Exp $ */ /* * Copyright (c) 2007, Joel Sing <jsing@openbsd.org> @@ -141,17 +141,15 @@ gbe_attach(struct device *parent, struct device *self, void *aux) struct wsemuldisplaydev_attach_args waa; uint16_t *tm; uint32_t val; + long attr; int i; -#ifdef notyet - char *cp; -#endif printf(": "); /* GBE isn't strictly on the crimebus, but use this for now... */ gsc->iot = &crimebus_tag; gsc->dmat = &mace_bus_dma_tag; - gsc->console = 0; /* XXX for now! */ + gsc->console = 0; gsc->screens = 0; /* @@ -318,7 +316,7 @@ gbe_attach(struct device *parent, struct device *self, void *aux) printf("timeout disabling dot clock!\n"); /* Reset DMA fifo. */ - val = bus_space_read_4(gsc->iot, gsc->ioh, GBE_FB_SIZE_TILE); + val = bus_space_read_4(gsc->iot, gsc->ioh, GBE_FB_SIZE_TILE); val &= ~(1 << GBE_FB_SIZE_TILE_FIFO_RESET_SHIFT); bus_space_write_4(gsc->iot, gsc->ioh, GBE_FB_SIZE_TILE, val | (1 << GBE_FB_SIZE_TILE_FIFO_RESET_SHIFT)); @@ -376,14 +374,6 @@ gbe_attach(struct device *parent, struct device *self, void *aux) printf("rev %u, %iMB, %dx%d at %d bits\n", gsc->rev, gsc->fb_size >> 20, gsc->width, gsc->height, gsc->depth); -#ifdef notyet - cp = Bios_GetEnvironmentVariable("ConsoleOut"); - if (cp != NULL && strncmp(cp, "video", 5) == 0) { - wsdisplay_cnattach(&gbe_stdscreen, &gsc->ri, 0, 0, /*defattr*/ 0); - gsc->console = 1; - } -#endif - /* * Setup default screen and attach wsdisplay. */ @@ -395,6 +385,13 @@ gbe_attach(struct device *parent, struct device *self, void *aux) gbe_stdscreen.fontheight = gsc->ri.ri_font->fontheight; gbe_stdscreen.capabilities = gsc->ri.ri_caps; + /* Attach as console if necessary. */ + if (strncmp(bios_console, "video", 5) == 0) { + gsc->ri.ri_ops.alloc_attr(&gsc->ri, 0, 0, 0, &attr); + wsdisplay_cnattach(&gbe_stdscreen, &gsc->ri, 0, 0, attr); + gsc->console = 1; + } + waa.console = gsc->console; waa.scrdata = &gbe_screenlist; waa.accessops = &gbe_accessops; |