From: Jan Kiszka <jan.kiszka@web.de>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] MusicPal: Restore display size after invalidation
Date: Thu, 22 May 2008 15:21:11 +0200 [thread overview]
Message-ID: <48357347.1000305@web.de> (raw)
Make sure that the MusicPal display is set to the correct size again
after some other console may have used a different size.
Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
---
hw/musicpal.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
Index: b/hw/musicpal.c
===================================================================
--- a/hw/musicpal.c
+++ b/hw/musicpal.c
@@ -759,6 +759,7 @@ typedef struct musicpal_lcd_state {
int page_off;
DisplayState *ds;
uint8_t video_ram[128*64/8];
+ int resize;
} musicpal_lcd_state;
static uint32_t lcd_brightness;
@@ -817,6 +818,11 @@ static void lcd_refresh(void *opaque)
musicpal_lcd_state *s = opaque;
int x, y, col;
+ if (s->resize) {
+ dpy_resize(s->ds, 128*3, 64*3);
+ s->resize = 0;
+ }
+
switch (s->ds->depth) {
case 0:
return;
@@ -843,6 +849,13 @@ static void lcd_refresh(void *opaque)
dpy_update(s->ds, 0, 0, 128*3, 64*3);
}
+static void lcd_invalidate(void *opaque)
+{
+ musicpal_lcd_state *s = opaque;
+
+ s->resize = 1;
+}
+
static uint32_t musicpal_lcd_read(void *opaque, target_phys_addr_t offset)
{
musicpal_lcd_state *s = opaque;
@@ -919,12 +932,12 @@ static void musicpal_lcd_init(DisplaySta
return;
s->base = base;
s->ds = ds;
+ s->resize = 1;
iomemtype = cpu_register_io_memory(0, musicpal_lcd_readfn,
musicpal_lcd_writefn, s);
cpu_register_physical_memory(base, MP_LCD_SIZE, iomemtype);
- graphic_console_init(ds, lcd_refresh, NULL, NULL, NULL, s);
- dpy_resize(ds, 128*3, 64*3);
+ graphic_console_init(ds, lcd_refresh, lcd_invalidate, NULL, NULL, s);
}
/* PIC register offsets */
reply other threads:[~2008-05-22 13:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48357347.1000305@web.de \
--to=jan.kiszka@web.de \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).