From owner-svn-src-stable@FreeBSD.ORG Wed Jul 24 21:53:34 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 059DE79E; Wed, 24 Jul 2013 21:53:34 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E72322E40; Wed, 24 Jul 2013 21:53:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6OLrXX9035517; Wed, 24 Jul 2013 21:53:33 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6OLrXdw035516; Wed, 24 Jul 2013 21:53:33 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201307242153.r6OLrXdw035516@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 24 Jul 2013 21:53:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r253621 - stable/9/sys/dev/syscons X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 21:53:34 -0000 Author: jkim Date: Wed Jul 24 21:53:33 2013 New Revision: 253621 URL: http://svnweb.freebsd.org/changeset/base/253621 Log: MFC: r253439 Reload font when syscons(4) is resuming without switching mode. Approved by: re (delphij) Modified: stable/9/sys/dev/syscons/syscons.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/syscons/syscons.c ============================================================================== --- stable/9/sys/dev/syscons/syscons.c Wed Jul 24 20:34:25 2013 (r253620) +++ stable/9/sys/dev/syscons/syscons.c Wed Jul 24 21:53:33 2013 (r253621) @@ -218,6 +218,7 @@ static int finish_vt_acq(scr_stat *scp); static void exchange_scr(sc_softc_t *sc); static void update_cursor_image(scr_stat *scp); static void change_cursor_shape(scr_stat *scp, int flags, int base, int height); +static void update_font(scr_stat *); static int save_kbd_state(scr_stat *scp); static int update_kbd_state(scr_stat *scp, int state, int mask); static int update_kbd_leds(scr_stat *scp, int which); @@ -3136,7 +3137,7 @@ scresume(__unused void *arg) suspend_in_progress = FALSE; if (sc_susp_scr < 0) { - mark_all(sc_console->sc->cur_scp); + update_font(sc_console->sc->cur_scp); return; } sc_switch_scr(sc_console->sc, sc_susp_scr); @@ -3641,6 +3642,37 @@ sctty_mmap(struct tty *tp, vm_ooffset_t return vidd_mmap(scp->sc->adp, offset, paddr, nprot, memattr); } +static void +update_font(scr_stat *scp) +{ +#ifndef SC_NO_FONT_LOADING + /* load appropriate font */ + if (!(scp->status & GRAPHICS_MODE)) { + if (!(scp->status & PIXEL_MODE) && ISFONTAVAIL(scp->sc->adp->va_flags)) { + if (scp->font_size < 14) { + if (scp->sc->fonts_loaded & FONT_8) + sc_load_font(scp, 0, 8, 8, scp->sc->font_8, 0, 256); + } else if (scp->font_size >= 16) { + if (scp->sc->fonts_loaded & FONT_16) + sc_load_font(scp, 0, 16, 8, scp->sc->font_16, 0, 256); + } else { + if (scp->sc->fonts_loaded & FONT_14) + sc_load_font(scp, 0, 14, 8, scp->sc->font_14, 0, 256); + } + /* + * FONT KLUDGE: + * This is an interim kludge to display correct font. + * Always use the font page #0 on the video plane 2. + * Somehow we cannot show the font in other font pages on + * some video cards... XXX + */ + sc_show_font(scp, 0); + } + mark_all(scp); + } +#endif /* !SC_NO_FONT_LOADING */ +} + static int save_kbd_state(scr_stat *scp) { @@ -3713,32 +3745,7 @@ set_mode(scr_stat *scp) (void *)scp->sc->adp->va_window, FALSE); #endif -#ifndef SC_NO_FONT_LOADING - /* load appropriate font */ - if (!(scp->status & GRAPHICS_MODE)) { - if (!(scp->status & PIXEL_MODE) && ISFONTAVAIL(scp->sc->adp->va_flags)) { - if (scp->font_size < 14) { - if (scp->sc->fonts_loaded & FONT_8) - sc_load_font(scp, 0, 8, 8, scp->sc->font_8, 0, 256); - } else if (scp->font_size >= 16) { - if (scp->sc->fonts_loaded & FONT_16) - sc_load_font(scp, 0, 16, 8, scp->sc->font_16, 0, 256); - } else { - if (scp->sc->fonts_loaded & FONT_14) - sc_load_font(scp, 0, 14, 8, scp->sc->font_14, 0, 256); - } - /* - * FONT KLUDGE: - * This is an interim kludge to display correct font. - * Always use the font page #0 on the video plane 2. - * Somehow we cannot show the font in other font pages on - * some video cards... XXX - */ - sc_show_font(scp, 0); - } - mark_all(scp); - } -#endif /* !SC_NO_FONT_LOADING */ + update_font(scp); sc_set_border(scp, scp->border); sc_set_cursor_image(scp);