[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 17/22] macfb: set initial value of mode control registers in macfb
From: |
Mark Cave-Ayland |
Subject: |
[PULL 17/22] macfb: set initial value of mode control registers in macfb_common_realize() |
Date: |
Wed, 9 Mar 2022 11:08:26 +0000 |
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>
---
hw/display/macfb.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/hw/display/macfb.c b/hw/display/macfb.c
index 7371986480..2f8e016566 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);
--
2.20.1
- [PULL 08/22] mos6522: add "info via" HMP command for debugging, (continued)
- [PULL 08/22] mos6522: add "info via" HMP command for debugging, Mark Cave-Ayland, 2022/03/09
- [PULL 09/22] mos6522: record last_irq_levels in mos6522_set_irq(), Mark Cave-Ayland, 2022/03/09
- [PULL 11/22] mos6522: implement edge-triggering for CA1/2 and CB1/2 control line IRQs, Mark Cave-Ayland, 2022/03/09
- [PULL 10/22] mac_via: make SCSI_DATA (DRQ) bit live rather than latched, Mark Cave-Ayland, 2022/03/09
- [PULL 12/22] macio/pmu.c: remove redundant code, Mark Cave-Ayland, 2022/03/09
- [PULL 13/22] macfb: add VMStateDescription for MacfbNubusState and MacfbSysBusState, Mark Cave-Ayland, 2022/03/09
- [PULL 14/22] macfb: don't use special irq_state and irq_mask variables in MacfbState, Mark Cave-Ayland, 2022/03/09
- [PULL 15/22] macfb: increase number of registers saved in MacfbState, Mark Cave-Ayland, 2022/03/09
- [PULL 19/22] esp: introduce esp_pdma_cb() function, Mark Cave-Ayland, 2022/03/09
- [PULL 16/22] macfb: add VMStateDescription fields for display type and VBL timer, Mark Cave-Ayland, 2022/03/09
- [PULL 17/22] macfb: set initial value of mode control registers in macfb_common_realize(),
Mark Cave-Ayland <=
- [PULL 18/22] esp: introduce esp_set_pdma_cb() function, Mark Cave-Ayland, 2022/03/09
- [PULL 21/22] esp: include the current PDMA callback in the migration stream, Mark Cave-Ayland, 2022/03/09
- [PULL 22/22] esp: recreate ESPState current_req after migration, Mark Cave-Ayland, 2022/03/09
- [PULL 20/22] esp: convert ESPState pdma_cb from a function pointer to an integer, Mark Cave-Ayland, 2022/03/09
- Re: [PULL 00/22] q800-updates-for-7.0 queue 20220309, Laurent Vivier, 2022/03/09
- Re: [PULL 00/22] q800-updates-for-7.0 queue 20220309, Peter Maydell, 2022/03/10