summary refs log tree commit diff stats
path: root/hw/display/bochs-display.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2018-10-15 15:03:45 +0100
committerPeter Maydell <peter.maydell@linaro.org>2018-10-15 15:03:45 +0100
commitff56877e911782dedc9a424233fd3f62369c258c (patch)
tree7b613ed6f36bb4a50bf1b01743348d59d0899fdf /hw/display/bochs-display.c
parent046936ed7179cfa413dfb2668b03d7e684bb7dbd (diff)
parent9f42e0b3c2355c4a2475124c3fc40421a88de813 (diff)
downloadfocaccia-qemu-ff56877e911782dedc9a424233fd3f62369c258c.tar.gz
focaccia-qemu-ff56877e911782dedc9a424233fd3f62369c258c.zip
Merge remote-tracking branch 'remotes/kraxel/tags/vga-20181015-pull-request' into staging
vga: config tweaks, edid updates, qxl bugfix, install new vgabios blobs.

# gpg: Signature made Mon 15 Oct 2018 10:05:03 BST
# gpg:                using RSA key 4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/vga-20181015-pull-request:
  Makefile: Install new vgabios binaries
  hw/display/cirrus_vga: Move "isa-cirrus-vga" device into a separate file
  i2c: switch ddc to use the new edid generator
  qxl: check qxl_phys2virt return value
  bochs-display: wire up edid support
  display: add separate config option for bochs-display
  edid: fix alignment issues

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/display/bochs-display.c')
-rw-r--r--hw/display/bochs-display.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/hw/display/bochs-display.c b/hw/display/bochs-display.c
index 09d8944a1b..3d439eb240 100644
--- a/hw/display/bochs-display.c
+++ b/hw/display/bochs-display.c
@@ -9,6 +9,7 @@
 #include "hw/hw.h"
 #include "hw/pci/pci.h"
 #include "hw/display/bochs-vbe.h"
+#include "hw/display/edid.h"
 
 #include "qapi/error.h"
 
@@ -35,9 +36,13 @@ typedef struct BochsDisplayState {
     MemoryRegion     mmio;
     MemoryRegion     vbe;
     MemoryRegion     qext;
+    MemoryRegion     edid;
 
     /* device config */
     uint64_t         vgamem;
+    bool             enable_edid;
+    qemu_edid_info   edid_info;
+    uint8_t          edid_blob[256];
 
     /* device registers */
     uint16_t         vbe_regs[VBE_DISPI_INDEX_NB];
@@ -283,6 +288,12 @@ static void bochs_display_realize(PCIDevice *dev, Error **errp)
     pci_register_bar(&s->pci, 0, PCI_BASE_ADDRESS_MEM_PREFETCH, &s->vram);
     pci_register_bar(&s->pci, 2, PCI_BASE_ADDRESS_SPACE_MEMORY, &s->mmio);
 
+    if (s->enable_edid) {
+        qemu_edid_generate(s->edid_blob, sizeof(s->edid_blob), &s->edid_info);
+        qemu_edid_region_io(&s->edid, obj, s->edid_blob, sizeof(s->edid_blob));
+        memory_region_add_subregion(&s->mmio, 0, &s->edid);
+    }
+
     if (pci_bus_is_express(pci_get_bus(dev))) {
         dev->cap_present |= QEMU_PCI_CAP_EXPRESS;
         ret = pcie_endpoint_cap_init(dev, 0x80);
@@ -325,6 +336,8 @@ static void bochs_display_exit(PCIDevice *dev)
 
 static Property bochs_display_properties[] = {
     DEFINE_PROP_SIZE("vgamem", BochsDisplayState, vgamem, 16 * MiB),
+    DEFINE_PROP_BOOL("edid", BochsDisplayState, enable_edid, false),
+    DEFINE_EDID_PROPERTIES(BochsDisplayState, edid_info),
     DEFINE_PROP_END_OF_LIST(),
 };