From 7075548498e054dbbb90f7bda1eb18e6e2473c50 Mon Sep 17 00:00:00 2001 From: jmcneill Date: Tue, 17 Feb 2009 02:21:13 +0000 Subject: [PATCH] Set clear-screen and cursor-row so the transition from the early console driver and genfb is seamless. While we're here, clear the screen when we first attach in case the bootloader scribbled on it. --- sys/arch/x86/x86/genfb_machdep.c | 8 ++++---- sys/arch/x86/x86/x86_autoconf.c | 9 +++++++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/sys/arch/x86/x86/genfb_machdep.c b/sys/arch/x86/x86/genfb_machdep.c index ce7edbf9f750..c797074b1215 100644 --- a/sys/arch/x86/x86/genfb_machdep.c +++ b/sys/arch/x86/x86/genfb_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: genfb_machdep.c,v 1.1 2009/02/17 01:42:52 jmcneill Exp $ */ +/* $NetBSD: genfb_machdep.c,v 1.2 2009/02/17 02:21:13 jmcneill Exp $ */ /*- * Copyright (c) 2009 Jared D. McNeill @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: genfb_machdep.c,v 1.1 2009/02/17 01:42:52 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: genfb_machdep.c,v 1.2 2009/02/17 02:21:13 jmcneill Exp $"); #include #include @@ -54,7 +54,7 @@ __KERNEL_RCSID(0, "$NetBSD: genfb_machdep.c,v 1.1 2009/02/17 01:42:52 jmcneill E #include "genfb.h" #if NWSDISPLAY > 0 && NGENFB > 0 -static struct vcons_screen x86_genfb_console_screen; +struct vcons_screen x86_genfb_console_screen; static struct wsscreen_descr x86_genfb_stdscreen = { "std", @@ -111,7 +111,7 @@ x86_genfb_cnattach(void) ri->ri_depth = fbinfo->depth; ri->ri_stride = fbinfo->stride; ri->ri_bits = bits; - ri->ri_flg = RI_CENTER | RI_FULLCLEAR; + ri->ri_flg = RI_CENTER | RI_FULLCLEAR | RI_CLEAR; rasops_init(ri, ri->ri_width / 8, ri->ri_height / 8); ri->ri_caps = WSSCREEN_WSCOLORS; rasops_reconfig(ri, ri->ri_height / ri->ri_font->fontheight, diff --git a/sys/arch/x86/x86/x86_autoconf.c b/sys/arch/x86/x86/x86_autoconf.c index cf8a4f7bcfa2..e68d272096da 100644 --- a/sys/arch/x86/x86/x86_autoconf.c +++ b/sys/arch/x86/x86/x86_autoconf.c @@ -1,4 +1,4 @@ -/* $NetBSD: x86_autoconf.c,v 1.36 2009/02/16 22:29:33 jmcneill Exp $ */ +/* $NetBSD: x86_autoconf.c,v 1.37 2009/02/17 02:21:13 jmcneill Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: x86_autoconf.c,v 1.36 2009/02/16 22:29:33 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: x86_autoconf.c,v 1.37 2009/02/17 02:21:13 jmcneill Exp $"); #include #include @@ -557,6 +557,8 @@ device_register(struct device *dev, void *aux) prop_dictionary_t dict; if (PCI_CLASS(pa->pa_class) == PCI_CLASS_DISPLAY) { + extern struct vcons_screen x86_genfb_console_screen; + fbinfo = lookup_bootinfo(BTINFO_FRAMEBUFFER); if (fbinfo == NULL || fbinfo->physaddr == 0) return; @@ -572,6 +574,9 @@ device_register(struct device *dev, void *aux) prop_dictionary_set_uint16(dict, "linebytes", fbinfo->stride); prop_dictionary_set_bool(dict, "is_console", true); + prop_dictionary_set_bool(dict, "clear-screen", false); + prop_dictionary_set_uint16(dict, "cursor-row", + x86_genfb_console_screen.scr_ri.ri_crow); #if notyet prop_dictionary_set_bool(dict, "splash", fbinfo->flags & BI_FB_SPLASH ? true : false);