Port-sparc64 archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
NetBSD/sparc64 SPLASHSCREEN support
Dear sparc64 users,
Here is a patch that enables the SPLASHSCREEN option for ffb-based
framebuffers. I did not hack long on it, and it still has a few
problems, for which I'd gladly appreciate hints:
- the colours are not good: with the default NetBSD logo, the background
is #00ffff and the flag is a dirty orange; I suspect an endian issue.
- the text is still printing and scrolling.
- I don't see the progress bar being refreshed.
At a time where there are problems with the kernel size, this is
definitely not going to help :) For that matter, I usually gzip my
kernels and -current is working atm.
Have fun!
Index: arch/sparc64/conf/GENERIC
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc64/conf/GENERIC,v
retrieving revision 1.100
diff -p -u -r1.100 GENERIC
--- arch/sparc64/conf/GENERIC 30 May 2008 20:10:03 -0000 1.100
+++ arch/sparc64/conf/GENERIC 26 Jun 2008 22:19:39 -0000
@@ -875,6 +875,8 @@ options WSDISPLAY_COMPAT_USL # VT hand
options WSDISPLAY_COMPAT_RAWKBD # can get raw scancodes
options WSDISPLAY_DEFAULTSCREENS=4
options FONT_GALLANT12x22 # PROM font look-alike
+options SPLASHSCREEN
+options SPLASHSCREEN_PROGRESS
#### Other device configuration
Index: arch/sparc64/conf/files.sparc64
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc64/conf/files.sparc64,v
retrieving revision 1.118
diff -p -u -r1.118 files.sparc64
--- arch/sparc64/conf/files.sparc64 20 Feb 2008 21:43:35 -0000 1.118
+++ arch/sparc64/conf/files.sparc64 26 Jun 2008 22:19:39 -0000
@@ -143,7 +143,7 @@ device cgfourteen
attach cgfourteen at sbus
file arch/sparc64/dev/cgfourteen.c cgfourteen needs-flag
-device ffb: wsemuldisplaydev, rasops8, rasops16, rasops24, rasops32, fb, vcons
+device ffb: wsemuldisplaydev, rasops8, rasops16, rasops24, rasops32, fb,
vcons, splash
file arch/sparc64/dev/ffb.c ffb
attach ffb at mainbus with ffb_mainbus
Index: arch/sparc64/dev/ffb.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc64/dev/ffb.c,v
retrieving revision 1.34
diff -p -u -r1.34 ffb.c
--- arch/sparc64/dev/ffb.c 13 Jun 2008 13:10:49 -0000 1.34
+++ arch/sparc64/dev/ffb.c 26 Jun 2008 22:19:39 -0000
@@ -65,6 +65,10 @@ __KERNEL_RCSID(0, "$NetBSD: ffb.c,v 1.34
#define WS_DEFAULT_BG 0xf
#endif
+#include <sys/reboot.h>
+#define DISABLESPLASH (boothowto & (RB_SINGLE | RB_USERCONF | RB_ASKNAME | \
+ AB_VERBOSE | AB_DEBUG) )
+
extern struct cfdriver ffb_cd;
struct wsscreen_descr ffb_stdscreen = {
@@ -242,8 +246,36 @@ ffb_attach(struct ffb_softc *sc)
if (sc->sc_console) {
wsdisplay_cnattach(&ffb_stdscreen, ri, 0, 0, defattr);
}
+#ifdef SPLASHSCREEN
+/*
+ * If system isn't going to go multiuser, or user has requested to see
+ * boot text, don't render splash screen immediately
+ */
+ if (DISABLESPLASH)
+#endif
+ ffb_clearscreen(sc);
- ffb_clearscreen(sc);
+#ifdef SPLASHSCREEN
+ sc->sc_si.si_depth = ri->ri_depth;
+ sc->sc_si.si_bits = ri->ri_bits;
+ sc->sc_si.si_hwbits = ri->ri_hwbits;
+ sc->sc_si.si_width = ri->ri_width;
+ sc->sc_si.si_height = ri->ri_height;
+ sc->sc_si.si_stride = ri->ri_stride;
+ sc->sc_si.si_fillrect = NULL;
+ if (!DISABLESPLASH)
+ splash_render(&sc->sc_si, SPLASH_F_CENTER|SPLASH_F_FILL);
+#endif
+
+#ifdef SPLASHSCREEN_PROGRESS
+ sc->sc_sp.sp_top = (ri->ri_height / 8) * 7;
+ sc->sc_sp.sp_width = (ri->ri_width / 4) * 3;
+ sc->sc_sp.sp_left = (ri->ri_width - sc->sc_sp.sp_width / 2);
+ sc->sc_sp.sp_height = 20;
+ sc->sc_sp.sp_state = -1;
+ sc->sc_sp.sp_si = &sc->sc_si;
+ splash_progress_init(&sc->sc_sp);
+#endif
waa.console = sc->sc_console;
waa.scrdata = &ffb_screenlist;
@@ -323,6 +355,26 @@ ffb_ioctl(void *v, void *vs, u_long cmd,
}
}
break;
+ case WSDISPLAYIO_SSPLASH:
+#if defined(SPLASHSCREEN)
+ if (*(int *)data == 1) {
+ SCREEN_DISABLE_DRAWING(&ffb_console_screen);
+ splash_render(&sc->sc_si,
SPLASH_F_CENTER|SPLASH_F_FILL);
+ } else
+ SCREEN_ENABLE_DRAWING(&ffb_console_screen);
+ return 0;
+#else
+ return ENODEV;
+#endif
+ case WSDISPLAYIO_SPROGRESS:
+#if defined(SPLASHSCREEN) && defined(SPLASHSCREEN_PROGRESS)
+ sc->sc_sp.sp_force = 1;
+ splash_progress_update(&sc->sc_sp);
+ sc->sc_sp.sp_force = 0;
+ return 0;
+#else
+ return ENODEV;
+#endif
case WSDISPLAYIO_GINFO:
wdf = (void *)data;
wdf->height = sc->sc_height;
Index: arch/sparc64/dev/ffbvar.h
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc64/dev/ffbvar.h,v
retrieving revision 1.8
diff -p -u -r1.8 ffbvar.h
--- arch/sparc64/dev/ffbvar.h 14 Sep 2006 16:05:18 -0000 1.8
+++ arch/sparc64/dev/ffbvar.h 26 Jun 2008 22:19:39 -0000
@@ -33,8 +33,16 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include "opt_splash.h"
+
#include <dev/wscons/wsdisplay_vconsvar.h>
+#ifdef SPLASHSCREEN
+#include <dev/splash/splash.h>
+/* XXX */
+extern const char _splash_header_data_cmap[64+32][3];
+#endif
+
#define FFB_CREATOR 0
#define FFB_AFB 1
@@ -63,6 +71,13 @@ struct ffb_softc {
/* virtual console stuff */
void (*putchar)(void *c, int row, int col, u_int uc, long attr);
struct vcons_data vd;
+
+#ifdef SPLASHSCREEN
+ struct splash_info sc_si;
+#endif
+#ifdef SPLASHSCREEN_PROGRESS
+ struct splash_progress sc_sp;
+#endif
};
#define DAC_WRITE(sc,r,v) \
Index: dev/splash/splash.c
===================================================================
RCS file: /cvsroot/src/sys/dev/splash/splash.c,v
retrieving revision 1.6
diff -p -u -r1.6 splash.c
--- dev/splash/splash.c 10 May 2008 15:31:05 -0000 1.6
+++ dev/splash/splash.c 26 Jun 2008 22:19:47 -0000
@@ -46,6 +46,7 @@ __KERNEL_RCSID(0, "$NetBSD: splash.c,v 1
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/types.h>
+#include <sys/device.h>
#include <sys/kernel.h>
#include <sys/kthread.h>
Index: kern/subr_autoconf.c
===================================================================
RCS file: /cvsroot/src/sys/kern/subr_autoconf.c,v
retrieving revision 1.156
diff -p -u -r1.156 subr_autoconf.c
--- kern/subr_autoconf.c 11 Jun 2008 15:56:11 -0000 1.156
+++ kern/subr_autoconf.c 26 Jun 2008 22:19:48 -0000
@@ -117,7 +117,7 @@ __KERNEL_RCSID(0, "$NetBSD: subr_autocon
#include <sys/userconf.h>
#endif
-#ifdef __i386__
+#if defined(__i386__) || defined(__sparc64__)
#include "opt_splash.h"
#if defined(SPLASHSCREEN) && defined(SPLASHSCREEN_PROGRESS)
#include <dev/splash/splash.h>
Home |
Main Index |
Thread Index |
Old Index