Detach optional parts of gfxterm and integrate in with coreboot init.

parent 6570b205
2013-05-30 Vladimir Serbinenko <phcoder@gmail.com>
Detach optional parts of gfxterm and integrate in with coreboot init.
2013-05-30 Vladimir Serbinenko <phcoder@gmail.com>
Move blit and fill dispatcher to appropriate files to decrease export
......@@ -52,7 +52,7 @@ GROUPS["pci"] = GROUPS["x86"] + ["mips_loongson"]
GROUPS["usb"] = GROUPS["pci"]
# If gfxterm is main output console integrate it into kernel
GROUPS["videoinkernel"] = ["mips_loongson", "mips_qemu_mips"]
GROUPS["videoinkernel"] = ["mips_loongson", "i386_coreboot" ]
GROUPS["videomodules"] = GRUB_PLATFORMS[:];
for i in GROUPS["videoinkernel"]: GROUPS["videomodules"].remove(i)
......
......@@ -112,6 +112,11 @@ if COND_i386_coreboot
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/coreboot/lbio.h
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/i386/pc/int.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video_fb.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/gfxterm.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/font.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/bufio.h
endif
if COND_i386_multiboot
......@@ -158,12 +163,10 @@ if COND_mips_qemu_mips
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/keyboard_layouts.h
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/kernel.h
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/cpu/cache.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/bitmap.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video_fb.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/gfxterm.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/font.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/bitmap_scale.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/bufio.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/serial.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/loader.h
......@@ -177,12 +180,10 @@ KERNEL_HEADER_FILES += $(top_builddir)/include/grub/keyboard_layouts.h
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/kernel.h
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/time.h
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/cpu/cache.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/bitmap.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video_fb.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/gfxterm.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/font.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/bitmap_scale.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/bufio.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/pci.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/cs5536.h
......
......@@ -138,6 +138,7 @@ kernel = {
i386_multiboot = kern/i386/coreboot/init.c;
i386_qemu = kern/i386/qemu/init.c;
i386_coreboot_multiboot_qemu = term/i386/pc/vga_text.c;
i386_coreboot = video/i386/coreboot/cbfb.c;
efi = disk/efi/efidisk.c;
efi = kern/efi/efi.c;
......@@ -180,6 +181,7 @@ kernel = {
mips_qemu_mips = term/ns8250.c;
mips_qemu_mips = term/serial.c;
mips_qemu_mips = term/at_keyboard.c;
mips_qemu_mips = commands/boot.c;
mips_qemu_mips = commands/keylayouts.c;
mips_qemu_mips = term/i386/pc/vga_text.c;
mips_qemu_mips = kern/vga_init.c;
......@@ -194,6 +196,7 @@ kernel = {
mips_loongson = bus/pci.c;
mips_loongson = kern/mips/loongson/init.c;
mips_loongson = term/at_keyboard.c;
mips_loongson = commands/boot.c;
mips_loongson = term/serial.c;
mips_loongson = video/sm712.c;
mips_loongson = video/sis315pro.c;
......@@ -227,17 +230,12 @@ kernel = {
videoinkernel = font/font.c;
videoinkernel = font/font_cmd.c;
videoinkernel = io/bufio.c;
videoinkernel = video/bitmap.c;
videoinkernel = video/bitmap_scale.c;
videoinkernel = video/colors.c;
videoinkernel = video/fb/fbblit.c;
videoinkernel = video/fb/fbfill.c;
videoinkernel = video/fb/fbutil.c;
videoinkernel = video/fb/video_fb.c;
videoinkernel = video/video.c;
videoinkernel = commands/boot.c;
extra_dist = kern/i386/int.S;
extra_dist = kern/i386/realmode.S;
extra_dist = boot/i386/pc/lzma_decode.S;
......@@ -656,7 +654,12 @@ module = {
name = boot;
common = commands/boot.c;
i386_pc = lib/i386/pc/biosnum.c;
enable = videomodules;
enable = x86;
enable = emu;
enable = sparc64_ieee1275;
enable = powerpc_ieee1275;
enable = mips_arc;
enable = ia64_efi;
};
module = {
......@@ -1674,6 +1677,11 @@ module = {
enable = videomodules;
};
module = {
name = gfxterm_background;
common = term/gfxterm_background.c;
};
module = {
name = serial;
common = term/serial.c;
......@@ -1775,13 +1783,11 @@ module = {
module = {
name = bitmap;
common = video/bitmap.c;
enable = videomodules;
};
module = {
name = bitmap_scale;
common = video/bitmap_scale.c;
enable = videomodules;
};
module = {
......@@ -1830,20 +1836,18 @@ module = {
module = {
name = video;
common = video/video.c;
common = video/colors.c;
enable = videomodules;
};
module = {
name = ieee1275_fb;
ieee1275 = video/ieee1275.c;
enable = powerpc_ieee1275;
name = video_colors;
common = video/colors.c;
};
module = {
name = coreboot_fb;
common = video/i386/coreboot/cbfb.c;
enable = i386_coreboot;
name = ieee1275_fb;
ieee1275 = video/ieee1275.c;
enable = powerpc_ieee1275;
};
module = {
......@@ -1959,7 +1963,7 @@ module = {
module = {
name = keylayouts;
common = commands/keylayouts.c;
enable = videomodules;
enable = x86;
};
module = {
......
......@@ -61,7 +61,7 @@ lsfonts_command (grub_command_t cmd __attribute__ ((unused)),
static grub_command_t cmd_loadfont, cmd_lsfonts;
#if defined (GRUB_MACHINE_MIPS_LOONGSON) || defined (GRUB_MACHINE_MIPS_QEMU_MIPS)
#if defined (GRUB_MACHINE_MIPS_LOONGSON) || defined (GRUB_MACHINE_COREBOOT)
void grub_font_init (void)
#else
GRUB_MOD_INIT(font)
......@@ -78,7 +78,7 @@ GRUB_MOD_INIT(font)
0, N_("List the loaded fonts."));
}
#if defined (GRUB_MACHINE_MIPS_LOONGSON) || defined (GRUB_MACHINE_MIPS_QEMU_MIPS)
#if defined (GRUB_MACHINE_MIPS_LOONGSON) || defined (GRUB_MACHINE_COREBOOT)
void grub_font_fini (void)
#else
GRUB_MOD_FINI(font)
......
......@@ -23,6 +23,7 @@
#include <grub/font.h>
#include <grub/gui_string_util.h>
#include <grub/i18n.h>
#include <grub/color.h>
static const char *align_options[] =
{
......
......@@ -23,6 +23,7 @@
#include <grub/gui_string_util.h>
#include <grub/gfxmenu_view.h>
#include <grub/gfxwidgets.h>
#include <grub/color.h>
struct grub_gui_list_impl
{
......
......@@ -25,6 +25,7 @@
#include <grub/gfxmenu_view.h>
#include <grub/gfxwidgets.h>
#include <grub/i18n.h>
#include <grub/color.h>
struct grub_gui_progress_bar
{
......
......@@ -30,6 +30,7 @@
#include <grub/gfxwidgets.h>
#include <grub/gfxmenu_view.h>
#include <grub/gui.h>
#include <grub/color.h>
/* Construct a new box widget using ABSPATTERN to find the pixmap files for
it, storing the new box instance at *BOXPTR.
......
......@@ -34,6 +34,7 @@
#include <grub/cpu/io.h>
#include <grub/cpu/floppy.h>
#include <grub/cpu/tsc.h>
#include <grub/video.h>
extern grub_uint8_t _start[];
extern grub_uint8_t _end[];
......@@ -89,6 +90,8 @@ grub_machine_init (void)
{
modend = grub_modules_get_end ();
grub_video_coreboot_fb_early_init ();
grub_vga_text_init ();
#ifdef GRUB_MACHINE_MULTIBOOT
......@@ -96,6 +99,11 @@ grub_machine_init (void)
#endif
grub_machine_mmap_iterate (heap_init, NULL);
grub_video_coreboot_fb_late_init ();
grub_font_init ();
grub_gfxterm_init ();
grub_tsc_init ();
}
......
......@@ -69,8 +69,6 @@ grub_machine_init (void)
grub_serial_init ();
grub_boot_init ();
grub_gfxterm_init ();
}
void
......
This diff is collapsed.
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2006,2007,2008,2009,2013 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#include <grub/term.h>
#include <grub/types.h>
#include <grub/dl.h>
#include <grub/misc.h>
#include <grub/font.h>
#include <grub/mm.h>
#include <grub/env.h>
#include <grub/video.h>
#include <grub/gfxterm.h>
#include <grub/bitmap.h>
#include <grub/command.h>
#include <grub/extcmd.h>
#include <grub/bitmap_scale.h>
#include <grub/i18n.h>
#include <grub/color.h>
GRUB_MOD_LICENSE ("GPLv3+");
/* Option array indices. */
enum
{
BACKGROUND_CMD_ARGINDEX_MODE = 0
};
static const struct grub_arg_option background_image_cmd_options[] =
{
{"mode", 'm', 0, N_("Background image mode."),
/* TRANSLATORS: This refers to background image mode (stretched or
in left-top corner). Note that GRUB will accept only original
keywords stretch and normal, not the translated ones.
So please put both in translation
e.g. stretch(=%STRETCH%)|normal(=%NORMAL%).
The percents mark the translated version. Since many people
may not know the word stretch or normal I recommend
putting the translation either here or in "Background image mode."
string. */
N_("stretch|normal"),
ARG_TYPE_STRING},
{0, 0, 0, 0, 0, 0}
};
static grub_err_t
grub_gfxterm_background_image_cmd (grub_extcmd_context_t ctxt,
int argc, char **args)
{
struct grub_arg_list *state = ctxt->state;
/* Check that we have video adapter active. */
if (grub_video_get_info(NULL) != GRUB_ERR_NONE)
return grub_errno;
/* Destroy existing background bitmap if loaded. */
if (grub_gfxterm_background.bitmap)
{
grub_video_bitmap_destroy (grub_gfxterm_background.bitmap);
grub_gfxterm_background.bitmap = 0;
grub_gfxterm_background.blend_text_bg = 0;
/* Mark whole screen as dirty. */
grub_gfxterm_schedule_repaint ();
}
/* If filename was provided, try to load that. */
if (argc >= 1)
{
/* Try to load new one. */
grub_video_bitmap_load (&grub_gfxterm_background.bitmap, args[0]);
if (grub_errno != GRUB_ERR_NONE)
return grub_errno;
/* Determine if the bitmap should be scaled to fit the screen. */
if (!state[BACKGROUND_CMD_ARGINDEX_MODE].set
|| grub_strcmp (state[BACKGROUND_CMD_ARGINDEX_MODE].arg,
"stretch") == 0)
{
unsigned int width, height;
grub_gfxterm_get_dimensions (&width, &height);
if (width
!= grub_video_bitmap_get_width (grub_gfxterm_background.bitmap)
|| height
!= grub_video_bitmap_get_height (grub_gfxterm_background.bitmap))
{
struct grub_video_bitmap *scaled_bitmap;
grub_video_bitmap_create_scaled (&scaled_bitmap,
width,
height,
grub_gfxterm_background.bitmap,
GRUB_VIDEO_BITMAP_SCALE_METHOD_BEST);
if (grub_errno == GRUB_ERR_NONE)
{
/* Replace the original bitmap with the scaled one. */
grub_video_bitmap_destroy (grub_gfxterm_background.bitmap);
grub_gfxterm_background.bitmap = scaled_bitmap;
}
}
}
/* If bitmap was loaded correctly, display it. */
if (grub_gfxterm_background.bitmap)
{
grub_gfxterm_background.blend_text_bg = 1;
/* Mark whole screen as dirty. */
grub_gfxterm_schedule_repaint ();
}
}
/* All was ok. */
grub_errno = GRUB_ERR_NONE;
return grub_errno;
}
static grub_err_t
grub_gfxterm_background_color_cmd (grub_command_t cmd __attribute__ ((unused)),
int argc, char **args)
{
if (argc != 1)
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected"));
/* Check that we have video adapter active. */
if (grub_video_get_info (NULL) != GRUB_ERR_NONE)
return grub_errno;
if (grub_video_parse_color (args[0],
&grub_gfxterm_background.default_bg_color)
!= GRUB_ERR_NONE)
return grub_errno;
/* Destroy existing background bitmap if loaded. */
if (grub_gfxterm_background.bitmap)
{
grub_video_bitmap_destroy (grub_gfxterm_background.bitmap);
grub_gfxterm_background.bitmap = 0;
/* Mark whole screen as dirty. */
grub_gfxterm_schedule_repaint ();
}
/* Set the background and border colors. The background color needs to be
compatible with the text layer. */
grub_gfxterm_video_update_color ();
grub_gfxterm_background.blend_text_bg = 1;
/* Mark whole screen as dirty. */
grub_gfxterm_schedule_repaint ();
return GRUB_ERR_NONE;
}
static grub_extcmd_t background_image_cmd_handle;
static grub_command_t background_color_cmd_handle;
GRUB_MOD_INIT(gfxterm_background)
{
background_image_cmd_handle =
grub_register_extcmd ("background_image",
grub_gfxterm_background_image_cmd, 0,
N_("[-m (stretch|normal)] FILE"),
N_("Load background image for active terminal."),
background_image_cmd_options);
background_color_cmd_handle =
grub_register_command ("background_color",
grub_gfxterm_background_color_cmd,
N_("COLOR"),
N_("Set background color for active terminal."));
}
GRUB_MOD_FINI(gfxterm_background)
{
grub_unregister_command (background_color_cmd_handle);
grub_unregister_extcmd (background_image_cmd_handle);
}
#define MODE_MDA 1
#include "vga_text.c"
GRUB_MOD_INIT(mda_text)
{
grub_term_register_output ("mda_text", &grub_vga_text_term);
}
GRUB_MOD_FINI(mda_text)
{
grub_term_unregister_output (&grub_vga_text_term);
}
......@@ -22,6 +22,10 @@
#include <grub/vga.h>
#include <grub/term.h>
#if defined (GRUB_MACHINE_COREBOOT)
#include <grub/machine/console.h>
#endif
/* MODESET is used for testing to force monochrome or colour mode.
You shouldn't use mda_text on vga.
*/
......@@ -267,24 +271,23 @@ static struct grub_term_output grub_vga_text_term =
.flags = GRUB_TERM_CODE_TYPE_CP437,
};
#ifdef MODE_MDA
GRUB_MOD_INIT(mda_text)
#elif defined (GRUB_MACHINE_COREBOOT) || defined (GRUB_MACHINE_QEMU) || defined (GRUB_MACHINE_MIPS_QEMU_MIPS) || defined (GRUB_MACHINE_MULTIBOOT)
/* FIXME: this is was too spaghetti. */
#ifndef MODE_MDA
#if defined (GRUB_MACHINE_COREBOOT) || defined (GRUB_MACHINE_QEMU) || defined (GRUB_MACHINE_MIPS_QEMU_MIPS) || defined (GRUB_MACHINE_MULTIBOOT)
void grub_vga_text_init (void)
#else
GRUB_MOD_INIT(vga_text)
#endif
{
#ifdef MODE_MDA
grub_term_register_output ("mda_text", &grub_vga_text_term);
#else
grub_term_register_output ("vga_text", &grub_vga_text_term);
#ifdef GRUB_MACHINE_COREBOOT
if (!grub_video_coreboot_fbtable)
#endif
grub_term_register_output ("vga_text", &grub_vga_text_term);
}
#ifdef MODE_MDA
GRUB_MOD_FINI(mda_text)
#elif defined (GRUB_MACHINE_COREBOOT) || defined (GRUB_MACHINE_QEMU) || defined (GRUB_MACHINE_MIPS_QEMU_MIPS) || defined (GRUB_MACHINE_MULTIBOOT)
#if defined (GRUB_MACHINE_COREBOOT) || defined (GRUB_MACHINE_QEMU) || defined (GRUB_MACHINE_MIPS_QEMU_MIPS) || defined (GRUB_MACHINE_MULTIBOOT)
void grub_vga_text_fini (void)
#else
GRUB_MOD_FINI(vga_text)
......@@ -292,3 +295,5 @@ GRUB_MOD_FINI(vga_text)
{
grub_term_unregister_output (&grub_vga_text_term);
}
#endif
......@@ -210,26 +210,6 @@ grub_video_bitmap_load (struct grub_video_bitmap **bitmap,
" unsupported format"), filename);
}
/* Return bitmap width. */
unsigned int
grub_video_bitmap_get_width (struct grub_video_bitmap *bitmap)
{
if (!bitmap)
return 0;
return bitmap->mode_info.width;
}
/* Return bitmap height. */
unsigned int
grub_video_bitmap_get_height (struct grub_video_bitmap *bitmap)
{
if (!bitmap)
return 0;
return bitmap->mode_info.height;
}
/* Return mode info for bitmap. */
void grub_video_bitmap_get_mode_info (struct grub_video_bitmap *bitmap,
struct grub_video_mode_info *mode_info)
......
......@@ -23,6 +23,7 @@
#include <grub/misc.h>
#include <grub/dl.h>
#include <grub/i18n.h>
#include <grub/color.h>
GRUB_MOD_LICENSE ("GPLv3+");
......
......@@ -31,41 +31,6 @@
#include <grub/types.h>
#include <grub/video.h>
void *
grub_video_fb_get_video_ptr (struct grub_video_fbblit_info *source,
unsigned int x, unsigned int y)
{
grub_uint8_t *ptr = 0;
switch (source->mode_info->bpp)
{
case 32:
ptr = source->data + y * source->mode_info->pitch + x * 4;
break;
case 24:
ptr = source->data + y * source->mode_info->pitch + x * 3;
break;
case 16:
case 15:
ptr = source->data + y * source->mode_info->pitch + x * 2;
break;
case 8:
ptr = source->data + y * source->mode_info->pitch + x;
break;
case 1:
/* For 1-bit bitmaps, addressing needs to be done at the bit level
and it doesn't make sense, in general, to ask for a pointer
to a particular pixel's data. */
break;
}
return ptr;
}
grub_video_color_t
get_pixel (struct grub_video_fbblit_info *source,
unsigned int x, unsigned int y)
......
......@@ -26,10 +26,9 @@
#include <grub/video.h>
#include <grub/video_fb.h>
#include <grub/machine/lbio.h>
#include <grub/machine/console.h>
GRUB_MOD_LICENSE ("GPLv3+");
static struct grub_linuxbios_table_framebuffer *cbfb;
struct grub_linuxbios_table_framebuffer *grub_video_coreboot_fbtable;
static struct
{
......@@ -50,22 +49,22 @@ grub_video_cbfb_fill_mode_info (struct grub_video_mode_info *out)
{
grub_memset (out, 0, sizeof (*out));
out->width = cbfb->width;
out->height = cbfb->height;
out->pitch = cbfb->pitch;
out->width = grub_video_coreboot_fbtable->width;
out->height = grub_video_coreboot_fbtable->height;
out->pitch = grub_video_coreboot_fbtable->pitch;
out->red_field_pos = cbfb->red_field_pos;
out->red_mask_size = cbfb->red_mask_size;
out->green_field_pos = cbfb->green_field_pos;
out->green_mask_size = cbfb->green_mask_size;
out->blue_field_pos = cbfb->blue_field_pos;
out->blue_mask_size = cbfb->blue_mask_size;
out->reserved_field_pos = cbfb->reserved_field_pos;
out->reserved_mask_size = cbfb->reserved_mask_size;
out->red_field_pos = grub_video_coreboot_fbtable->red_field_pos;
out->red_mask_size = grub_video_coreboot_fbtable->red_mask_size;
out->green_field_pos = grub_video_coreboot_fbtable->green_field_pos;
out->green_mask_size = grub_video_coreboot_fbtable->green_mask_size;
out->blue_field_pos = grub_video_coreboot_fbtable->blue_field_pos;
out->blue_mask_size = grub_video_coreboot_fbtable->blue_mask_size;
out->reserved_field_pos = grub_video_coreboot_fbtable->reserved_field_pos;
out->reserved_mask_size = grub_video_coreboot_fbtable->reserved_mask_size;
out->mode_type = GRUB_VIDEO_MODE_TYPE_RGB;
out->bpp = cbfb->bpp;
out->bytes_per_pixel = (cbfb->bpp + 7) / 8;
out->bpp = grub_video_coreboot_fbtable->bpp;
out->bytes_per_pixel = (grub_video_coreboot_fbtable->bpp + 7) / 8;
out->number_of_colors = 256;
out->blit_format = grub_video_get_blit_format (out);
......@@ -79,10 +78,10 @@ grub_video_cbfb_setup (unsigned int width, unsigned int height,
{
grub_err_t err;
if (!cbfb)
if (!grub_video_coreboot_fbtable)
return grub_error (GRUB_ERR_IO, "Couldn't find display device.");
if (!((width == cbfb->width && height == cbfb->height)
if (!((width == grub_video_coreboot_fbtable->width && height == grub_video_coreboot_fbtable->height)
|| (width == 0 && height == 0)))
return grub_error (GRUB_ERR_IO, "can't set mode %dx%d", width, height);
......@@ -93,7 +92,7 @@ grub_video_cbfb_setup (unsigned int width, unsigned int height,
return err;
}
framebuffer.ptr = (void *) (grub_addr_t) cbfb->lfb;
framebuffer.ptr = (void *) (grub_addr_t) grub_video_coreboot_fbtable->lfb;
grub_dprintf ("video", "CBFB: initialising FB @ %p %dx%dx%d\n",
framebuffer.ptr, framebuffer.mode_info.width,
......@@ -162,20 +161,26 @@ iterate_linuxbios_table (grub_linuxbios_table_item_t table_item,
{
if (table_item->tag != GRUB_LINUXBIOS_MEMBER_FRAMEBUFFER)
return 0;
cbfb = (struct grub_linuxbios_table_framebuffer *) (table_item + 1);
grub_video_coreboot_fbtable = (struct grub_linuxbios_table_framebuffer *) (table_item + 1);
return 1;
}
GRUB_MOD_INIT(coreboot_fb)
void
grub_video_coreboot_fb_early_init (void)
{
grub_linuxbios_table_iterate (iterate_linuxbios_table, 0);
}
if (cbfb)
void
grub_video_coreboot_fb_late_init (void)
{
if (grub_video_coreboot_fbtable)
grub_video_register (&grub_video_cbfb_adapter);
}
GRUB_MOD_FINI(coreboot_fb)
void
grub_video_coreboot_fb_fini (void)
{
if (cbfb)
if (grub_video_coreboot_fbtable)
grub_video_unregister (&grub_video_cbfb_adapter);
}
......@@ -59,8 +59,25 @@ grub_err_t EXPORT_FUNC (grub_video_bitmap_destroy) (struct grub_video_bitmap *bi
grub_err_t EXPORT_FUNC (grub_video_bitmap_load) (struct grub_video_bitmap **bitmap,
const char *filename);
unsigned int EXPORT_FUNC (grub_video_bitmap_get_width) (struct grub_video_bitmap *bitmap);
unsigned int EXPORT_FUNC (grub_video_bitmap_get_height) (struct grub_video_bitmap *bitmap);
/* Return bitmap width. */
static inline unsigned int
grub_video_bitmap_get_width (struct grub_video_bitmap *bitmap)
{
if (!bitmap)
return 0;
return bitmap->mode_info.width;
}
/* Return bitmap height. */
static inline unsigned int
grub_video_bitmap_get_height (struct grub_video_bitmap *bitmap)
{
if (!bitmap)
return 0;
return bitmap->mode_info.height;
}
void EXPORT_FUNC (grub_video_bitmap_get_mode_info) (struct grub_video_bitmap *bitmap,
struct grub_video_mode_info *mode_info);
......
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.