Lines Matching +full:x +full:- +full:y

2  * SPDX-License-Identifier: MIT
14 #include "console-priv.h"
56 int x, y; member
127 return c->chr ? c->chr->label : NULL; in qemu_text_console_get_label()
135 .x = posx, .y = posy, .width = width, .height = height in qemu_console_fill_rect()
139 pixman_image_fill_rectangles(PIXMAN_OP_SRC, surface->image, in qemu_console_fill_rect()
151 surface->image, NULL, surface->image, in qemu_console_bitblt()
155 static void vga_putcharxy(QemuConsole *s, int x, int y, int ch, in vga_putcharxy() argument
163 if (t_attrib->invers) { in vga_putcharxy()
164 bgcol = color_table_rgb[t_attrib->bold][t_attrib->fgcol]; in vga_putcharxy()
165 fgcol = color_table_rgb[t_attrib->bold][t_attrib->bgcol]; in vga_putcharxy()
167 fgcol = color_table_rgb[t_attrib->bold][t_attrib->fgcol]; in vga_putcharxy()
168 bgcol = color_table_rgb[t_attrib->bold][t_attrib->bgcol]; in vga_putcharxy()
174 qemu_pixman_glyph_render(glyphs[ch], surface->image, in vga_putcharxy()
175 &fgcol, &bgcol, x, y, FONT_WIDTH, FONT_HEIGHT); in vga_putcharxy()
178 static void invalidate_xy(QemuTextConsole *s, int x, int y) in invalidate_xy() argument
183 if (s->update_x0 > x * FONT_WIDTH) in invalidate_xy()
184 s->update_x0 = x * FONT_WIDTH; in invalidate_xy()
185 if (s->update_y0 > y * FONT_HEIGHT) in invalidate_xy()
186 s->update_y0 = y * FONT_HEIGHT; in invalidate_xy()
187 if (s->update_x1 < (x + 1) * FONT_WIDTH) in invalidate_xy()
188 s->update_x1 = (x + 1) * FONT_WIDTH; in invalidate_xy()
189 if (s->update_y1 < (y + 1) * FONT_HEIGHT) in invalidate_xy()
190 s->update_y1 = (y + 1) * FONT_HEIGHT; in invalidate_xy()
196 int y, y1; in console_show_cursor() local
197 int x = s->x; in console_show_cursor() local
199 s->cursor_invalidate = 1; in console_show_cursor()
201 if (x >= s->width) { in console_show_cursor()
202 x = s->width - 1; in console_show_cursor()
204 y1 = (s->y_base + s->y) % s->total_height; in console_show_cursor()
205 y = y1 - s->y_displayed; in console_show_cursor()
206 if (y < 0) { in console_show_cursor()
207 y += s->total_height; in console_show_cursor()
209 if (y < s->height) { in console_show_cursor()
210 c = &s->cells[y1 * s->width + x]; in console_show_cursor()
214 vga_putcharxy(QEMU_CONSOLE(s), x, y, c->ch, &t_attrib); in console_show_cursor()
216 vga_putcharxy(QEMU_CONSOLE(s), x, y, c->ch, &(c->t_attrib)); in console_show_cursor()
218 invalidate_xy(s, x, y); in console_show_cursor()
226 int x, y, y1; in console_refresh() local
229 s->text_x[0] = 0; in console_refresh()
230 s->text_y[0] = 0; in console_refresh()
231 s->text_x[1] = s->width - 1; in console_refresh()
232 s->text_y[1] = s->height - 1; in console_refresh()
233 s->cursor_invalidate = 1; in console_refresh()
237 y1 = s->y_displayed; in console_refresh()
238 for (y = 0; y < s->height; y++) { in console_refresh()
239 c = s->cells + y1 * s->width; in console_refresh()
240 for (x = 0; x < s->width; x++) { in console_refresh()
241 vga_putcharxy(QEMU_CONSOLE(s), x, y, c->ch, in console_refresh()
242 &(c->t_attrib)); in console_refresh()
245 if (++y1 == s->total_height) { in console_refresh()
260 if (s->y_displayed == s->y_base) in console_scroll()
262 if (++s->y_displayed == s->total_height) in console_scroll()
263 s->y_displayed = 0; in console_scroll()
266 ydelta = -ydelta; in console_scroll()
267 i = s->backscroll_height; in console_scroll()
268 if (i > s->total_height - s->height) in console_scroll()
269 i = s->total_height - s->height; in console_scroll()
270 y1 = s->y_base - i; in console_scroll()
272 y1 += s->total_height; in console_scroll()
274 if (s->y_displayed == y1) in console_scroll()
276 if (--s->y_displayed < 0) in console_scroll()
277 s->y_displayed = s->total_height - 1; in console_scroll()
287 len = qemu_chr_be_can_write(s->chr); in kbd_send_chars()
288 avail = fifo8_num_used(&s->out_fifo); in kbd_send_chars()
293 buf = fifo8_pop_bufptr(&s->out_fifo, MIN(len, avail), &size); in kbd_send_chars()
294 qemu_chr_be_write(s->chr, buf, size); in kbd_send_chars()
295 len = qemu_chr_be_can_write(s->chr); in kbd_send_chars()
296 avail -= size; in kbd_send_chars()
309 console_scroll(s, -1); in qemu_text_console_handle_keysym()
315 console_scroll(s, -10); in qemu_text_console_handle_keysym()
326 c = keysym - 0xe100; in qemu_text_console_handle_keysym()
335 } else if (s->echo && (keysym == '\r' || keysym == '\n')) { in qemu_text_console_handle_keysym()
336 qemu_chr_write(s->chr, (uint8_t *)"\r", 1, true); in qemu_text_console_handle_keysym()
341 if (s->echo) { in qemu_text_console_handle_keysym()
342 qemu_chr_write(s->chr, buf, q - buf, true); in qemu_text_console_handle_keysym()
344 num_free = fifo8_num_free(&s->out_fifo); in qemu_text_console_handle_keysym()
345 fifo8_push_all(&s->out_fifo, buf, MIN(num_free, q - buf)); in qemu_text_console_handle_keysym()
356 if (s->text_x[0] <= s->text_x[1]) { in text_console_update()
357 src = (s->y_base + s->text_y[0]) * s->width; in text_console_update()
358 chardata += s->text_y[0] * s->width; in text_console_update()
359 for (i = s->text_y[0]; i <= s->text_y[1]; i ++) in text_console_update()
360 for (j = 0; j < s->width; j++, src++) { in text_console_update()
362 ATTR2CHTYPE(s->cells[src].ch, in text_console_update()
363 s->cells[src].t_attrib.fgcol, in text_console_update()
364 s->cells[src].t_attrib.bgcol, in text_console_update()
365 s->cells[src].t_attrib.bold)); in text_console_update()
367 dpy_text_update(QEMU_CONSOLE(s), s->text_x[0], s->text_y[0], in text_console_update()
368 s->text_x[1] - s->text_x[0], i - s->text_y[0]); in text_console_update()
369 s->text_x[0] = s->width; in text_console_update()
370 s->text_y[0] = s->height; in text_console_update()
371 s->text_x[1] = 0; in text_console_update()
372 s->text_y[1] = 0; in text_console_update()
374 if (s->cursor_invalidate) { in text_console_update()
375 dpy_text_cursor(QEMU_CONSOLE(s), s->x, s->y); in text_console_update()
376 s->cursor_invalidate = 0; in text_console_update()
384 int w1, x, y, last_width, w, h; in text_console_resize() local
386 assert(s->scanout.kind == SCANOUT_SURFACE); in text_console_resize()
388 w = surface_width(s->surface) / FONT_WIDTH; in text_console_resize()
389 h = surface_height(s->surface) / FONT_HEIGHT; in text_console_resize()
390 if (w == t->width && h == t->height) { in text_console_resize()
394 last_width = t->width; in text_console_resize()
395 t->width = w; in text_console_resize()
396 t->height = h; in text_console_resize()
398 w1 = MIN(t->width, last_width); in text_console_resize()
400 cells = g_new(TextCell, t->width * t->total_height + 1); in text_console_resize()
401 for (y = 0; y < t->total_height; y++) { in text_console_resize()
402 c = &cells[y * t->width]; in text_console_resize()
404 c1 = &t->cells[y * last_width]; in text_console_resize()
405 for (x = 0; x < w1; x++) { in text_console_resize()
409 for (x = w1; x < t->width; x++) { in text_console_resize()
410 c->ch = ' '; in text_console_resize()
411 c->t_attrib = TEXT_ATTRIBUTES_DEFAULT; in text_console_resize()
415 g_free(t->cells); in text_console_resize()
416 t->cells = cells; in text_console_resize()
421 QemuTextConsole *s = vc->console; in vc_put_lf()
423 int x, y1; in vc_put_lf() local
425 s->y++; in vc_put_lf()
426 if (s->y >= s->height) { in vc_put_lf()
427 s->y = s->height - 1; in vc_put_lf()
429 if (s->y_displayed == s->y_base) { in vc_put_lf()
430 if (++s->y_displayed == s->total_height) in vc_put_lf()
431 s->y_displayed = 0; in vc_put_lf()
433 if (++s->y_base == s->total_height) in vc_put_lf()
434 s->y_base = 0; in vc_put_lf()
435 if (s->backscroll_height < s->total_height) in vc_put_lf()
436 s->backscroll_height++; in vc_put_lf()
437 y1 = (s->y_base + s->height - 1) % s->total_height; in vc_put_lf()
438 c = &s->cells[y1 * s->width]; in vc_put_lf()
439 for(x = 0; x < s->width; x++) { in vc_put_lf()
440 c->ch = ' '; in vc_put_lf()
441 c->t_attrib = TEXT_ATTRIBUTES_DEFAULT; in vc_put_lf()
444 if (s->y_displayed == s->y_base) { in vc_put_lf()
445 s->text_x[0] = 0; in vc_put_lf()
446 s->text_y[0] = 0; in vc_put_lf()
447 s->text_x[1] = s->width - 1; in vc_put_lf()
448 s->text_y[1] = s->height - 1; in vc_put_lf()
451 s->width * FONT_WIDTH, in vc_put_lf()
452 (s->height - 1) * FONT_HEIGHT); in vc_put_lf()
453 qemu_console_fill_rect(QEMU_CONSOLE(s), 0, (s->height - 1) * FONT_HEIGHT, in vc_put_lf()
454 s->width * FONT_WIDTH, FONT_HEIGHT, in vc_put_lf()
456 s->update_x0 = 0; in vc_put_lf()
457 s->update_y0 = 0; in vc_put_lf()
458 s->update_x1 = s->width * FONT_WIDTH; in vc_put_lf()
459 s->update_y1 = s->height * FONT_HEIGHT; in vc_put_lf()
472 for (i = 0; i < vc->nb_esc_params; i++) { in vc_handle_escape()
473 switch (vc->esc_params[i]) { in vc_handle_escape()
475 vc->t_attrib = TEXT_ATTRIBUTES_DEFAULT; in vc_handle_escape()
478 vc->t_attrib.bold = 1; in vc_handle_escape()
481 vc->t_attrib.uline = 1; in vc_handle_escape()
484 vc->t_attrib.blink = 1; in vc_handle_escape()
487 vc->t_attrib.invers = 1; in vc_handle_escape()
490 vc->t_attrib.unvisible = 1; in vc_handle_escape()
493 vc->t_attrib.bold = 0; in vc_handle_escape()
496 vc->t_attrib.uline = 0; in vc_handle_escape()
499 vc->t_attrib.blink = 0; in vc_handle_escape()
502 vc->t_attrib.invers = 0; in vc_handle_escape()
505 vc->t_attrib.unvisible = 0; in vc_handle_escape()
509 vc->t_attrib.fgcol = QEMU_COLOR_BLACK; in vc_handle_escape()
512 vc->t_attrib.fgcol = QEMU_COLOR_RED; in vc_handle_escape()
515 vc->t_attrib.fgcol = QEMU_COLOR_GREEN; in vc_handle_escape()
518 vc->t_attrib.fgcol = QEMU_COLOR_YELLOW; in vc_handle_escape()
521 vc->t_attrib.fgcol = QEMU_COLOR_BLUE; in vc_handle_escape()
524 vc->t_attrib.fgcol = QEMU_COLOR_MAGENTA; in vc_handle_escape()
527 vc->t_attrib.fgcol = QEMU_COLOR_CYAN; in vc_handle_escape()
530 vc->t_attrib.fgcol = QEMU_COLOR_WHITE; in vc_handle_escape()
534 vc->t_attrib.bgcol = QEMU_COLOR_BLACK; in vc_handle_escape()
537 vc->t_attrib.bgcol = QEMU_COLOR_RED; in vc_handle_escape()
540 vc->t_attrib.bgcol = QEMU_COLOR_GREEN; in vc_handle_escape()
543 vc->t_attrib.bgcol = QEMU_COLOR_YELLOW; in vc_handle_escape()
546 vc->t_attrib.bgcol = QEMU_COLOR_BLUE; in vc_handle_escape()
549 vc->t_attrib.bgcol = QEMU_COLOR_MAGENTA; in vc_handle_escape()
552 vc->t_attrib.bgcol = QEMU_COLOR_CYAN; in vc_handle_escape()
555 vc->t_attrib.bgcol = QEMU_COLOR_WHITE; in vc_handle_escape()
561 static void vc_update_xy(VCChardev *vc, int x, int y) in vc_update_xy() argument
563 QemuTextConsole *s = vc->console; in vc_update_xy()
567 s->text_x[0] = MIN(s->text_x[0], x); in vc_update_xy()
568 s->text_x[1] = MAX(s->text_x[1], x); in vc_update_xy()
569 s->text_y[0] = MIN(s->text_y[0], y); in vc_update_xy()
570 s->text_y[1] = MAX(s->text_y[1], y); in vc_update_xy()
572 y1 = (s->y_base + y) % s->total_height; in vc_update_xy()
573 y2 = y1 - s->y_displayed; in vc_update_xy()
575 y2 += s->total_height; in vc_update_xy()
577 if (y2 < s->height) { in vc_update_xy()
578 if (x >= s->width) { in vc_update_xy()
579 x = s->width - 1; in vc_update_xy()
581 c = &s->cells[y1 * s->width + x]; in vc_update_xy()
582 vga_putcharxy(QEMU_CONSOLE(s), x, y2, c->ch, in vc_update_xy()
583 &(c->t_attrib)); in vc_update_xy()
584 invalidate_xy(s, x, y2); in vc_update_xy()
588 static void vc_clear_xy(VCChardev *vc, int x, int y) in vc_clear_xy() argument
590 QemuTextConsole *s = vc->console; in vc_clear_xy()
591 int y1 = (s->y_base + y) % s->total_height; in vc_clear_xy()
592 if (x >= s->width) { in vc_clear_xy()
593 x = s->width - 1; in vc_clear_xy()
595 TextCell *c = &s->cells[y1 * s->width + x]; in vc_clear_xy()
596 c->ch = ' '; in vc_clear_xy()
597 c->t_attrib = TEXT_ATTRIBUTES_DEFAULT; in vc_clear_xy()
598 vc_update_xy(vc, x, y); in vc_clear_xy()
603 QemuTextConsole *s = vc->console; in vc_put_one()
606 if (s->x >= s->width) { in vc_put_one()
608 s->x = 0; in vc_put_one()
611 y1 = (s->y_base + s->y) % s->total_height; in vc_put_one()
612 c = &s->cells[y1 * s->width + s->x]; in vc_put_one()
613 c->ch = ch; in vc_put_one()
614 c->t_attrib = vc->t_attrib; in vc_put_one()
615 vc_update_xy(vc, s->x, s->y); in vc_put_one()
616 s->x++; in vc_put_one()
621 QemuTextConsole *s = vc->console; in vc_respond_str()
623 qemu_chr_be_write(s->chr, (const uint8_t *)buf, strlen(buf)); in vc_respond_str()
627 static void vc_set_cursor(VCChardev *vc, int x, int y) in vc_set_cursor() argument
629 QemuTextConsole *s = vc->console; in vc_set_cursor()
631 if (x < 0) { in vc_set_cursor()
632 x = 0; in vc_set_cursor()
634 if (y < 0) { in vc_set_cursor()
635 y = 0; in vc_set_cursor()
637 if (y >= s->height) { in vc_set_cursor()
638 y = s->height - 1; in vc_set_cursor()
640 if (x >= s->width) { in vc_set_cursor()
641 x = s->width - 1; in vc_set_cursor()
644 s->x = x; in vc_set_cursor()
645 s->y = y; in vc_set_cursor()
649 * vc_csi_P() - (DCH) deletes one or more characters from the cursor
656 QemuTextConsole *s = vc->console; in vc_csi_P()
658 unsigned int x1, x2, y; in vc_csi_P() local
664 if (nr > s->width - s->x) { in vc_csi_P()
665 nr = s->width - s->x; in vc_csi_P()
671 x1 = s->x; in vc_csi_P()
672 x2 = s->x + nr; in vc_csi_P()
673 len = s->width - x2; in vc_csi_P()
675 y = (s->y_base + s->y) % s->total_height; in vc_csi_P()
676 c1 = &s->cells[y * s->width + x1]; in vc_csi_P()
677 c2 = &s->cells[y * s->width + x2]; in vc_csi_P()
680 vc_update_xy(vc, x1, s->y); in vc_csi_P()
684 for (; x1 < s->width; x1++) { in vc_csi_P()
685 vc_clear_xy(vc, x1, s->y); in vc_csi_P()
690 * vc_csi_at() - (ICH) inserts `nr` blank characters with the default
697 QemuTextConsole *s = vc->console; in vc_csi_at()
699 unsigned int x1, x2, y; in vc_csi_at() local
705 if (nr > s->width - s->x) { in vc_csi_at()
706 nr = s->width - s->x; in vc_csi_at()
712 x1 = s->x + nr; in vc_csi_at()
713 x2 = s->x; in vc_csi_at()
714 len = s->width - x1; in vc_csi_at()
716 y = (s->y_base + s->y) % s->total_height; in vc_csi_at()
717 c1 = &s->cells[y * s->width + x1]; in vc_csi_at()
718 c2 = &s->cells[y * s->width + x2]; in vc_csi_at()
721 vc_update_xy(vc, x1, s->y); in vc_csi_at()
725 for (x1 = s->x; x1 < s->x + nr; x1++) { in vc_csi_at()
726 vc_clear_xy(vc, x1, s->y); in vc_csi_at()
731 * vc_save_cursor() - saves cursor position and character attributes.
735 QemuTextConsole *s = vc->console; in vc_save_cursor()
737 vc->x_saved = s->x; in vc_save_cursor()
738 vc->y_saved = s->y; in vc_save_cursor()
739 vc->t_attrib_saved = vc->t_attrib; in vc_save_cursor()
743 * vc_restore_cursor() - restores cursor position and character
748 QemuTextConsole *s = vc->console; in vc_restore_cursor()
750 s->x = vc->x_saved; in vc_restore_cursor()
751 s->y = vc->y_saved; in vc_restore_cursor()
752 vc->t_attrib = vc->t_attrib_saved; in vc_restore_cursor()
757 QemuTextConsole *s = vc->console; in vc_putchar()
759 int x, y; in vc_putchar() local
762 switch(vc->state) { in vc_putchar()
766 s->x = 0; in vc_putchar()
772 if (s->x > 0) in vc_putchar()
773 s->x--; in vc_putchar()
776 if (s->x + (8 - (s->x % 8)) > s->width) { in vc_putchar()
777 s->x = 0; in vc_putchar()
780 s->x = s->x + (8 - (s->x % 8)); in vc_putchar()
793 vc->state = TTY_STATE_ESC; in vc_putchar()
803 vc->esc_params[i] = 0; in vc_putchar()
804 vc->nb_esc_params = 0; in vc_putchar()
805 vc->state = TTY_STATE_CSI; in vc_putchar()
807 vc->state = TTY_STATE_G0; in vc_putchar()
809 vc->state = TTY_STATE_G1; in vc_putchar()
812 vc->state = TTY_STATE_NORM; in vc_putchar()
815 vc->state = TTY_STATE_NORM; in vc_putchar()
817 vc->state = TTY_STATE_NORM; in vc_putchar()
822 if (vc->nb_esc_params < MAX_ESC_PARAMS) { in vc_putchar()
823 int *param = &vc->esc_params[vc->nb_esc_params]; in vc_putchar()
824 int digit = (ch - '0'); in vc_putchar()
826 *param = (*param <= (INT_MAX - digit) / 10) ? in vc_putchar()
830 if (vc->nb_esc_params < MAX_ESC_PARAMS) in vc_putchar()
831 vc->nb_esc_params++; in vc_putchar()
835 trace_console_putchar_csi(vc->esc_params[0], vc->esc_params[1], in vc_putchar()
836 ch, vc->nb_esc_params); in vc_putchar()
837 vc->state = TTY_STATE_NORM; in vc_putchar()
841 if (vc->esc_params[0] == 0) { in vc_putchar()
842 vc->esc_params[0] = 1; in vc_putchar()
844 vc_set_cursor(vc, s->x, s->y - vc->esc_params[0]); in vc_putchar()
848 if (vc->esc_params[0] == 0) { in vc_putchar()
849 vc->esc_params[0] = 1; in vc_putchar()
851 vc_set_cursor(vc, s->x, s->y + vc->esc_params[0]); in vc_putchar()
855 if (vc->esc_params[0] == 0) { in vc_putchar()
856 vc->esc_params[0] = 1; in vc_putchar()
858 vc_set_cursor(vc, s->x + vc->esc_params[0], s->y); in vc_putchar()
862 if (vc->esc_params[0] == 0) { in vc_putchar()
863 vc->esc_params[0] = 1; in vc_putchar()
865 vc_set_cursor(vc, s->x - vc->esc_params[0], s->y); in vc_putchar()
869 vc_set_cursor(vc, vc->esc_params[0] - 1, s->y); in vc_putchar()
874 vc_set_cursor(vc, vc->esc_params[1] - 1, vc->esc_params[0] - 1); in vc_putchar()
877 switch (vc->esc_params[0]) { in vc_putchar()
880 for (y = s->y; y < s->height; y++) { in vc_putchar()
881 for (x = 0; x < s->width; x++) { in vc_putchar()
882 if (y == s->y && x < s->x) { in vc_putchar()
885 vc_clear_xy(vc, x, y); in vc_putchar()
891 for (y = 0; y <= s->y; y++) { in vc_putchar()
892 for (x = 0; x < s->width; x++) { in vc_putchar()
893 if (y == s->y && x > s->x) { in vc_putchar()
896 vc_clear_xy(vc, x, y); in vc_putchar()
902 for (y = 0; y <= s->height; y++) { in vc_putchar()
903 for (x = 0; x < s->width; x++) { in vc_putchar()
904 vc_clear_xy(vc, x, y); in vc_putchar()
911 switch (vc->esc_params[0]) { in vc_putchar()
914 for(x = s->x; x < s->width; x++) { in vc_putchar()
915 vc_clear_xy(vc, x, s->y); in vc_putchar()
920 for (x = 0; x <= s->x && x < s->width; x++) { in vc_putchar()
921 vc_clear_xy(vc, x, s->y); in vc_putchar()
926 for(x = 0; x < s->width; x++) { in vc_putchar()
927 vc_clear_xy(vc, x, s->y); in vc_putchar()
933 vc_csi_P(vc, vc->esc_params[0]); in vc_putchar()
939 switch (vc->esc_params[0]) { in vc_putchar()
947 s->y + 1, s->x + 1); in vc_putchar()
959 vc_csi_at(vc, vc->esc_params[0]); in vc_putchar()
972 /* Latin-1 map */ in vc_putchar()
975 vc->state = TTY_STATE_NORM; in vc_putchar()
980 #define TYPE_CHARDEV_VC "chardev-vc"
987 QemuTextConsole *s = drv->console; in DECLARE_INSTANCE_CHECKER()
990 s->update_x0 = s->width * FONT_WIDTH; in DECLARE_INSTANCE_CHECKER()
991 s->update_y0 = s->height * FONT_HEIGHT; in DECLARE_INSTANCE_CHECKER()
992 s->update_x1 = 0; in DECLARE_INSTANCE_CHECKER()
993 s->update_y1 = 0; in DECLARE_INSTANCE_CHECKER()
999 if (s->update_x0 < s->update_x1) { in DECLARE_INSTANCE_CHECKER()
1000 dpy_gfx_update(QEMU_CONSOLE(s), s->update_x0, s->update_y0, in DECLARE_INSTANCE_CHECKER()
1001 s->update_x1 - s->update_x0, in DECLARE_INSTANCE_CHECKER()
1002 s->update_y1 - s->update_y0); in DECLARE_INSTANCE_CHECKER()
1056 fifo8_create(&c->out_fifo, 16); in qemu_text_console_init()
1057 c->total_height = DEFAULT_BACKSCROLL; in qemu_text_console_init()
1058 QEMU_CONSOLE(c)->hw_ops = &text_console_ops; in qemu_text_console_init()
1059 QEMU_CONSOLE(c)->hw = c; in qemu_text_console_init()
1081 kbd_send_chars(drv->console); in vc_chr_accept_input()
1088 drv->console->echo = echo; in vc_chr_set_echo()
1093 dpy_text_resize(QEMU_CONSOLE(c), c->width, c->height); in qemu_text_console_update_size()
1101 ChardevVC *vc = backend->u.vc.data; in vc_chr_open()
1107 if (vc->has_width) { in vc_chr_open()
1108 width = vc->width; in vc_chr_open()
1109 } else if (vc->has_cols) { in vc_chr_open()
1110 width = vc->cols * FONT_WIDTH; in vc_chr_open()
1113 if (vc->has_height) { in vc_chr_open()
1114 height = vc->height; in vc_chr_open()
1115 } else if (vc->has_rows) { in vc_chr_open()
1116 height = vc->rows * FONT_HEIGHT; in vc_chr_open()
1130 s->chr = chr; in vc_chr_open()
1131 drv->console = s; in vc_chr_open()
1134 drv->t_attrib = TEXT_ATTRIBUTES_DEFAULT; in vc_chr_open()
1137 if (chr->label) { in vc_chr_open()
1140 drv->t_attrib.bgcol = QEMU_COLOR_BLUE; in vc_chr_open()
1141 msg = g_strdup_printf("%s console\r\n", chr->label); in vc_chr_open()
1144 drv->t_attrib = TEXT_ATTRIBUTES_DEFAULT; in vc_chr_open()
1155 backend->type = CHARDEV_BACKEND_KIND_VC; in vc_chr_parse()
1156 vc = backend->u.vc.data = g_new0(ChardevVC, 1); in vc_chr_parse()
1161 vc->has_width = true; in vc_chr_parse()
1162 vc->width = val; in vc_chr_parse()
1167 vc->has_height = true; in vc_chr_parse()
1168 vc->height = val; in vc_chr_parse()
1173 vc->has_cols = true; in vc_chr_parse()
1174 vc->cols = val; in vc_chr_parse()
1179 vc->has_rows = true; in vc_chr_parse()
1180 vc->rows = val; in vc_chr_parse()
1188 cc->parse = vc_chr_parse; in char_vc_class_init()
1189 cc->open = vc_chr_open; in char_vc_class_init()
1190 cc->chr_write = vc_chr_write; in char_vc_class_init()
1191 cc->chr_accept_input = vc_chr_accept_input; in char_vc_class_init()
1192 cc->chr_set_echo = vc_chr_set_echo; in char_vc_class_init()