[OpenBIOS] [commit] r1176 - in trunk/openbios-devel: forth/device include/libopenbios libopenbios packages
repository service
svn at openbios.org
Sat Jul 27 12:14:27 CEST 2013
Author: mcayland
Date: Sat Jul 27 12:14:26 2013
New Revision: 1176
URL: http://tracker.coreboot.org/trac/openbios/changeset/1176
Log:
video_common.c: move startup_splash() and refresh_palette() to packages/molvideo.c
These routines are MOL-specific and currently not required anywhere else.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>
Modified:
trunk/openbios-devel/forth/device/display.fs
trunk/openbios-devel/include/libopenbios/video.h
trunk/openbios-devel/libopenbios/video_common.c
trunk/openbios-devel/packages/molvideo.c
Modified: trunk/openbios-devel/forth/device/display.fs
==============================================================================
--- trunk/openbios-devel/forth/device/display.fs Sat Jul 27 12:14:22 2013 (r1175)
+++ trunk/openbios-devel/forth/device/display.fs Sat Jul 27 12:14:26 2013 (r1176)
@@ -375,4 +375,10 @@
0 to foreground-color
fb8-erase-screen
+
+ \ If we have a startup splash then display it
+ [IFDEF] CONFIG_MOL
+ startup-splash 2000 ms
+ fb8-erase-screen
+ [THEN]
;
Modified: trunk/openbios-devel/include/libopenbios/video.h
==============================================================================
--- trunk/openbios-devel/include/libopenbios/video.h Sat Jul 27 12:14:22 2013 (r1175)
+++ trunk/openbios-devel/include/libopenbios/video.h Sat Jul 27 12:14:26 2013 (r1176)
@@ -2,7 +2,6 @@
void init_video(unsigned long fb, int width, int height, int depth, int rb);
unsigned long get_color(int col_ind);
void set_color(int ind, unsigned long color);
-void refresh_palette(void);
int video_get_res(int *w, int *h);
void draw_pixel(int x, int y, int colind);
void video_scroll(int height);
Modified: trunk/openbios-devel/libopenbios/video_common.c
==============================================================================
--- trunk/openbios-devel/libopenbios/video_common.c Sat Jul 27 12:14:22 2013 (r1175)
+++ trunk/openbios-devel/libopenbios/video_common.c Sat Jul 27 12:14:26 2013 (r1176)
@@ -67,61 +67,6 @@
#endif
}
-static void
-startup_splash( void )
-{
-#ifdef CONFIG_MOL
- int fd, s, i, y, x, dx, dy;
- int width, height;
- char *pp, *p;
- char buf[64];
-#endif
-
- /* only draw logo in 24-bit mode (for now) */
- if( video.fb.depth < 15 )
- return;
-#ifdef CONFIG_MOL
- for( i=0; i<2; i++ ) {
- if( !BootHGetStrResInd("bootlogo", buf, sizeof(buf), 0, i) )
- return;
- *(!i ? &width : &height) = atol(buf);
- }
-
- if( (s=width * height * 3) > 0x20000 )
- return;
-
- if( (fd=open_io("pseudo:,bootlogo")) >= 0 ) {
- p = malloc( s );
- if( read_io(fd, p, s) != s )
- printk("bootlogo size error\n");
- close_io( fd );
-
- dx = (video.fb.w - width)/2;
- dy = (video.fb.h - height)/3;
-
- pp = (char*)video.fb.mvirt + dy * video.fb.rb + dx * (video.fb.depth >= 24 ? 4 : 2);
-
- for( y=0 ; y<height; y++, pp += video.fb.rb ) {
- if( video.fb.depth >= 24 ) {
- unsigned long *d = (unsigned long*)pp;
- for( x=0; x<width; x++, p+=3, d++ )
- *d = ((int)p[0] << 16) | ((int)p[1] << 8) | p[2];
- } else if( video.fb.depth == 15 ) {
- unsigned short *d = (unsigned short*)pp;
- for( x=0; x<width; x++, p+=3, d++ ) {
- int col = ((int)p[0] << 16) | ((int)p[1] << 8) | p[2];
- *d = ((col>>9) & 0x7c00) | ((col>>6) & 0x03e0) | ((col>>3) & 0x1f);
- }
- }
- }
- free( p );
- }
-#else
- /* No bootlogo support yet on other platforms */
- return;
-#endif
-}
-
int
video_get_res( int *w, int *h )
{
@@ -310,15 +255,6 @@
}
}
-void
-refresh_palette( void )
-{
-#ifdef CONFIG_MOL
- if( video.fb.depth == 8 )
- OSI_RefreshPalette();
-#endif
-}
-
/* ( color_ind x y width height -- ) (?) */
void
video_fill_rect(void)
@@ -412,7 +348,4 @@
set_color( i, i * 0x010101 );
set_color( 254, 0xffffcc );
-
- refresh_palette();
- startup_splash();
}
Modified: trunk/openbios-devel/packages/molvideo.c
==============================================================================
--- trunk/openbios-devel/packages/molvideo.c Sat Jul 27 12:14:22 2013 (r1175)
+++ trunk/openbios-devel/packages/molvideo.c Sat Jul 27 12:14:26 2013 (r1176)
@@ -31,6 +31,15 @@
DECLARE_NODE( video, 0, 0, "Tdisplay" );
+static void
+molvideo_refresh_palette( void )
+{
+#ifdef CONFIG_MOL
+ if( video.fb.depth == 8 )
+ OSI_RefreshPalette();
+#endif
+}
+
/* ( -- width height ) (?) */
static void
molvideo_dimensions( void )
@@ -54,7 +63,7 @@
unsigned long col = (p[0] << 16) | (p[1] << 8) | p[2];
set_color( i + start, col );
}
- refresh_palette();
+ molvideo_refresh_palette();
}
/* ( r g b index -- ) */
@@ -68,7 +77,7 @@
unsigned long col = ((r << 16) & 0xff0000) | ((g << 8) & 0x00ff00) | (b & 0xff);
/* printk("color!: %08lx %08lx %08lx %08lx\n", r, g, b, index ); */
set_color( index, col );
- refresh_palette();
+ molvideo_refresh_palette();
}
/* ( color_ind x y width height -- ) (?) */
@@ -78,11 +87,69 @@
video_fill_rect();
}
+/* ( -- ) - really should be reworked as draw-logo */
+static void
+molvideo_startup_splash( void )
+{
+#ifdef CONFIG_MOL
+ int fd, s, i, y, x, dx, dy;
+ int width, height;
+ char *pp, *p;
+ char buf[64];
+#endif
+
+ /* only draw logo in 24-bit mode (for now) */
+ if( video.fb.depth < 15 )
+ return;
+#ifdef CONFIG_MOL
+ for( i=0; i<2; i++ ) {
+ if( !BootHGetStrResInd("bootlogo", buf, sizeof(buf), 0, i) )
+ return;
+ *(!i ? &width : &height) = atol(buf);
+ }
+
+ if( (s=width * height * 3) > 0x20000 )
+ return;
+
+ if( (fd=open_io("pseudo:,bootlogo")) >= 0 ) {
+ p = malloc( s );
+ if( read_io(fd, p, s) != s )
+ printk("bootlogo size error\n");
+ close_io( fd );
+
+ dx = (video.fb.w - width)/2;
+ dy = (video.fb.h - height)/3;
+
+ pp = (char*)video.fb.mvirt + dy * video.fb.rb + dx * (video.fb.depth >= 24 ? 4 : 2);
+
+ for( y=0 ; y<height; y++, pp += video.fb.rb ) {
+ if( video.fb.depth >= 24 ) {
+ unsigned long *d = (unsigned long*)pp;
+ for( x=0; x<width; x++, p+=3, d++ )
+ *d = ((int)p[0] << 16) | ((int)p[1] << 8) | p[2];
+ } else if( video.fb.depth == 15 ) {
+ unsigned short *d = (unsigned short*)pp;
+ for( x=0; x<width; x++, p+=3, d++ ) {
+ int col = ((int)p[0] << 16) | ((int)p[1] << 8) | p[2];
+ *d = ((col>>9) & 0x7c00) | ((col>>6) & 0x03e0) | ((col>>3) & 0x1f);
+ }
+ }
+ }
+ free( p );
+ }
+#else
+ /* No bootlogo support yet on other platforms */
+ return;
+#endif
+}
+
+
NODE_METHODS( video ) = {
{"dimensions", molvideo_dimensions },
{"set-colors", molvideo_set_colors },
{"fill-rectangle", molvideo_fill_rect },
{"color!", molvideo_color_bang },
+ {"startup-splash", molvideo_startup_splash },
};
More information about the OpenBIOS
mailing list