Commit c60e08d9c6bbace33c04dab2b5cacbc42e2e3d47
1 parent
ea334207
Implement resolution switching in common console code.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4812 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
20 changed files
with
109 additions
and
91 deletions
console.c
... | ... | @@ -28,6 +28,7 @@ |
28 | 28 | //#define DEBUG_CONSOLE |
29 | 29 | #define DEFAULT_BACKSCROLL 512 |
30 | 30 | #define MAX_CONSOLES 12 |
31 | +#define DEFAULT_MONITOR_SIZE "800x600" | |
31 | 32 | |
32 | 33 | #define QEMU_RGBA(r, g, b, a) (((a) << 24) | ((r) << 16) | ((g) << 8) | (b)) |
33 | 34 | #define QEMU_RGB(r, g, b) QEMU_RGBA(r, g, b, 0xff) |
... | ... | @@ -108,8 +109,7 @@ static int qemu_fifo_read(QEMUFIFO *f, uint8_t *buf, int len1) |
108 | 109 | |
109 | 110 | typedef enum { |
110 | 111 | GRAPHIC_CONSOLE, |
111 | - TEXT_CONSOLE, | |
112 | - TEXT_CONSOLE_FIXED_SIZE | |
112 | + TEXT_CONSOLE | |
113 | 113 | } console_type_t; |
114 | 114 | |
115 | 115 | /* ??? This is mis-named. |
... | ... | @@ -1041,6 +1041,9 @@ void console_select(unsigned int index) |
1041 | 1041 | s = consoles[index]; |
1042 | 1042 | if (s) { |
1043 | 1043 | active_console = s; |
1044 | + if (s->g_width && s->g_height | |
1045 | + && (s->g_width != s->ds->width || s->g_height != s->ds->height)) | |
1046 | + dpy_resize(s->ds, s->g_width, s->g_height); | |
1044 | 1047 | vga_hw_invalidate(); |
1045 | 1048 | } |
1046 | 1049 | } |
... | ... | @@ -1149,18 +1152,6 @@ static void text_console_invalidate(void *opaque) |
1149 | 1152 | { |
1150 | 1153 | TextConsole *s = (TextConsole *) opaque; |
1151 | 1154 | |
1152 | - if (s->console_type != GRAPHIC_CONSOLE) { | |
1153 | - if (s->g_width != s->ds->width || | |
1154 | - s->g_height != s->ds->height) { | |
1155 | - if (s->console_type == TEXT_CONSOLE_FIXED_SIZE) | |
1156 | - dpy_resize(s->ds, s->g_width, s->g_height); | |
1157 | - else { | |
1158 | - s->g_width = s->ds->width; | |
1159 | - s->g_height = s->ds->height; | |
1160 | - text_console_resize(s); | |
1161 | - } | |
1162 | - } | |
1163 | - } | |
1164 | 1155 | console_refresh(s); |
1165 | 1156 | } |
1166 | 1157 | |
... | ... | @@ -1268,11 +1259,14 @@ CharDriverState *text_console_init(DisplayState *ds, const char *p) |
1268 | 1259 | chr = qemu_mallocz(sizeof(CharDriverState)); |
1269 | 1260 | if (!chr) |
1270 | 1261 | return NULL; |
1271 | - s = new_console(ds, (p == 0) ? TEXT_CONSOLE : TEXT_CONSOLE_FIXED_SIZE); | |
1262 | + s = new_console(ds, TEXT_CONSOLE); | |
1272 | 1263 | if (!s) { |
1273 | 1264 | free(chr); |
1274 | 1265 | return NULL; |
1275 | 1266 | } |
1267 | + if (!p) | |
1268 | + p = DEFAULT_MONITOR_SIZE; | |
1269 | + | |
1276 | 1270 | chr->opaque = s; |
1277 | 1271 | chr->chr_write = console_puts; |
1278 | 1272 | chr->chr_send_event = console_send_event; |
... | ... | @@ -1332,3 +1326,14 @@ CharDriverState *text_console_init(DisplayState *ds, const char *p) |
1332 | 1326 | |
1333 | 1327 | return chr; |
1334 | 1328 | } |
1329 | + | |
1330 | +void qemu_console_resize(QEMUConsole *console, int width, int height) | |
1331 | +{ | |
1332 | + if (console->g_width != width || console->g_height != height) { | |
1333 | + console->g_width = width; | |
1334 | + console->g_height = height; | |
1335 | + if (active_console == console) { | |
1336 | + dpy_resize(console->ds, width, height); | |
1337 | + } | |
1338 | + } | |
1339 | +} | ... | ... |
console.h
... | ... | @@ -135,6 +135,7 @@ int is_graphic_console(void); |
135 | 135 | CharDriverState *text_console_init(DisplayState *ds, const char *p); |
136 | 136 | void console_select(unsigned int index); |
137 | 137 | void console_color_init(DisplayState *ds); |
138 | +void qemu_console_resize(QEMUConsole *console, int width, int height); | |
138 | 139 | |
139 | 140 | /* sdl.c */ |
140 | 141 | void sdl_display_init(DisplayState *ds, int full_screen, int no_frame); | ... | ... |
hw/blizzard.c
... | ... | @@ -73,6 +73,7 @@ struct blizzard_s { |
73 | 73 | uint8_t iformat; |
74 | 74 | uint8_t source; |
75 | 75 | DisplayState *state; |
76 | + QEMUConsole *console; | |
76 | 77 | blizzard_fn_t *line_fn_tab[2]; |
77 | 78 | void *fb; |
78 | 79 | |
... | ... | @@ -896,7 +897,7 @@ static void blizzard_update_display(void *opaque) |
896 | 897 | |
897 | 898 | if (s->x != s->state->width || s->y != s->state->height) { |
898 | 899 | s->invalidate = 1; |
899 | - dpy_resize(s->state, s->x, s->y); | |
900 | + qemu_console_resize(s->console, s->x, s->y); | |
900 | 901 | } |
901 | 902 | |
902 | 903 | if (s->invalidate) { |
... | ... | @@ -993,9 +994,9 @@ void *s1d13745_init(qemu_irq gpio_int, DisplayState *ds) |
993 | 994 | |
994 | 995 | blizzard_reset(s); |
995 | 996 | |
996 | - graphic_console_init(s->state, blizzard_update_display, | |
997 | - blizzard_invalidate_display, blizzard_screen_dump, | |
998 | - NULL, s); | |
997 | + s->console = graphic_console_init(s->state, blizzard_update_display, | |
998 | + blizzard_invalidate_display, | |
999 | + blizzard_screen_dump, NULL, s); | |
999 | 1000 | |
1000 | 1001 | return s; |
1001 | 1002 | } | ... | ... |
hw/cirrus_vga.c
... | ... | @@ -3288,8 +3288,8 @@ void pci_cirrus_vga_init(PCIBus *bus, DisplayState *ds, uint8_t *vga_ram_base, |
3288 | 3288 | ds, vga_ram_base, vga_ram_offset, vga_ram_size); |
3289 | 3289 | cirrus_init_common(s, device_id, 1); |
3290 | 3290 | |
3291 | - graphic_console_init(s->ds, s->update, s->invalidate, s->screen_dump, | |
3292 | - s->text_update, s); | |
3291 | + s->console = graphic_console_init(s->ds, s->update, s->invalidate, | |
3292 | + s->screen_dump, s->text_update, s); | |
3293 | 3293 | |
3294 | 3294 | s->pci_dev = (PCIDevice *)d; |
3295 | 3295 | ... | ... |
hw/g364fb.c
... | ... | @@ -33,6 +33,7 @@ typedef struct G364State { |
33 | 33 | uint8_t palette[256][3]; |
34 | 34 | /* display refresh support */ |
35 | 35 | DisplayState *ds; |
36 | + QEMUConsole *console; | |
36 | 37 | int graphic_mode; |
37 | 38 | uint32_t scr_width, scr_height; /* in pixels */ |
38 | 39 | uint32_t last_scr_width, last_scr_height; /* in pixels */ |
... | ... | @@ -74,13 +75,6 @@ static void g364fb_draw_graphic(G364State *s, int full_update) |
74 | 75 | { |
75 | 76 | if (s->scr_width == 0 || s->scr_height == 0) |
76 | 77 | return; |
77 | - if (s->scr_width != s->last_scr_width | |
78 | - || s->scr_height != s->last_scr_height) { | |
79 | - s->last_scr_width = s->scr_width; | |
80 | - s->last_scr_height = s->scr_height; | |
81 | - dpy_resize(s->ds, s->last_scr_width, s->last_scr_height); | |
82 | - full_update = 1; | |
83 | - } | |
84 | 78 | |
85 | 79 | switch (s->ds->depth) { |
86 | 80 | case 8: |
... | ... | @@ -272,7 +266,10 @@ static void g364fb_ctrl_writeb(void *opaque, target_phys_addr_t addr, uint32_t v |
272 | 266 | #endif |
273 | 267 | break; |
274 | 268 | } |
269 | + if (s->scr_width && s->scr_height) | |
270 | + qemu_console_resize(s->console, s->scr_width, s->scr_height); | |
275 | 271 | } |
272 | + s->graphic_mode = -1; /* force full update */ | |
276 | 273 | } |
277 | 274 | |
278 | 275 | static void g364fb_ctrl_writew(void *opaque, target_phys_addr_t addr, uint32_t val) |
... | ... | @@ -382,9 +379,9 @@ int g364fb_mm_init(DisplayState *ds, |
382 | 379 | s->ds = ds; |
383 | 380 | s->vram_base = vram_base; |
384 | 381 | |
385 | - graphic_console_init(ds, g364fb_update_display, | |
386 | - g364fb_invalidate_display, g364fb_screen_dump, | |
387 | - NULL, s); | |
382 | + s->console = graphic_console_init(ds, g364fb_update_display, | |
383 | + g364fb_invalidate_display, | |
384 | + g364fb_screen_dump, NULL, s); | |
388 | 385 | |
389 | 386 | io_vram = cpu_register_io_memory(0, g364fb_mem_read, g364fb_mem_write, s); |
390 | 387 | cpu_register_physical_memory(s->vram_base, vram_size, io_vram); | ... | ... |
hw/jazz_led.c
... | ... | @@ -37,6 +37,7 @@ typedef struct LedState { |
37 | 37 | target_phys_addr_t base; |
38 | 38 | uint8_t segments; |
39 | 39 | DisplayState *ds; |
40 | + QEMUConsole *console; | |
40 | 41 | screen_state_t state; |
41 | 42 | } LedState; |
42 | 43 | |
... | ... | @@ -291,7 +292,7 @@ static void jazz_led_text_update(void *opaque, console_ch_t *chardata) |
291 | 292 | char buf[2]; |
292 | 293 | |
293 | 294 | dpy_cursor(s->ds, -1, -1); |
294 | - dpy_resize(s->ds, 2, 1); | |
295 | + qemu_console_resize(s->console, 2, 1); | |
295 | 296 | |
296 | 297 | /* TODO: draw the segments */ |
297 | 298 | snprintf(buf, 2, "%02hhx\n", s->segments); |
... | ... | @@ -317,7 +318,9 @@ void jazz_led_init(DisplayState *ds, target_phys_addr_t base) |
317 | 318 | io = cpu_register_io_memory(0, led_read, led_write, s); |
318 | 319 | cpu_register_physical_memory(s->base, 1, io); |
319 | 320 | |
320 | - graphic_console_init(ds, jazz_led_update_display, | |
321 | - jazz_led_invalidate_display, jazz_led_screen_dump, | |
322 | - jazz_led_text_update, s); | |
321 | + s->console = graphic_console_init(ds, jazz_led_update_display, | |
322 | + jazz_led_invalidate_display, | |
323 | + jazz_led_screen_dump, | |
324 | + jazz_led_text_update, s); | |
325 | + qemu_console_resize(s->console, 60, 80); | |
323 | 326 | } | ... | ... |
hw/musicpal.c
... | ... | @@ -758,8 +758,8 @@ typedef struct musicpal_lcd_state { |
758 | 758 | int page; |
759 | 759 | int page_off; |
760 | 760 | DisplayState *ds; |
761 | + QEMUConsole *console; | |
761 | 762 | uint8_t video_ram[128*64/8]; |
762 | - int invalidate; | |
763 | 763 | } musicpal_lcd_state; |
764 | 764 | |
765 | 765 | static uint32_t lcd_brightness; |
... | ... | @@ -818,11 +818,6 @@ static void lcd_refresh(void *opaque) |
818 | 818 | musicpal_lcd_state *s = opaque; |
819 | 819 | int x, y, col; |
820 | 820 | |
821 | - if (s->invalidate && (s->ds->width != 128*3 || s->ds->height != 64*3)) { | |
822 | - dpy_resize(s->ds, 128*3, 64*3); | |
823 | - s->invalidate = 0; | |
824 | - } | |
825 | - | |
826 | 821 | switch (s->ds->depth) { |
827 | 822 | case 0: |
828 | 823 | return; |
... | ... | @@ -851,9 +846,6 @@ static void lcd_refresh(void *opaque) |
851 | 846 | |
852 | 847 | static void lcd_invalidate(void *opaque) |
853 | 848 | { |
854 | - musicpal_lcd_state *s = opaque; | |
855 | - | |
856 | - s->invalidate = 1; | |
857 | 849 | } |
858 | 850 | |
859 | 851 | static uint32_t musicpal_lcd_read(void *opaque, target_phys_addr_t offset) |
... | ... | @@ -932,12 +924,13 @@ static void musicpal_lcd_init(DisplayState *ds, uint32_t base) |
932 | 924 | return; |
933 | 925 | s->base = base; |
934 | 926 | s->ds = ds; |
935 | - s->invalidate = 1; | |
936 | 927 | iomemtype = cpu_register_io_memory(0, musicpal_lcd_readfn, |
937 | 928 | musicpal_lcd_writefn, s); |
938 | 929 | cpu_register_physical_memory(base, MP_LCD_SIZE, iomemtype); |
939 | 930 | |
940 | - graphic_console_init(ds, lcd_refresh, lcd_invalidate, NULL, NULL, s); | |
931 | + s->console = graphic_console_init(ds, lcd_refresh, lcd_invalidate, | |
932 | + NULL, NULL, s); | |
933 | + qemu_console_resize(s->console, 128*3, 64*3); | |
941 | 934 | } |
942 | 935 | |
943 | 936 | /* PIC register offsets */ | ... | ... |
hw/nseries.c
... | ... | @@ -1307,7 +1307,9 @@ static void n8x0_init(ram_addr_t ram_size, const char *boot_device, |
1307 | 1307 | |
1308 | 1308 | n800_setup_nolo_tags(phys_ram_base + sdram_size); |
1309 | 1309 | } |
1310 | - | |
1310 | + /* FIXME: We shouldn't really be doing this here. The LCD controller | |
1311 | + will set the size once configured, so this just sets an initial | |
1312 | + size until the guest activates the display. */ | |
1311 | 1313 | dpy_resize(ds, 800, 480); |
1312 | 1314 | } |
1313 | 1315 | ... | ... |
hw/omap_lcdc.c
... | ... | @@ -26,6 +26,7 @@ struct omap_lcd_panel_s { |
26 | 26 | target_phys_addr_t base; |
27 | 27 | qemu_irq irq; |
28 | 28 | DisplayState *state; |
29 | + QEMUConsole *console; | |
29 | 30 | ram_addr_t imif_base; |
30 | 31 | ram_addr_t emiff_base; |
31 | 32 | |
... | ... | @@ -175,8 +176,8 @@ static void omap_update_display(void *opaque) |
175 | 176 | width = omap_lcd->width; |
176 | 177 | if (width != omap_lcd->state->width || |
177 | 178 | omap_lcd->height != omap_lcd->state->height) { |
178 | - dpy_resize(omap_lcd->state, | |
179 | - omap_lcd->width, omap_lcd->height); | |
179 | + qemu_console_resize(omap_lcd->console, | |
180 | + omap_lcd->width, omap_lcd->height); | |
180 | 181 | omap_lcd->invalidate = 1; |
181 | 182 | } |
182 | 183 | |
... | ... | @@ -494,8 +495,9 @@ struct omap_lcd_panel_s *omap_lcdc_init(target_phys_addr_t base, qemu_irq irq, |
494 | 495 | omap_lcdc_writefn, s); |
495 | 496 | cpu_register_physical_memory(s->base, 0x100, iomemtype); |
496 | 497 | |
497 | - graphic_console_init(ds, omap_update_display, | |
498 | - omap_invalidate_display, omap_screen_dump, NULL, s); | |
498 | + s->console = graphic_console_init(ds, omap_update_display, | |
499 | + omap_invalidate_display, | |
500 | + omap_screen_dump, NULL, s); | |
499 | 501 | |
500 | 502 | return s; |
501 | 503 | } | ... | ... |
hw/palm.c
... | ... | @@ -275,6 +275,9 @@ static void palmte_init(ram_addr_t ram_size, int vga_ram_size, |
275 | 275 | arm_load_kernel(cpu->env, &palmte_binfo); |
276 | 276 | } |
277 | 277 | |
278 | + /* FIXME: We shouldn't really be doing this here. The LCD controller | |
279 | + will set the size once configured, so this just sets an initial | |
280 | + size until the guest activates the display. */ | |
278 | 281 | dpy_resize(ds, 320, 320); |
279 | 282 | } |
280 | 283 | ... | ... |
hw/pl110.c
... | ... | @@ -30,6 +30,8 @@ enum pl110_bppmode |
30 | 30 | typedef struct { |
31 | 31 | uint32_t base; |
32 | 32 | DisplayState *ds; |
33 | + QEMUConsole *console; | |
34 | + | |
33 | 35 | /* The Versatile/PB uses a slightly modified PL110 controller. */ |
34 | 36 | int versatile; |
35 | 37 | uint32_t timing[4]; |
... | ... | @@ -270,7 +272,7 @@ static void pl110_resize(pl110_state *s, int width, int height) |
270 | 272 | { |
271 | 273 | if (width != s->cols || height != s->rows) { |
272 | 274 | if (pl110_enabled(s)) { |
273 | - dpy_resize(s->ds, width, height); | |
275 | + qemu_console_resize(s->console, width, height); | |
274 | 276 | } |
275 | 277 | } |
276 | 278 | s->cols = width; |
... | ... | @@ -387,7 +389,7 @@ static void pl110_write(void *opaque, target_phys_addr_t offset, |
387 | 389 | s->cr = val; |
388 | 390 | s->bpp = (val >> 1) & 7; |
389 | 391 | if (pl110_enabled(s)) { |
390 | - dpy_resize(s->ds, s->cols, s->rows); | |
392 | + qemu_console_resize(s->console, s->cols, s->rows); | |
391 | 393 | } |
392 | 394 | break; |
393 | 395 | case 10: /* LCDICR */ |
... | ... | @@ -425,8 +427,9 @@ void *pl110_init(DisplayState *ds, uint32_t base, qemu_irq irq, |
425 | 427 | s->ds = ds; |
426 | 428 | s->versatile = versatile; |
427 | 429 | s->irq = irq; |
428 | - graphic_console_init(ds, pl110_update_display, pl110_invalidate_display, | |
429 | - NULL, NULL, s); | |
430 | + s->console = graphic_console_init(ds, pl110_update_display, | |
431 | + pl110_invalidate_display, | |
432 | + NULL, NULL, s); | |
430 | 433 | /* ??? Save/restore. */ |
431 | 434 | return s; |
432 | 435 | } | ... | ... |
hw/pxa2xx_lcd.c
... | ... | @@ -23,6 +23,7 @@ struct pxa2xx_lcdc_s { |
23 | 23 | |
24 | 24 | int invalidated; |
25 | 25 | DisplayState *ds; |
26 | + QEMUConsole *console; | |
26 | 27 | drawfn *line_fn[2]; |
27 | 28 | int dest_width; |
28 | 29 | int xres, yres; |
... | ... | @@ -794,9 +795,9 @@ static void pxa2xx_lcdc_resize(struct pxa2xx_lcdc_s *s) |
794 | 795 | |
795 | 796 | if (width != s->xres || height != s->yres) { |
796 | 797 | if (s->orientation) |
797 | - dpy_resize(s->ds, height, width); | |
798 | + qemu_console_resize(s->console, height, width); | |
798 | 799 | else |
799 | - dpy_resize(s->ds, width, height); | |
800 | + qemu_console_resize(s->console, width, height); | |
800 | 801 | s->invalidated = 1; |
801 | 802 | s->xres = width; |
802 | 803 | s->yres = height; |
... | ... | @@ -1001,8 +1002,9 @@ struct pxa2xx_lcdc_s *pxa2xx_lcdc_init(target_phys_addr_t base, qemu_irq irq, |
1001 | 1002 | pxa2xx_lcdc_writefn, s); |
1002 | 1003 | cpu_register_physical_memory(base, 0x00100000, iomemtype); |
1003 | 1004 | |
1004 | - graphic_console_init(ds, pxa2xx_update_display, | |
1005 | - pxa2xx_invalidate_display, pxa2xx_screen_dump, NULL, s); | |
1005 | + s->console = graphic_console_init(ds, pxa2xx_update_display, | |
1006 | + pxa2xx_invalidate_display, | |
1007 | + pxa2xx_screen_dump, NULL, s); | |
1006 | 1008 | |
1007 | 1009 | switch (s->ds->depth) { |
1008 | 1010 | case 0: | ... | ... |
hw/ssd0303.c
... | ... | @@ -45,6 +45,7 @@ enum ssd0303_cmd { |
45 | 45 | typedef struct { |
46 | 46 | i2c_slave i2c; |
47 | 47 | DisplayState *ds; |
48 | + QEMUConsole *console; | |
48 | 49 | int row; |
49 | 50 | int col; |
50 | 51 | int start_line; |
... | ... | @@ -269,7 +270,8 @@ void ssd0303_init(DisplayState *ds, i2c_bus *bus, int address) |
269 | 270 | s->i2c.event = ssd0303_event; |
270 | 271 | s->i2c.recv = ssd0303_recv; |
271 | 272 | s->i2c.send = ssd0303_send; |
272 | - graphic_console_init(ds, ssd0303_update_display, ssd0303_invalidate_display, | |
273 | - NULL, NULL, s); | |
274 | - dpy_resize(s->ds, 96 * MAGNIFY, 16 * MAGNIFY); | |
273 | + s->console = graphic_console_init(ds, ssd0303_update_display, | |
274 | + ssd0303_invalidate_display, | |
275 | + NULL, NULL, s); | |
276 | + qemu_console_resize(s->console, 96 * MAGNIFY, 16 * MAGNIFY); | |
275 | 277 | } | ... | ... |
hw/ssd0323.c
... | ... | @@ -44,6 +44,7 @@ enum ssd0323_mode |
44 | 44 | |
45 | 45 | typedef struct { |
46 | 46 | DisplayState *ds; |
47 | + QEMUConsole *console; | |
47 | 48 | |
48 | 49 | int cmd_len; |
49 | 50 | int cmd; |
... | ... | @@ -278,12 +279,13 @@ void *ssd0323_init(DisplayState *ds, qemu_irq *cmd_p) |
278 | 279 | qemu_irq *cmd; |
279 | 280 | |
280 | 281 | s = (ssd0323_state *)qemu_mallocz(sizeof(ssd0323_state)); |
281 | - s->ds = ds; | |
282 | - graphic_console_init(ds, ssd0323_update_display, ssd0323_invalidate_display, | |
283 | - NULL, NULL, s); | |
284 | - dpy_resize(s->ds, 128 * MAGNIFY, 64 * MAGNIFY); | |
285 | 282 | s->col_end = 63; |
286 | 283 | s->row_end = 79; |
284 | + s->ds = ds; | |
285 | + s->console = graphic_console_init(ds, ssd0323_update_display, | |
286 | + ssd0323_invalidate_display, | |
287 | + NULL, NULL, s); | |
288 | + qemu_console_resize(s->console, 128 * MAGNIFY, 64 * MAGNIFY); | |
287 | 289 | |
288 | 290 | cmd = qemu_allocate_irqs(ssd0323_cd, s, 1); |
289 | 291 | *cmd_p = *cmd; | ... | ... |
hw/tcx.c
... | ... | @@ -36,6 +36,7 @@ |
36 | 36 | typedef struct TCXState { |
37 | 37 | target_phys_addr_t addr; |
38 | 38 | DisplayState *ds; |
39 | + QEMUConsole *console; | |
39 | 40 | uint8_t *vram; |
40 | 41 | uint32_t *vram24, *cplane; |
41 | 42 | ram_addr_t vram_offset, vram24_offset, cplane_offset; |
... | ... | @@ -186,8 +187,6 @@ static void tcx_update_display(void *opaque) |
186 | 187 | |
187 | 188 | if (ts->ds->depth == 0) |
188 | 189 | return; |
189 | - if (ts->ds->width != ts->width || ts->ds->height != ts->height) | |
190 | - dpy_resize(ts->ds, ts->width, ts->height); | |
191 | 190 | page = ts->vram_offset; |
192 | 191 | y_start = -1; |
193 | 192 | page_min = 0xffffffff; |
... | ... | @@ -266,8 +265,6 @@ static void tcx24_update_display(void *opaque) |
266 | 265 | |
267 | 266 | if (ts->ds->depth != 32) |
268 | 267 | return; |
269 | - if (ts->ds->width != ts->width || ts->ds->height != ts->height) | |
270 | - dpy_resize(ts->ds, ts->width, ts->height); | |
271 | 268 | page = ts->vram_offset; |
272 | 269 | page24 = ts->vram24_offset; |
273 | 270 | cpage = ts->cplane_offset; |
... | ... | @@ -541,14 +538,15 @@ void tcx_init(DisplayState *ds, target_phys_addr_t addr, uint8_t *vram_base, |
541 | 538 | s->cplane = (uint32_t *)vram_base; |
542 | 539 | s->cplane_offset = vram_offset; |
543 | 540 | cpu_register_physical_memory(addr + 0x0a000000ULL, size, vram_offset); |
544 | - graphic_console_init(s->ds, tcx24_update_display, | |
545 | - tcx24_invalidate_display, | |
546 | - tcx24_screen_dump, NULL, s); | |
541 | + s->console = graphic_console_init(s->ds, tcx24_update_display, | |
542 | + tcx24_invalidate_display, | |
543 | + tcx24_screen_dump, NULL, s); | |
547 | 544 | } else { |
548 | 545 | cpu_register_physical_memory(addr + 0x00300000ULL, TCX_THC_NREGS_8, |
549 | 546 | dummy_memory); |
550 | - graphic_console_init(s->ds, tcx_update_display, tcx_invalidate_display, | |
551 | - tcx_screen_dump, NULL, s); | |
547 | + s->console = graphic_console_init(s->ds, tcx_update_display, | |
548 | + tcx_invalidate_display, | |
549 | + tcx_screen_dump, NULL, s); | |
552 | 550 | } |
553 | 551 | // NetBSD writes here even with 8-bit display |
554 | 552 | cpu_register_physical_memory(addr + 0x00301000ULL, TCX_THC_NREGS_24, |
... | ... | @@ -557,7 +555,7 @@ void tcx_init(DisplayState *ds, target_phys_addr_t addr, uint8_t *vram_base, |
557 | 555 | register_savevm("tcx", addr, 4, tcx_save, tcx_load, s); |
558 | 556 | qemu_register_reset(tcx_reset, s); |
559 | 557 | tcx_reset(s); |
560 | - dpy_resize(s->ds, width, height); | |
558 | + qemu_console_resize(s->console, width, height); | |
561 | 559 | } |
562 | 560 | |
563 | 561 | static void tcx_screen_dump(void *opaque, const char *filename) | ... | ... |
hw/vga.c
... | ... | @@ -1155,7 +1155,7 @@ static void vga_draw_text(VGAState *s, int full_update) |
1155 | 1155 | cw != s->last_cw || cheight != s->last_ch) { |
1156 | 1156 | s->last_scr_width = width * cw; |
1157 | 1157 | s->last_scr_height = height * cheight; |
1158 | - dpy_resize(s->ds, s->last_scr_width, s->last_scr_height); | |
1158 | + qemu_console_resize(s->console, s->last_scr_width, s->last_scr_height); | |
1159 | 1159 | s->last_width = width; |
1160 | 1160 | s->last_height = height; |
1161 | 1161 | s->last_ch = cheight; |
... | ... | @@ -1499,7 +1499,7 @@ static void vga_draw_graphic(VGAState *s, int full_update) |
1499 | 1499 | |
1500 | 1500 | if (disp_width != s->last_width || |
1501 | 1501 | height != s->last_height) { |
1502 | - dpy_resize(s->ds, disp_width, height); | |
1502 | + qemu_console_resize(s->console, disp_width, height); | |
1503 | 1503 | s->last_scr_width = disp_width; |
1504 | 1504 | s->last_scr_height = height; |
1505 | 1505 | s->last_width = disp_width; |
... | ... | @@ -1734,7 +1734,7 @@ static void vga_update_text(void *opaque, console_ch_t *chardata) |
1734 | 1734 | cw != s->last_cw || cheight != s->last_ch) { |
1735 | 1735 | s->last_scr_width = width * cw; |
1736 | 1736 | s->last_scr_height = height * cheight; |
1737 | - dpy_resize(s->ds, width, height); | |
1737 | + qemu_console_resize(s->console, width, height); | |
1738 | 1738 | s->last_width = width; |
1739 | 1739 | s->last_height = height; |
1740 | 1740 | s->last_ch = cheight; |
... | ... | @@ -1814,7 +1814,7 @@ static void vga_update_text(void *opaque, console_ch_t *chardata) |
1814 | 1814 | s->last_width = 60; |
1815 | 1815 | s->last_height = height = 3; |
1816 | 1816 | dpy_cursor(s->ds, -1, -1); |
1817 | - dpy_resize(s->ds, s->last_width, height); | |
1817 | + qemu_console_resize(s->console, s->last_width, height); | |
1818 | 1818 | |
1819 | 1819 | for (dst = chardata, i = 0; i < s->last_width * height; i ++) |
1820 | 1820 | console_write_ch(dst ++, ' '); |
... | ... | @@ -2140,8 +2140,8 @@ int isa_vga_init(DisplayState *ds, uint8_t *vga_ram_base, |
2140 | 2140 | vga_common_init(s, ds, vga_ram_base, vga_ram_offset, vga_ram_size); |
2141 | 2141 | vga_init(s); |
2142 | 2142 | |
2143 | - graphic_console_init(s->ds, s->update, s->invalidate, s->screen_dump, | |
2144 | - s->text_update, s); | |
2143 | + s->console = graphic_console_init(s->ds, s->update, s->invalidate, | |
2144 | + s->screen_dump, s->text_update, s); | |
2145 | 2145 | |
2146 | 2146 | #ifdef CONFIG_BOCHS_VBE |
2147 | 2147 | /* XXX: use optimized standard vga accesses */ |
... | ... | @@ -2165,8 +2165,8 @@ int isa_vga_mm_init(DisplayState *ds, uint8_t *vga_ram_base, |
2165 | 2165 | vga_common_init(s, ds, vga_ram_base, vga_ram_offset, vga_ram_size); |
2166 | 2166 | vga_mm_init(s, vram_base, ctrl_base, it_shift); |
2167 | 2167 | |
2168 | - graphic_console_init(s->ds, s->update, s->invalidate, s->screen_dump, | |
2169 | - s->text_update, s); | |
2168 | + s->console = graphic_console_init(s->ds, s->update, s->invalidate, | |
2169 | + s->screen_dump, s->text_update, s); | |
2170 | 2170 | |
2171 | 2171 | #ifdef CONFIG_BOCHS_VBE |
2172 | 2172 | /* XXX: use optimized standard vga accesses */ |
... | ... | @@ -2194,8 +2194,8 @@ int pci_vga_init(PCIBus *bus, DisplayState *ds, uint8_t *vga_ram_base, |
2194 | 2194 | vga_common_init(s, ds, vga_ram_base, vga_ram_offset, vga_ram_size); |
2195 | 2195 | vga_init(s); |
2196 | 2196 | |
2197 | - graphic_console_init(s->ds, s->update, s->invalidate, s->screen_dump, | |
2198 | - s->text_update, s); | |
2197 | + s->console = graphic_console_init(s->ds, s->update, s->invalidate, | |
2198 | + s->screen_dump, s->text_update, s); | |
2199 | 2199 | |
2200 | 2200 | s->pci_dev = &d->dev; |
2201 | 2201 | ... | ... |
hw/vga_int.h
hw/vmware_vga.c
... | ... | @@ -57,6 +57,7 @@ struct vmsvga_state_s { |
57 | 57 | |
58 | 58 | #ifndef EMBED_STDVGA |
59 | 59 | DisplayState *ds; |
60 | + QEMUConsole *console; | |
60 | 61 | int vram_size; |
61 | 62 | ram_addr_t vram_offset; |
62 | 63 | #endif |
... | ... | @@ -869,7 +870,7 @@ static inline void vmsvga_size(struct vmsvga_state_s *s) |
869 | 870 | if (s->new_width != s->width || s->new_height != s->height) { |
870 | 871 | s->width = s->new_width; |
871 | 872 | s->height = s->new_height; |
872 | - dpy_resize(s->ds, s->width, s->height); | |
873 | + qemu_console_resize(s->console, s->width, s->height); | |
873 | 874 | s->invalidated = 1; |
874 | 875 | } |
875 | 876 | } |
... | ... | @@ -1122,9 +1123,10 @@ static void vmsvga_init(struct vmsvga_state_s *s, DisplayState *ds, |
1122 | 1123 | |
1123 | 1124 | vmsvga_reset(s); |
1124 | 1125 | |
1125 | - graphic_console_init(ds, vmsvga_update_display, | |
1126 | - vmsvga_invalidate_display, vmsvga_screen_dump, | |
1127 | - vmsvga_text_update, s); | |
1126 | + s->console = graphic_console_init(ds, vmsvga_update_display, | |
1127 | + vmsvga_invalidate_display, | |
1128 | + vmsvga_screen_dump, | |
1129 | + vmsvga_text_update, s); | |
1128 | 1130 | |
1129 | 1131 | #ifdef EMBED_STDVGA |
1130 | 1132 | vga_common_init((VGAState *) s, ds, | ... | ... |
qemu-common.h
... | ... | @@ -119,6 +119,7 @@ typedef struct AudioState AudioState; |
119 | 119 | typedef struct BlockDriverState BlockDriverState; |
120 | 120 | typedef struct DisplayState DisplayState; |
121 | 121 | typedef struct TextConsole TextConsole; |
122 | +typedef TextConsole QEMUConsole; | |
122 | 123 | typedef struct CharDriverState CharDriverState; |
123 | 124 | typedef struct VLANState VLANState; |
124 | 125 | typedef struct QEMUFile QEMUFile; | ... | ... |
vl.c
... | ... | @@ -7935,7 +7935,7 @@ int main(int argc, char **argv) |
7935 | 7935 | kernel_cmdline = ""; |
7936 | 7936 | cyls = heads = secs = 0; |
7937 | 7937 | translation = BIOS_ATA_TRANSLATION_AUTO; |
7938 | - monitor_device = "vc:800x600"; | |
7938 | + monitor_device = "vc"; | |
7939 | 7939 | |
7940 | 7940 | serial_devices[0] = "vc:80Cx24C"; |
7941 | 7941 | for(i = 1; i < MAX_SERIAL_PORTS; i++) | ... | ... |