From: Kevin O'Connor <kevin@koconnor.net>
To: seabios@seabios.org, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH][SEABIOS] Allow qemu to use bootsplash code via fwcfg interface.
Date: Sun, 1 Aug 2010 15:45:34 -0400 [thread overview]
Message-ID: <20100801194534.GC25457@morn.localdomain> (raw)
In-Reply-To: <20100801194234.GA25457@morn.localdomain>
Allow the bootsplash code to pull the jpeg file from either cbfs (on
coreboot) or fwcfg (on qemu).
diff --git a/src/bootsplash.c b/src/bootsplash.c
index 676ece3..1dcd402 100644
--- a/src/bootsplash.c
+++ b/src/bootsplash.c
@@ -11,14 +11,14 @@
#include "util.h" // dprintf
#include "jpeg.h" // splash
#include "biosvar.h" // SET_EBDA
+#include "paravirt.h" // romfile_find
/****************************************************************
* VESA structures
****************************************************************/
-struct vesa_info
-{
+struct vesa_info {
u32 vesa_signature;
u16 vesa_version;
struct segoff_s oem_string_ptr;
@@ -36,8 +36,7 @@ struct vesa_info
#define VESA_SIGNATURE 0x41534556 // VESA
#define VBE2_SIGNATURE 0x32454256 // VBE2
-struct vesa_mode_info
-{
+struct vesa_mode_info {
u16 mode_attributes;
u8 win_a_attributes;
u8 win_b_attributes;
@@ -73,6 +72,7 @@ struct vesa_mode_info
u8 reserved[206];
} PACKED;
+
/****************************************************************
* Helper functions
****************************************************************/
@@ -92,7 +92,8 @@ call16_int10(struct bregs *br)
* VGA text / graphics console
****************************************************************/
-static void enable_vga_text_console(void)
+static void
+enable_vga_text_console(void)
{
dprintf(1, "Turning on vga text mode console\n");
struct bregs br;
@@ -140,20 +141,20 @@ find_videomode(struct vesa_info *vesa_info, struct vesa_mode_info *mode_info
}
}
-void enable_vga_console(void)
+void
+enable_vga_console(void)
{
struct vesa_info *vesa_info = NULL;
struct vesa_mode_info *mode_info = NULL;
struct jpeg_decdata *jpeg = NULL;
u8 *filedata = NULL, *picture = NULL;
- /* Needs coreboot support for CBFS */
- if (!CONFIG_BOOTSPLASH || !CONFIG_COREBOOT)
+ if (!CONFIG_BOOTSPLASH)
goto gotext;
- struct cbfs_file *file = cbfs_finddatafile("bootsplash.jpg");
+ u32 file = romfile_find("bootsplash.jpg");
if (!file)
goto gotext;
- int filesize = cbfs_datasize(file);
+ int filesize = romfile_size(file);
filedata = malloc_tmphigh(filesize);
vesa_info = malloc_tmplow(sizeof(*vesa_info));
@@ -186,7 +187,7 @@ void enable_vga_console(void)
vendor, product);
// Parse jpeg and get image size.
- cbfs_copyfile(file, filedata, filesize);
+ romfile_copy(file, filedata, filesize);
int ret = jpeg_decode(jpeg, filedata);
if (ret) {
dprintf(1, "jpeg_decode failed with return code %d...\n", ret);
@@ -248,7 +249,7 @@ gotext:
void
disable_bootsplash(void)
{
- if (!CONFIG_BOOTSPLASH || !CONFIG_COREBOOT || !GET_EBDA(bootsplash_active))
+ if (!CONFIG_BOOTSPLASH || !GET_EBDA(bootsplash_active))
return;
SET_EBDA(bootsplash_active, 0);
enable_vga_text_console();
prev parent reply other threads:[~2010-08-01 19:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-01 19:42 [Qemu-devel] [PATCH] Enable SeaBIOS bootsplash in qemu Kevin O'Connor
2010-08-01 19:44 ` [Qemu-devel] [PATCH][QEMU] Load "bootsplash.jpg" if present Kevin O'Connor
2010-08-01 19:45 ` Kevin O'Connor [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100801194534.GC25457@morn.localdomain \
--to=kevin@koconnor.net \
--cc=qemu-devel@nongnu.org \
--cc=seabios@seabios.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).