From 852bc5b43804d7af203df9434ca1acdcd445a0eb Mon Sep 17 00:00:00 2001 From: macallan Date: Tue, 14 Sep 2010 18:43:41 +0000 Subject: leave the screen description alone when we're not the console in order to avoid a NULL deref later on ( which only happens on sparc64 for some reason ) While there, use VCONS_DONT_READ --- sys/dev/sun/cgthree.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/sun/cgthree.c b/sys/dev/sun/cgthree.c index 9abfb387953..1b955f6a23a 100644 --- a/sys/dev/sun/cgthree.c +++ b/sys/dev/sun/cgthree.c @@ -1,4 +1,4 @@ -/* $NetBSD: cgthree.c,v 1.26 2009/11/25 21:10:56 macallan Exp $ */ +/* $NetBSD: cgthree.c,v 1.27 2010/09/14 18:43:41 macallan Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cgthree.c,v 1.26 2009/11/25 21:10:56 macallan Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cgthree.c,v 1.27 2010/09/14 18:43:41 macallan Exp $"); #include #include @@ -234,20 +234,6 @@ cgthreeattach(struct cgthree_softc *sc, const char *name, int isconsole) * we're not the console so we just clear the screen and don't * set up any sort of text display */ - if (cgthree_defaultscreen.textops == NULL) { - /* - * ugly, but... - * we want the console settings to win, so we only - * touch anything when we find an untouched screen - * definition. In this case we fill it from fb to - * avoid problems in case no cgthree is the console - */ - ri = &sc->sc_fb.fb_rinfo; - cgthree_defaultscreen.textops = &ri->ri_ops; - cgthree_defaultscreen.capabilities = ri->ri_caps; - cgthree_defaultscreen.nrows = ri->ri_rows; - cgthree_defaultscreen.ncols = ri->ri_cols; - } } /* Initialize the default color map. */ @@ -558,6 +544,8 @@ cgthree_init_screen(void *cookie, struct vcons_screen *scr, struct cgthree_softc *sc = cookie; struct rasops_info *ri = &scr->scr_ri; + scr->scr_flags |= VCONS_DONT_READ; + ri->ri_depth = 8; ri->ri_width = sc->sc_width; ri->ri_height = sc->sc_height; -- cgit