10 FILE_LICENCE ( GPL2_OR_LATER );
13 #include <ipxe/ansiesc.h>
14 #include <ipxe/uaccess.h>
18 /** Character width, in pixels */
19 #define FBCON_CHAR_WIDTH 9
21 /** Character height, in pixels */
22 #define FBCON_CHAR_HEIGHT 16
24 /** Bold colour modifier (RGB value) */
25 #define FBCON_BOLD 0x555555
27 /** Transparent background magic colour (raw colour value) */
28 #define FBCON_TRANSPARENT 0xffffffff
31 struct fbcon_font_glyph {
33 uint8_t bitmask[FBCON_CHAR_HEIGHT];
34 } __attribute__ (( packed ));
36 /** A font definition */
38 /** Character glyphs */
40 } __attribute__ (( packed ));
42 /** A frame buffer geometry
44 * The geometry is defined in terms of "entities" (which can be either
45 * pixels or characters).
47 struct fbcon_geometry {
48 /** Width (number of entities per displayed row) */
50 /** Height (number of entities per displayed column) */
52 /** Length of a single entity */
54 /** Stride (offset between vertically adjacent entities) */
58 /** A frame buffer margin */
70 /** A frame buffer colour mapping */
71 struct fbcon_colour_map {
72 /** Red scale (right shift amount from 24-bit RGB) */
74 /** Green scale (right shift amount from 24-bit RGB) */
76 /** Blue scale (right shift amount from 24-bit RGB) */
86 /** A frame buffer text cell */
87 struct fbcon_text_cell {
88 /** Foreground colour */
90 /** Background colour */
93 unsigned int character;
96 /** A frame buffer text array */
98 /** Stored text cells */
102 /** A frame buffer background picture */
103 struct fbcon_picture {
108 /** A frame buffer console */
112 /** Length of one complete displayed screen */
114 /** Pixel geometry */
115 struct fbcon_geometry *pixel;
116 /** Character geometry */
117 struct fbcon_geometry character;
119 struct fbcon_margin margin;
120 /** Indent to first character (in bytes) */
122 /** Colour mapping */
123 struct fbcon_colour_map *map;
124 /** Font definition */
125 struct fbcon_font *font;
126 /** Text foreground raw colour */
128 /** Text background raw colour */
130 /** Bold colour modifier raw colour */
132 /** Text cursor X position */
134 /** Text cursor Y position */
136 /** ANSI escape sequence context */
137 struct ansiesc_context ctx;
139 struct fbcon_text text;
140 /** Background picture */
141 struct fbcon_picture picture;
142 /** Display cursor */
146 extern int fbcon_init ( struct fbcon *fbcon, userptr_t start,
147 struct fbcon_geometry *pixel,
148 struct fbcon_margin *margin,
149 struct fbcon_colour_map *map,
150 struct fbcon_font *font,
151 struct pixel_buffer *pixbuf );
152 extern void fbcon_fini ( struct fbcon *fbcon );
153 extern void fbcon_putchar ( struct fbcon *fbcon, int character );
155 #endif /* _IPXE_FBCON_H */