Lines Matching refs:lfb

26 static struct lfb_status lfb;  variable
36 bpp = (lfb.lfbp.bits_per_pixel + 7) >> 3; in lfb_show_line()
38 for ( i = 0; i < lfb.lfbp.font->height; i++ ) in lfb_show_line()
40 unsigned char *ptr = lfb.lbuf; in lfb_show_line()
44 const unsigned char *bits = lfb.lfbp.font->data; in lfb_show_line()
45 bits += ((text_line[j] * lfb.lfbp.font->height + i) * in lfb_show_line()
46 ((lfb.lfbp.font->width + 7) >> 3)); in lfb_show_line()
47 for ( b = lfb.lfbp.font->width; b--; ) in lfb_show_line()
49 pixel = (*bits & (1u<<b)) ? lfb.lfbp.pixel_on : 0; in lfb_show_line()
55 memset(ptr, 0, (lfb.lfbp.width - nr_chars * lfb.lfbp.font->width) * bpp); in lfb_show_line()
56 memcpy(video_line, lfb.lbuf, nr_cells * lfb.lfbp.font->width * bpp); in lfb_show_line()
57 video_line += lfb.lfbp.bytes_per_line; in lfb_show_line()
64 unsigned int i, min_redraw_y = lfb.ypos; in lfb_redraw_puts()
70 if ( (c == '\n') || (lfb.xpos >= lfb.lfbp.text_columns) ) in lfb_redraw_puts()
72 if ( ++lfb.ypos >= lfb.lfbp.text_rows ) in lfb_redraw_puts()
75 lfb.ypos = lfb.lfbp.text_rows - 1; in lfb_redraw_puts()
76 memmove(lfb.text_buf, lfb.text_buf + lfb.lfbp.text_columns, in lfb_redraw_puts()
77 lfb.ypos * lfb.lfbp.text_columns); in lfb_redraw_puts()
78 memset(lfb.text_buf + lfb.ypos * lfb.lfbp.text_columns, 0, lfb.xpos); in lfb_redraw_puts()
80 lfb.xpos = 0; in lfb_redraw_puts()
84 lfb.text_buf[lfb.xpos++ + lfb.ypos * lfb.lfbp.text_columns] = c; in lfb_redraw_puts()
88 for ( i = min_redraw_y; i <= lfb.ypos; i++ ) in lfb_redraw_puts()
90 const unsigned char *line = lfb.text_buf + i * lfb.lfbp.text_columns; in lfb_redraw_puts()
93 for ( width = lfb.lfbp.text_columns; width; --width ) in lfb_redraw_puts()
97 lfb.lfbp.lfb + i * lfb.lfbp.font->height * lfb.lfbp.bytes_per_line, in lfb_redraw_puts()
98 width, max(lfb.line_len[i], width)); in lfb_redraw_puts()
99 lfb.line_len[i] = width; in lfb_redraw_puts()
102 lfb.lfbp.flush(); in lfb_redraw_puts()
113 if ( (c == '\n') || (lfb.xpos >= lfb.lfbp.text_columns) ) in lfb_scroll_puts()
115 unsigned int bytes = (lfb.lfbp.width * in lfb_scroll_puts()
116 ((lfb.lfbp.bits_per_pixel + 7) >> 3)); in lfb_scroll_puts()
117 unsigned char *src = lfb.lfbp.lfb + lfb.lfbp.font->height * lfb.lfbp.bytes_per_line; in lfb_scroll_puts()
118 unsigned char *dst = lfb.lfbp.lfb; in lfb_scroll_puts()
121 for ( i = lfb.lfbp.font->height; i < lfb.lfbp.height; i++ ) in lfb_scroll_puts()
124 src += lfb.lfbp.bytes_per_line; in lfb_scroll_puts()
125 dst += lfb.lfbp.bytes_per_line; in lfb_scroll_puts()
130 lfb.text_buf, in lfb_scroll_puts()
131 lfb.lfbp.lfb + (lfb.lfbp.text_rows-1) * lfb.lfbp.font->height * in lfb_scroll_puts()
132 lfb.lfbp.bytes_per_line, in lfb_scroll_puts()
133 lfb.xpos, lfb.lfbp.text_columns); in lfb_scroll_puts()
135 lfb.xpos = 0; in lfb_scroll_puts()
139 lfb.text_buf[lfb.xpos++] = c; in lfb_scroll_puts()
142 lfb.lfbp.flush(); in lfb_scroll_puts()
147 lfb.xpos = 0; in lfb_carriage_return()
159 lfb.lfbp = *lfbp; in lfb_init()
161 lfb.lbuf = xmalloc_bytes(lfb.lfbp.bytes_per_line); in lfb_init()
162 lfb.text_buf = xzalloc_bytes(lfb.lfbp.text_columns * lfb.lfbp.text_rows); in lfb_init()
163 lfb.line_len = xzalloc_array(unsigned int, lfb.lfbp.text_columns); in lfb_init()
165 if ( !lfb.lbuf || !lfb.text_buf || !lfb.line_len ) in lfb_init()
179 xfree(lfb.lbuf); in lfb_free()
180 xfree(lfb.text_buf); in lfb_free()
181 xfree(lfb.line_len); in lfb_free()