diff options
author | Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> | 2022-03-05 15:55:25 +0000 |
---|---|---|
committer | Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> | 2022-03-09 09:29:10 +0000 |
commit | e20d0b84a8278cbe9761cfd429e10c5e06d06d01 (patch) | |
tree | 2562f64c115ca089b6dcd1e26e3c9191d51b881b | |
parent | aba7432bde5667baf99bbecfcff0e77426d1b68e (diff) | |
download | qemu-e20d0b84a8278cbe9761cfd429e10c5e06d06d01.zip qemu-e20d0b84a8278cbe9761cfd429e10c5e06d06d01.tar.gz qemu-e20d0b84a8278cbe9761cfd429e10c5e06d06d01.tar.bz2 |
macfb: set initial value of mode control registers in macfb_common_realize()
If booting Linux directly in the q800 machine using -kernel rather than using a
MacOS toolbox ROM, the mode control registers are never initialised,
causing macfb_mode_write() to fail to determine the current resolution after
migration. Resolve this by always setting the initial values of the mode control
registers based upon the initial macfb properties during realize.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20220305155530.9265-6-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
-rw-r--r-- | hw/display/macfb.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/display/macfb.c b/hw/display/macfb.c index 7371986..2f8e016 100644 --- a/hw/display/macfb.c +++ b/hw/display/macfb.c @@ -655,6 +655,14 @@ static bool macfb_common_realize(DeviceState *dev, MacfbState *s, Error **errp) return false; } + /* + * Set mode control registers to match the mode found above so that + * macfb_mode_write() does the right thing if no MacOS toolbox ROM + * is present to initialise them + */ + s->regs[DAFB_MODE_CTRL1 >> 2] = s->mode->mode_ctrl1; + s->regs[DAFB_MODE_CTRL2 >> 2] = s->mode->mode_ctrl2; + s->con = graphic_console_init(dev, 0, &macfb_ops, s); surface = qemu_console_surface(s->con); |