iPXE
|
EFI frame buffer console. More...
#include <string.h>
#include <strings.h>
#include <ctype.h>
#include <errno.h>
#include <assert.h>
#include <limits.h>
#include <ipxe/efi/efi.h>
#include <ipxe/efi/Protocol/GraphicsOutput.h>
#include <ipxe/efi/Protocol/HiiFont.h>
#include <ipxe/ansicol.h>
#include <ipxe/fbcon.h>
#include <ipxe/console.h>
#include <ipxe/umalloc.h>
#include <ipxe/rotate.h>
#include <config/console.h>
Go to the source code of this file.
Data Structures | |
struct | efifb |
An EFI frame buffer. More... | |
Macros | |
#define | CONSOLE_EFIFB ( CONSOLE_USAGE_ALL & ~CONSOLE_USAGE_LOG ) |
#define | EFIFB_ASCII 128 |
Number of ASCII glyphs in cache. More... | |
#define | EFIFB_DYNAMIC 32 |
Number of dynamic non-ASCII glyphs in cache. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static int | efifb_draw (unsigned int character, unsigned int index, unsigned int toggle) |
Draw character glyph. More... | |
static int | efifb_draw_unknown (unsigned int index) |
Draw "unknown character" glyph. More... | |
static unsigned int | efifb_dynamic (unsigned int character) |
Get dynamic glyph index. More... | |
static void | efifb_glyph (unsigned int character, uint8_t *glyph) |
Get character glyph. More... | |
static int | efifb_glyphs (void) |
Get character glyphs. More... | |
static int | efifb_colour_map_mask (uint32_t mask, uint8_t *scale, uint8_t *lsb) |
Generate colour mapping for a single colour component. More... | |
static int | efifb_colour_map (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *info, struct fbcon_colour_map *map) |
Generate colour mapping. More... | |
static int | efifb_select_mode (unsigned int min_width, unsigned int min_height, unsigned int min_bpp) |
Select video mode. More... | |
static int | efifb_restore (void) |
Restore video mode. More... | |
static int | efifb_init (struct console_configuration *config) |
Initialise EFI frame buffer. More... | |
static void | efifb_fini (void) |
Finalise EFI frame buffer. More... | |
static void | efifb_putchar (int character) |
Print a character to current cursor position. More... | |
static int | efifb_configure (struct console_configuration *config) |
Configure console. More... | |
Variables | |
struct console_driver | efi_console |
struct console_driver efifb_console | __console_driver |
EFI graphics output protocol console driver. More... | |
static struct efifb | efifb |
The EFI frame buffer. More... | |
EFI frame buffer console.
Definition in file efi_fbcon.c.
#define CONSOLE_EFIFB ( CONSOLE_USAGE_ALL & ~CONSOLE_USAGE_LOG ) |
Definition at line 62 of file efi_fbcon.c.
#define EFIFB_ASCII 128 |
Number of ASCII glyphs in cache.
Definition at line 66 of file efi_fbcon.c.
#define EFIFB_DYNAMIC 32 |
Number of dynamic non-ASCII glyphs in cache.
Definition at line 69 of file efi_fbcon.c.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
static |
Draw character glyph.
character | Character |
index | Index within glyph cache |
toggle | Bits to toggle in each bitmask |
height | Character height, or negative error |
Definition at line 112 of file efi_fbcon.c.
References assert(), _EFI_IMAGE_OUTPUT::Bitmap, EFI_SYSTEM_TABLE::BootServices, copy_to_user(), DBGC, EEFI, efi_systab, EINVAL, efifb::font, EFI_BOOT_SERVICES::FreePool, _EFI_HII_FONT_PROTOCOL::GetGlyph, efifb::glyphs, fbcon_font::height, _EFI_IMAGE_OUTPUT::Height, efifb::hiifont, _EFI_IMAGE_OUTPUT::Image, index, memset_user(), NULL, offset, efifb::pixel, rc, strerror(), and _EFI_IMAGE_OUTPUT::Width.
Referenced by efifb_draw_unknown(), efifb_dynamic(), and efifb_glyphs().
|
static |
Draw "unknown character" glyph.
index | Index within glyph cache |
rc | Return status code |
Definition at line 181 of file efi_fbcon.c.
References efifb_draw(), and index.
Referenced by efifb_dynamic(), and efifb_glyphs().
|
static |
Get dynamic glyph index.
character | Unicode character |
index | Glyph cache index |
Definition at line 193 of file efi_fbcon.c.
References DBGC2, efifb::dynamic, EFIFB_ASCII, efifb_draw(), efifb_draw_unknown(), EFIFB_DYNAMIC, index, and efifb::next.
Referenced by efifb_glyph().
|
static |
Get character glyph.
character | Unicode character |
glyph | Character glyph to fill in |
Definition at line 228 of file efi_fbcon.c.
References copy_from_user(), EFIFB_ASCII, efifb_dynamic(), efifb::font, efifb::glyphs, fbcon_font::height, index, and offset.
Referenced by efifb_glyphs().
|
static |
Get character glyphs.
rc | Return status code |
Definition at line 254 of file efi_fbcon.c.
References DBGC, efifb::dynamic, EFIFB_ASCII, efifb_draw(), efifb_draw_unknown(), EFIFB_DYNAMIC, efifb_glyph(), ENOENT, ENOMEM, efifb::font, fbcon_font::glyph, efifb::glyphs, fbcon_font::height, isprint(), len, max, memset(), memset_user(), rc, ufree(), and umalloc().
Referenced by efifb_init().
Generate colour mapping for a single colour component.
mask | Mask value |
scale | Scale value to fill in |
lsb | LSB value to fill in |
rc | Return status code |
Definition at line 339 of file efi_fbcon.c.
References ENOTSUP, ffs, and fls.
Referenced by efifb_colour_map().
|
static |
Generate colour mapping.
info | EFI mode information |
map | Colour mapping to fill in |
bpp | Number of bits per pixel, or negative error |
Definition at line 362 of file efi_fbcon.c.
References EFI_PIXEL_BITMASK::BlueMask, DBGC, efifb_colour_map_mask(), ENOTSUP, EFI_PIXEL_BITMASK::GreenMask, info, map, PixelBitMask, PixelBlueGreenRedReserved8BitPerColor, PixelRedGreenBlueReserved8BitPerColor, rc, EFI_PIXEL_BITMASK::RedMask, and EFI_PIXEL_BITMASK::ReservedMask.
Referenced by efifb_init(), and efifb_select_mode().
|
static |
Select video mode.
min_width | Minimum required width (in pixels) |
min_height | Minimum required height (in pixels) |
min_bpp | Minimum required colour depth (in bits per pixel) |
mode_number | Mode number, or negative error |
Definition at line 419 of file efi_fbcon.c.
References EFI_SYSTEM_TABLE::BootServices, DBGC, EEFI, efi_systab, efifb_colour_map(), ENOENT, EFI_BOOT_SERVICES::FreePool, efifb::gop, info, INT_MAX, map, EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE::MaxMode, _EFI_GRAPHICS_OUTPUT_PROTOCOL::Mode, _EFI_GRAPHICS_OUTPUT_PROTOCOL::QueryMode, rc, size, and strerror().
Referenced by efifb_init().
|
static |
Restore video mode.
rc | Return status code |
Definition at line 491 of file efi_fbcon.c.
References DBGC, EEFI, efifb::gop, rc, efifb::saved_mode, _EFI_GRAPHICS_OUTPUT_PROTOCOL::SetMode, and strerror().
Referenced by efifb_fini(), and efifb_init().
|
static |
Initialise EFI frame buffer.
config | Console configuration, or NULL to reset |
rc | Return status code |
Definition at line 513 of file efi_fbcon.c.
References EFI_SYSTEM_TABLE::BootServices, DBGC, console_configuration::depth, EEFI, efi_graphics_output_protocol_guid, efi_hii_font_protocol_guid, efi_systab, efifb_colour_map(), efifb_glyphs(), efifb_restore(), efifb_select_mode(), efifb::fbcon, fbcon_fini(), fbcon_init(), efifb::font, EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE::FrameBufferBase, efifb::glyphs, efifb::gop, console_configuration::height, fbcon_geometry::height, efifb::hiifont, info, EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE::Info, fbcon_geometry::len, EFI_BOOT_SERVICES::LocateProtocol, efifb::map, EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE::Mode, _EFI_GRAPHICS_OUTPUT_PROTOCOL::Mode, NULL, phys_to_user(), efifb::pixel, rc, efifb::saved_mode, _EFI_GRAPHICS_OUTPUT_PROTOCOL::SetMode, efifb::start, strerror(), fbcon_geometry::stride, ufree(), console_configuration::width, and fbcon_geometry::width.
Referenced by efifb_configure().
|
static |
Finalise EFI frame buffer.
Definition at line 610 of file efi_fbcon.c.
References efifb_restore(), efifb::fbcon, fbcon_fini(), efifb::glyphs, and ufree().
Referenced by efifb_configure().
|
static |
Print a character to current cursor position.
character | Character |
Definition at line 627 of file efi_fbcon.c.
References efifb::fbcon, and fbcon_putchar().
|
static |
Configure console.
config | Console configuration, or NULL to reset |
rc | Return status code |
Definition at line 638 of file efi_fbcon.c.
References ansicol_reset_magic(), ansicol_set_magic_transparent(), CONSOLE_DISABLED, CONSOLE_DISABLED_OUTPUT, console_driver::disabled, efi_console, efifb_fini(), efifb_init(), console_configuration::height, NULL, console_configuration::pixbuf, rc, and console_configuration::width.
struct console_driver efi_console |
Definition at line 51 of file efi_fbcon.c.
Referenced by efifb_configure().
struct console_driver efifb_console __console_driver |
EFI graphics output protocol console driver.
Definition at line 72 of file efi_fbcon.c.
The EFI frame buffer.
Definition at line 102 of file efi_fbcon.c.