Commit 6c72922fe5 for qemu.org
commit 6c72922fe53851ba3f109b0b0f2312e0df9d5c5a
Author: Philippe Mathieu-Daudé <philmd@linaro.org>
Date: Wed Feb 11 14:46:18 2026 +0100
hw/m68k/q800: Set MACFB_DISPLAY_APPLE_21_COLOR within MacFrameBuffer
The MACFB_DISPLAY_APPLE_21_COLOR mode is not specific to the Q800
machine. Check and set it once in the MacFB DeviceRealize handler.
No need to explicitly set the MACFB_DISPLAY_VGA mode since this is
the default value.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-Id: <20260216213121.47122-5-philmd@linaro.org>
diff --git a/hw/display/macfb.c b/hw/display/macfb.c
index 8ef174dc6d..b8115c2be1 100644
--- a/hw/display/macfb.c
+++ b/hw/display/macfb.c
@@ -645,6 +645,10 @@ static bool macfb_common_realize(DeviceState *dev, MacfbState *s, Error **errp)
{
DisplaySurface *surface;
+ if (s->width == 1152 && s->height == 870) {
+ s->type = MACFB_DISPLAY_APPLE_21_COLOR;
+ }
+
s->mode = macfb_find_mode(s->type, s->width, s->height, s->depth);
if (!s->mode) {
gchar *list;
diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c
index b55c03a90b..ba32da2fa4 100644
--- a/hw/m68k/q800.c
+++ b/hw/m68k/q800.c
@@ -563,11 +563,6 @@ static void q800_machine_init(MachineState *machine)
qdev_prop_set_uint32(dev, "width", graphic_width);
qdev_prop_set_uint32(dev, "height", graphic_height);
qdev_prop_set_uint8(dev, "depth", graphic_depth);
- if (graphic_width == 1152 && graphic_height == 870) {
- qdev_prop_set_uint8(dev, "display", MACFB_DISPLAY_APPLE_21_COLOR);
- } else {
- qdev_prop_set_uint8(dev, "display", MACFB_DISPLAY_VGA);
- }
qdev_realize(dev, BUS(nubus), &error_fatal);
macfb_mode = (NUBUS_MACFB(dev)->macfb).mode;