Skip to contentSkip to conversation

virtio-vga: fix blue boot console @ ppc

PATCH New Gerd Hoffmann 1 participant 3 messages Sep 28, 2020

lore
Share & tools
lore
#0 lore raw

cover virtio-vga: fix blue boot console @ ppc

Gerd Hoffmann (2):
virtio-vga: implement big-endian-framebuffer property ppc/pseries: enable big-endian-framebuffer quirk for bochs-display and
virtio-vga

 hw/display/virtio-vga.c | 19 +++++++++++++++++++
 hw/ppc/spapr_pci.c      |  4 +++-
 2 files changed, 22 insertions(+), 1 deletion(-)
Signature · 1 line
2.27.0
#1 lore raw

PATCH 1/2 virtio-vga: implement big-endian-framebuffer property

Allows to switch the (vga mode) framebuffer into bigendian mode by setting the property, simliar to stdvga.

---
 hw/display/virtio-vga.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
hw/display/virtio-vga.c +19 -0
index f9410a0c2e61..81f776ee36e7 100644
@@ -168,6 +168,20 @@ static void virtio_vga_base_reset(DeviceState *dev)
     vga_dirty_log_start(&vvga->vga);
 }
 
+static bool virtio_vga_get_big_endian_fb(Object *obj, Error **errp)
+{
+    VirtIOVGABase *d = VIRTIO_VGA_BASE(obj);
+
+    return d->vga.big_endian_fb;
+}
+
+static void virtio_vga_set_big_endian_fb(Object *obj, bool value, Error **errp)
+{
+    VirtIOVGABase *d = VIRTIO_VGA_BASE(obj);
+
+    d->vga.big_endian_fb = value;
+}
+
 static Property virtio_vga_base_properties[] = {
     DEFINE_VIRTIO_GPU_PCI_PROPERTIES(VirtIOPCIProxy),
     DEFINE_PROP_END_OF_LIST(),
@@ -190,6 +204,11 @@ static void virtio_vga_base_class_init(ObjectClass *klass, void *data)
     k->realize = virtio_vga_base_realize;
     pcidev_k->romfile = "vgabios-virtio.bin";
     pcidev_k->class_id = PCI_CLASS_DISPLAY_VGA;
+
+    /* Expose framebuffer byteorder via QOM */
+    object_class_property_add_bool(klass, "big-endian-framebuffer",
+                                   virtio_vga_get_big_endian_fb,
+                                   virtio_vga_set_big_endian_fb);
 }
 
 static TypeInfo virtio_vga_base_info = {
Signature · 1 line
2.27.0
#2 lore raw

PATCH 2/2 ppc/pseries: enable big-endian-framebuffer quirk for bochs-display and virtio-vga

In reply to Gerd Hoffmann

Already done for stdvga and secondary-vga, bochs-display and virtio-vga support the big-endian-framebuffer property too. Fixes blue console background at boot (offb firmware console).

---
 hw/ppc/spapr_pci.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
hw/ppc/spapr_pci.c +3 -1
index 4d97ff6c70f2..5db912b48c41 100644
@@ -2464,7 +2464,9 @@ static int spapr_switch_one_vga(DeviceState *dev, void *opaque)
     bool be = *(bool *)opaque;
 
     if (object_dynamic_cast(OBJECT(dev), "VGA")
-        || object_dynamic_cast(OBJECT(dev), "secondary-vga")) {
+        || object_dynamic_cast(OBJECT(dev), "secondary-vga")
+        || object_dynamic_cast(OBJECT(dev), "bochs-display")
+        || object_dynamic_cast(OBJECT(dev), "virtio-vga")) {
         object_property_set_bool(OBJECT(dev), "big-endian-framebuffer", be,
                                  &error_abort);
     }
Signature · 1 line
2.27.0