@samitouri / QOSamiQemu / commits / 6c72922fe5

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>

Philippe Mathieu-Daudé committed Feb 11, 2026 at 14:46 UTC 6c72922fe53851ba3f109b0b0f2312e0df9d5c5a
2 files changed +4 -5
hw/display/macfb.c
+4
@@ -645,6 +645,10 @@ static bool macfb_common_realize(DeviceState *dev, MacfbState *s, Error **errp)
645 {
646 DisplaySurface *surface;
647
648 + if (s->width == 1152 && s->height == 870) {
649 + s->type = MACFB_DISPLAY_APPLE_21_COLOR;
650 + }
651 +
652 s->mode = macfb_find_mode(s->type, s->width, s->height, s->depth);
653 if (!s->mode) {
654 gchar *list;
hw/m68k/q800.c
-5
@@ -563,11 +563,6 @@ static void q800_machine_init(MachineState *machine)
563 qdev_prop_set_uint32(dev, "width", graphic_width);
564 qdev_prop_set_uint32(dev, "height", graphic_height);
565 qdev_prop_set_uint8(dev, "depth", graphic_depth);
566 - if (graphic_width == 1152 && graphic_height == 870) {
567 - qdev_prop_set_uint8(dev, "display", MACFB_DISPLAY_APPLE_21_COLOR);
568 - } else {
569 - qdev_prop_set_uint8(dev, "display", MACFB_DISPLAY_VGA);
570 - }
566 qdev_realize(dev, BUS(nubus), &error_fatal);
567
568 macfb_mode = (NUBUS_MACFB(dev)->macfb).mode;