From owner-svn-soc-all@FreeBSD.ORG Thu Aug 7 10:57:21 2014 Return-Path: Delivered-To: svn-soc-all@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 ESMTPS id 8F1F4109 for ; Thu, 7 Aug 2014 10:57:21 +0000 (UTC) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7BCEF2667 for ; Thu, 7 Aug 2014 10:57:21 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id s77AvLPA055156 for ; Thu, 7 Aug 2014 10:57:21 GMT (envelope-from seiya@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id s77AvKKB055150 for svn-soc-all@FreeBSD.org; Thu, 7 Aug 2014 10:57:20 GMT (envelope-from seiya@FreeBSD.org) Date: Thu, 7 Aug 2014 10:57:20 GMT Message-Id: <201408071057.s77AvKKB055150@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to seiya@FreeBSD.org using -f From: seiya@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r272023 - in soc2014/seiya/bootsplash/sys/dev: fb syscons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Aug 2014 10:57:21 -0000 Author: seiya Date: Thu Aug 7 10:57:20 2014 New Revision: 272023 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=272023 Log: exit gracefully (WIP) Modified: soc2014/seiya/bootsplash/sys/dev/fb/bsplash.c soc2014/seiya/bootsplash/sys/dev/fb/bsplash.h soc2014/seiya/bootsplash/sys/dev/syscons/syscons.c Modified: soc2014/seiya/bootsplash/sys/dev/fb/bsplash.c ============================================================================== --- soc2014/seiya/bootsplash/sys/dev/fb/bsplash.c Thu Aug 7 09:38:27 2014 (r272022) +++ soc2014/seiya/bootsplash/sys/dev/fb/bsplash.c Thu Aug 7 10:57:20 2014 (r272023) @@ -51,7 +51,9 @@ static int load_bmp(BMP_INFO *bmp, void* data); static int draw_bmp(BMP_INFO *bmp, int iy, int sy, int sx, int width, int height); -static video_adapter_t *adp = NULL; +static void *adp = NULL; +static void *sc = NULL; +static void (*bsplash_stop)(void *adp, void *sc) = NULL; static BMP_INFO bmp_info; static int in_prompt = 0; static int background_enabled = 1; // 1:enabled, 0:disabled @@ -64,12 +66,12 @@ static int progress_bar_y_origin, progress_bar_y, progress_bar_x; static int progress_bar_width, progress_bar_height; - -int -bsplash_early_init(video_adapter_t *_adp) +void +bsplash_early_init(void *_adp, void *_sc, void (*_bsplash_stop)(void *, void *)) { adp = _adp; - return 0; + sc = _sc; + bsplash_stop = _bsplash_stop; } static int @@ -252,7 +254,7 @@ /* * change video mode */ - if (vidd_set_mode(adp, M_VESA_CG1024x768) != 0) + if (vidd_set_mode((video_adapter_t *) adp, M_VESA_CG1024x768) != 0) return 1; /* @@ -266,7 +268,6 @@ if (kthread_add(update_animation, NULL, NULL, NULL, 0, 0, "bsplash") != 0){ printf("bsplash: failed to start kernel thread 'update_animation()'\n"); - vidd_set_mode(adp, M_TEXT_80x25); return 1; } @@ -315,7 +316,7 @@ if (progress >= 100 /* boot has finished */ || count > 50 /* FIX - -int bsplash_early_init (video_adapter_t *adp); +void bsplash_early_init (void *_adp, void *_sc, void (*bsplash_stop)(void *adp, void *sc)); int bsplash_prompt_user (const char *tag); int bsplash_prompt_success (const char *tag); int bsplash_prompt_failure (const char *tag); Modified: soc2014/seiya/bootsplash/sys/dev/syscons/syscons.c ============================================================================== --- soc2014/seiya/bootsplash/sys/dev/syscons/syscons.c Thu Aug 7 09:38:27 2014 (r272022) +++ soc2014/seiya/bootsplash/sys/dev/syscons/syscons.c Thu Aug 7 10:57:20 2014 (r272023) @@ -200,6 +200,10 @@ static int and_region(int *s1, int *e1, int s2, int e2); static void scrn_update(scr_stat *scp, int show_cursor); +#ifdef DEV_BSPLASH +static void scbsplash_stop(void *_adp, void *_sc); +#endif + #ifdef DEV_SPLASH static int scsplash_callback(int event, void *arg); static void scsplash_saver(sc_softc_t *sc, int show); @@ -2069,6 +2073,38 @@ SC_VIDEO_UNLOCK(scp->sc); } + +#ifdef DEV_BSPLASH + +static void +scbsplash_stop(void *_adp, void *_sc) +{ + video_adapter_t *adp; + sc_softc_t *sc; + scr_stat *scp; + + adp = (video_adapter_t *) _adp; + sc = (sc_softc_t *) _sc; + scp = sc->cur_scp; + + vidd_set_mode(adp, M_TEXT_80x25); + update_font(scp); + sc_set_border(scp, scp->border); + sc_set_cursor_image(scp); + +#ifndef SC_NO_PALETTE_LOADING +#ifdef SC_PIXEL_MODE + if (adp->va_info.vi_mem_model == V_INFO_MM_DIRECT) + vidd_load_palette(adp, sc->palette2); + else +#endif + vidd_load_palette(adp, sc->palette); +#endif +} + +#endif /* DEV_BSPLASH */ + + #ifdef DEV_SPLASH static int scsplash_callback(int event, void *arg) @@ -3031,7 +3067,7 @@ #ifdef DEV_BSPLASH - bsplash_early_init(sc->adp); + bsplash_early_init((void *) sc->adp, (void *) sc, scbsplash_stop); #endif }