[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 17/38] vga: Expose framebuffer byteorder as a QOM prope
From: |
Alexander Graf |
Subject: |
[Qemu-ppc] [PULL 17/38] vga: Expose framebuffer byteorder as a QOM property |
Date: |
Sun, 8 Mar 2015 09:44:36 +0100 |
From: David Gibson <address@hidden>
The VGA device model now supports having the framebuffer in either endian,
and can be switched between these by the guest via a register in the qext
region.
However, in some cases (e.g. LE OS on the pseries machine) we have
existing guest that don't know about the endian switch register, but other
parts of the qemu code have better information to set a default endianness
than the VGA code does of itself.
In order to allow them to set a correct default endianness in these cases,
without breaking abstraction walls, this patch exposes the VGA framebuffer
endianness via a writable QOM property.
Signed-off-by: David Gibson <address@hidden>
Reviewed-by: Gerd Hoffmann <address@hidden>
Signed-off-by: Alexander Graf <address@hidden>
---
hw/display/vga-pci.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/hw/display/vga-pci.c b/hw/display/vga-pci.c
index 53739e4..8bd6ff7 100644
--- a/hw/display/vga-pci.c
+++ b/hw/display/vga-pci.c
@@ -181,6 +181,20 @@ static void pci_vga_qext_write(void *ptr, hwaddr addr,
}
}
+static bool vga_get_big_endian_fb(Object *obj, Error **errp)
+{
+ PCIVGAState *d = DO_UPCAST(PCIVGAState, dev, PCI_DEVICE(obj));
+
+ return d->vga.big_endian_fb;
+}
+
+static void vga_set_big_endian_fb(Object *obj, bool value, Error **errp)
+{
+ PCIVGAState *d = DO_UPCAST(PCIVGAState, dev, PCI_DEVICE(obj));
+
+ d->vga.big_endian_fb = value;
+}
+
static const MemoryRegionOps pci_vga_qext_ops = {
.read = pci_vga_qext_read,
.write = pci_vga_qext_write,
@@ -233,6 +247,10 @@ static int pci_std_vga_initfn(PCIDevice *dev)
vga_init_vbe(s, OBJECT(dev), pci_address_space(dev));
}
+ /* Expose framebuffer byteorder via QOM */
+ object_property_add_bool(OBJECT(dev), "big-endian-framebuffer",
+ vga_get_big_endian_fb, vga_set_big_endian_fb,
NULL);
+
return 0;
}
@@ -268,6 +286,10 @@ static int pci_secondary_vga_initfn(PCIDevice *dev)
pci_register_bar(&d->dev, 0, PCI_BASE_ADDRESS_MEM_PREFETCH, &s->vram);
pci_register_bar(&d->dev, 2, PCI_BASE_ADDRESS_SPACE_MEMORY, &d->mmio);
+ /* Expose framebuffer byteorder via QOM */
+ object_property_add_bool(OBJECT(dev), "big-endian-framebuffer",
+ vga_get_big_endian_fb, vga_set_big_endian_fb,
NULL);
+
return 0;
}
--
1.8.1.4
- [Qemu-ppc] [PULL 11/38] pseries: Make RTAS time of day functions respect -rtc options, (continued)
- [Qemu-ppc] [PULL 11/38] pseries: Make RTAS time of day functions respect -rtc options, Alexander Graf, 2015/03/08
- [Qemu-ppc] [PULL 19/38] Openpic: check that cpu id is within the number of cpus, Alexander Graf, 2015/03/08
- [Qemu-ppc] [PULL 12/38] pseries: Make the PAPR RTC a qdev device, Alexander Graf, 2015/03/08
- [Qemu-ppc] [PULL 13/38] pseries: Move rtc_offset into RTC device's state structure, Alexander Graf, 2015/03/08
- [Qemu-ppc] [PULL 21/38] macio.c: include parent PCIDevice state in VMStateDescription, Alexander Graf, 2015/03/08
- [Qemu-ppc] [PULL 32/38] ppc64-softmmu: Remove unsupported FDC from config, Alexander Graf, 2015/03/08
- [Qemu-ppc] [PULL 08/38] pseries: Move sPAPR RTC code into its own file, Alexander Graf, 2015/03/08
- [Qemu-ppc] [PULL 04/38] spapr: Add pseries-2.3 machine, Alexander Graf, 2015/03/08
- [Qemu-ppc] [PULL 22/38] adb.c: include ADBDevice parent state in KBDState and MouseState, Alexander Graf, 2015/03/08
- [Qemu-ppc] [PULL 03/38] pseries: Limit PCI host bridge "index" value, Alexander Graf, 2015/03/08
- [Qemu-ppc] [PULL 17/38] vga: Expose framebuffer byteorder as a QOM property,
Alexander Graf <=
- [Qemu-ppc] [PULL 07/38] Add more VMSTATE_*_TEST variants for integers, Alexander Graf, 2015/03/08
- [Qemu-ppc] [PULL 34/38] PPC: Remove duplicate OPENPIC defines in default-configs, Alexander Graf, 2015/03/08
- [Qemu-ppc] [PULL 36/38] target-ppc: Add versions to server CPU descriptions, Alexander Graf, 2015/03/08
- [Qemu-ppc] [PULL 37/38] sPAPR: Implement EEH RTAS calls, Alexander Graf, 2015/03/08
- [Qemu-ppc] [PULL 29/38] openpic: convert to vmstate, Alexander Graf, 2015/03/08
- [Qemu-ppc] [PULL 30/38] spapr_vio: Convert to realize(), Alexander Graf, 2015/03/08
- [Qemu-ppc] [PULL 27/38] openpic: fix up loadvm under -M mac99, Alexander Graf, 2015/03/08
- Re: [Qemu-ppc] [PULL 2.3 00/38] ppc patch queue 2015-03-08, Peter Maydell, 2015/03/09