|
iPXE
|
Frame buffer console. More...
#include <string.h>#include <errno.h>#include <assert.h>#include <byteswap.h>#include <ipxe/ansiesc.h>#include <ipxe/image.h>#include <ipxe/pixbuf.h>#include <ipxe/uaccess.h>#include <ipxe/umalloc.h>#include <ipxe/console.h>#include <ipxe/fbcon.h>Go to the source code of this file.
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| static uint32_t | fbcon_colour (struct fbcon *fbcon, uint32_t rgb) |
| Calculate raw colour value. More... | |
| static uint32_t | fbcon_ansi_colour (struct fbcon *fbcon, unsigned int ansicol) |
| Calculate ANSI font colour. More... | |
| static void | fbcon_set_default_foreground (struct fbcon *fbcon) |
| Set default foreground colour. More... | |
| static void | fbcon_set_default_background (struct fbcon *fbcon) |
| Set default background colour. More... | |
| static struct fbcon_text_cell * | fbcon_cell (struct fbcon *fbcon, unsigned int xpos, unsigned int ypos) |
| Get character cell. More... | |
| static void | fbcon_clear (struct fbcon *fbcon, unsigned int ypos) |
| Clear rows of characters. More... | |
| static void | fbcon_draw (struct fbcon *fbcon, struct fbcon_text_cell *cell, unsigned int xpos, unsigned int ypos) |
| Draw character at specified position. More... | |
| static void | fbcon_redraw (struct fbcon *fbcon) |
| Redraw all characters. More... | |
| static void | fbcon_scroll (struct fbcon *fbcon) |
| Scroll screen. More... | |
| static void | fbcon_draw_cursor (struct fbcon *fbcon, int show_cursor) |
| Draw character at cursor position. More... | |
| static void | fbcon_handle_cup (struct ansiesc_context *ctx, unsigned int count __unused, int params[]) |
| Handle ANSI CUP (cursor position) More... | |
| static void | fbcon_handle_ed (struct ansiesc_context *ctx, unsigned int count __unused, int params[] __unused) |
| Handle ANSI ED (erase in page) More... | |
| static void | fbcon_handle_sgr (struct ansiesc_context *ctx, unsigned int count, int params[]) |
| Handle ANSI SGR (set graphics rendition) More... | |
| static void | fbcon_handle_dectcem_set (struct ansiesc_context *ctx, unsigned int count __unused, int params[] __unused) |
| Handle ANSI DECTCEM set (show cursor) More... | |
| static void | fbcon_handle_dectcem_reset (struct ansiesc_context *ctx, unsigned int count __unused, int params[] __unused) |
| Handle ANSI DECTCEM reset (hide cursor) More... | |
| void | fbcon_putchar (struct fbcon *fbcon, int character) |
| Print a character to current cursor position. More... | |
| static int | fbcon_picture_init (struct fbcon *fbcon, struct pixel_buffer *pixbuf) |
| Initialise background picture. More... | |
| int | fbcon_init (struct fbcon *fbcon, void *start, struct fbcon_geometry *pixel, struct fbcon_colour_map *map, struct fbcon_font *font, struct console_configuration *config) |
| Initialise frame buffer console. More... | |
| void | fbcon_fini (struct fbcon *fbcon) |
| Finalise frame buffer console. More... | |
Variables | |
| static struct ansiesc_handler | fbcon_ansiesc_handlers [] |
| ANSI escape sequence handlers. More... | |
Frame buffer console.
Definition in file fbcon.c.
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
Calculate raw colour value.
| fbcon | Frame buffer console |
| rgb | 24-bit RGB value |
| raw | Raw colour |
Definition at line 51 of file fbcon.c.
References cpu_to_le32, fbcon::map, and map.
Referenced by fbcon_ansi_colour(), fbcon_handle_sgr(), and fbcon_picture_init().
Calculate ANSI font colour.
| fbcon | Frame buffer console |
| ansicol | ANSI colour value (0-based) |
| colour | Raw colour |
Definition at line 71 of file fbcon.c.
References fbcon_colour().
Referenced by fbcon_handle_sgr(), and fbcon_set_default_foreground().
|
static |
Set default foreground colour.
| fbcon | Frame buffer console |
Definition at line 88 of file fbcon.c.
References fbcon::bold, fbcon_ansi_colour(), and fbcon::foreground.
Referenced by fbcon_handle_sgr(), and fbcon_init().
|
static |
Set default background colour.
| fbcon | Frame buffer console |
Definition at line 100 of file fbcon.c.
References fbcon::background, and FBCON_TRANSPARENT.
Referenced by fbcon_handle_sgr(), and fbcon_init().
|
inlinestatic |
Get character cell.
| fbcon | Frame buffer console |
| xpos | X position |
| ypos | Y position |
| cell | Text cell |
Definition at line 114 of file fbcon.c.
References fbcon_text::cells, fbcon::character, index, fbcon::text, and fbcon_geometry::width.
Referenced by fbcon_clear(), fbcon_draw_cursor(), fbcon_putchar(), fbcon_redraw(), and fbcon_scroll().
|
static |
Clear rows of characters.
| fbcon | Frame buffer console |
| ypos | Starting Y position |
Definition at line 129 of file fbcon.c.
References fbcon_text_cell::background, fbcon::background, fbcon_text_cell::character, fbcon::character, fbcon_cell(), fbcon_text_cell::foreground, fbcon::foreground, fbcon_geometry::height, and fbcon_geometry::width.
Referenced by fbcon_handle_ed(), fbcon_init(), and fbcon_scroll().
|
static |
Draw character at specified position.
| fbcon | Frame buffer console |
| cell | Text cell |
| xpos | X position |
| ypos | Y position |
Definition at line 153 of file fbcon.c.
References fbcon_text_cell::background, fbcon_text_cell::character, fbcon::character, FBCON_CHAR_WIDTH, FBCON_TRANSPARENT, fbcon::font, fbcon_text_cell::foreground, fbcon_font::glyph, fbcon_font::height, fbcon::indent, fbcon_geometry::len, memcpy(), memset(), offset, fbcon::picture, fbcon::pixel, src, fbcon_picture::start, fbcon::start, and fbcon_geometry::stride.
Referenced by fbcon_draw_cursor(), fbcon_putchar(), fbcon_redraw(), and fbcon_scroll().
|
static |
Redraw all characters.
| fbcon | Frame buffer console |
Definition at line 216 of file fbcon.c.
References fbcon::character, fbcon_cell(), fbcon_draw(), fbcon_geometry::height, and fbcon_geometry::width.
Referenced by fbcon_handle_ed().
|
static |
Scroll screen.
| fbcon | Frame buffer console |
Definition at line 236 of file fbcon.c.
References assert(), fbcon_text_cell::background, fbcon_text_cell::character, fbcon::character, fbcon_cell(), fbcon_clear(), fbcon_draw(), fbcon_text_cell::foreground, fbcon_geometry::height, old, fbcon_geometry::width, and fbcon::ypos.
Referenced by fbcon_putchar().
|
static |
Draw character at cursor position.
| fbcon | Frame buffer console |
| show_cursor | Show cursor |
Definition at line 285 of file fbcon.c.
References fbcon_text_cell::background, fbcon::background, fbcon_text_cell::character, fbcon_cell(), fbcon_draw(), FBCON_TRANSPARENT, fbcon_text_cell::foreground, fbcon::foreground, fbcon::xpos, and fbcon::ypos.
Referenced by fbcon_handle_cup(), fbcon_handle_dectcem_reset(), fbcon_handle_dectcem_set(), fbcon_handle_ed(), and fbcon_putchar().
|
static |
Handle ANSI CUP (cursor position)
| ctx | ANSI escape sequence context |
| count | Parameter count |
| params[0] | Row (1 is top) |
| params[1] | Column (1 is left) |
Definition at line 309 of file fbcon.c.
References fbcon::character, container_of, ctx, cx, fbcon_draw_cursor(), fbcon_geometry::height, fbcon::show_cursor, fbcon_geometry::width, fbcon::xpos, and fbcon::ypos.
|
static |
Handle ANSI ED (erase in page)
| ctx | ANSI escape sequence context |
| count | Parameter count |
| params[0] | Region to erase |
Definition at line 332 of file fbcon.c.
References ANSIESC_ED_ALL, assert(), container_of, ctx, fbcon_clear(), fbcon_draw_cursor(), fbcon_redraw(), fbcon::show_cursor, fbcon::xpos, and fbcon::ypos.
|
static |
Handle ANSI SGR (set graphics rendition)
| ctx | ANSI escape sequence context |
| count | Parameter count |
| params | List of graphic rendition aspects |
Definition at line 359 of file fbcon.c.
References fbcon::background, fbcon::bold, container_of, count, ctx, end, fbcon_ansi_colour(), FBCON_BOLD, fbcon_colour(), fbcon_set_default_background(), fbcon_set_default_foreground(), fbcon::foreground, and NULL.
|
static |
Handle ANSI DECTCEM set (show cursor)
| ctx | ANSI escape sequence context |
| count | Parameter count |
| params | List of graphic rendition aspects |
Definition at line 419 of file fbcon.c.
References container_of, ctx, fbcon_draw_cursor(), and fbcon::show_cursor.
|
static |
Handle ANSI DECTCEM reset (hide cursor)
| ctx | ANSI escape sequence context |
| count | Parameter count |
| params | List of graphic rendition aspects |
Definition at line 435 of file fbcon.c.
References container_of, ctx, fbcon_draw_cursor(), and fbcon::show_cursor.
| void fbcon_putchar | ( | struct fbcon * | fbcon, |
| int | character | ||
| ) |
Print a character to current cursor position.
| fbcon | Frame buffer console |
| character | Character |
Definition at line 460 of file fbcon.c.
References ansiesc_process(), fbcon_text_cell::background, fbcon::background, fbcon::bold, fbcon_text_cell::character, fbcon::character, fbcon::ctx, fbcon_cell(), fbcon_draw(), fbcon_draw_cursor(), fbcon_scroll(), fbcon_text_cell::foreground, fbcon::foreground, fbcon_geometry::height, fbcon::show_cursor, fbcon::utf8, utf8_accumulate(), fbcon_geometry::width, fbcon::xpos, and fbcon::ypos.
Referenced by efifb_putchar(), and vesafb_putchar().
|
static |
Initialise background picture.
| fbcon | Frame buffer console |
| pixbuf | Background picture |
| rc | Return status code |
Definition at line 525 of file fbcon.c.
References DBGC, ENOMEM, fbcon_colour(), pixel_buffer::height, fbcon_geometry::height, fbcon_geometry::len, len, memcpy(), memset(), offset, fbcon::picture, fbcon::pixel, raw, rc, fbcon_picture::start, fbcon_geometry::stride, ufree(), umalloc(), pixel_buffer::width, fbcon_geometry::width, x, and y.
Referenced by fbcon_init().
| int fbcon_init | ( | struct fbcon * | fbcon, |
| void * | start, | ||
| struct fbcon_geometry * | pixel, | ||
| struct fbcon_colour_map * | map, | ||
| struct fbcon_font * | font, | ||
| struct console_configuration * | config | ||
| ) |
Initialise frame buffer console.
| fbcon | Frame buffer console |
| start | Start address |
| pixel | Pixel geometry |
| map | Colour mapping |
| font | Font definition |
| config | Console configuration |
| rc | Return status code |
Definition at line 600 of file fbcon.c.
References assert(), console_configuration::bottom, fbcon_margin::bottom, fbcon_text::cells, fbcon::character, console_set_size(), fbcon::ctx, DBGC, EINVAL, ENOMEM, fbcon_ansiesc_handlers, FBCON_CHAR_WIDTH, fbcon_clear(), fbcon_picture_init(), fbcon_set_default_background(), fbcon_set_default_foreground(), fbcon::font, ansiesc_context::handlers, console_configuration::height, fbcon_font::height, fbcon_geometry::height, fbcon::indent, console_configuration::left, fbcon_margin::left, fbcon_geometry::len, fbcon::len, fbcon::map, map, fbcon::margin, memcpy(), memset(), fbcon::picture, console_configuration::pixbuf, fbcon::pixel, rc, console_configuration::right, fbcon_margin::right, fbcon::show_cursor, start, fbcon_picture::start, fbcon::start, fbcon_geometry::stride, fbcon::text, console_configuration::top, fbcon_margin::top, ufree(), umalloc(), console_configuration::width, and fbcon_geometry::width.
Referenced by efifb_init(), and vesafb_init().
| void fbcon_fini | ( | struct fbcon * | fbcon | ) |
Finalise frame buffer console.
| fbcon | Frame buffer console |
Definition at line 728 of file fbcon.c.
References fbcon_text::cells, fbcon::picture, fbcon_picture::start, fbcon::text, and ufree().
Referenced by efifb_fini(), efifb_init(), vesafb_fini(), and vesafb_init().
|
static |
ANSI escape sequence handlers.
Definition at line 445 of file fbcon.c.
Referenced by fbcon_init().
1.8.15