diff options
author | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-07-01 16:24:38 +0000 |
---|---|---|
committer | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-07-01 16:24:38 +0000 |
commit | c60e08d9c6bbace33c04dab2b5cacbc42e2e3d47 (patch) | |
tree | be6d94159b698760acaec329da228a44c2ce415f /hw/g364fb.c | |
parent | ea334207a3152e5e4fee4cb82a76233fd43fa14d (diff) | |
download | qemu-c60e08d9c6bbace33c04dab2b5cacbc42e2e3d47.zip qemu-c60e08d9c6bbace33c04dab2b5cacbc42e2e3d47.tar.gz qemu-c60e08d9c6bbace33c04dab2b5cacbc42e2e3d47.tar.bz2 |
Implement resolution switching in common console code.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4812 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/g364fb.c')
-rw-r--r-- | hw/g364fb.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/hw/g364fb.c b/hw/g364fb.c index 0dd4ee7..3dfc8e1 100644 --- a/hw/g364fb.c +++ b/hw/g364fb.c @@ -33,6 +33,7 @@ typedef struct G364State { uint8_t palette[256][3]; /* display refresh support */ DisplayState *ds; + QEMUConsole *console; int graphic_mode; uint32_t scr_width, scr_height; /* in pixels */ uint32_t last_scr_width, last_scr_height; /* in pixels */ @@ -74,13 +75,6 @@ static void g364fb_draw_graphic(G364State *s, int full_update) { if (s->scr_width == 0 || s->scr_height == 0) return; - if (s->scr_width != s->last_scr_width - || s->scr_height != s->last_scr_height) { - s->last_scr_width = s->scr_width; - s->last_scr_height = s->scr_height; - dpy_resize(s->ds, s->last_scr_width, s->last_scr_height); - full_update = 1; - } switch (s->ds->depth) { case 8: @@ -272,7 +266,10 @@ static void g364fb_ctrl_writeb(void *opaque, target_phys_addr_t addr, uint32_t v #endif break; } + if (s->scr_width && s->scr_height) + qemu_console_resize(s->console, s->scr_width, s->scr_height); } + s->graphic_mode = -1; /* force full update */ } 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, s->ds = ds; s->vram_base = vram_base; - graphic_console_init(ds, g364fb_update_display, - g364fb_invalidate_display, g364fb_screen_dump, - NULL, s); + s->console = graphic_console_init(ds, g364fb_update_display, + g364fb_invalidate_display, + g364fb_screen_dump, NULL, s); io_vram = cpu_register_io_memory(0, g364fb_mem_read, g364fb_mem_write, s); cpu_register_physical_memory(s->vram_base, vram_size, io_vram); |