Skip to contentSkip to conversation

add secondary stdvga variant

RFC PATCH New Gerd Hoffmann 1 participant 1 message Nov 14, 2012

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 add secondary stdvga variant

Add a standard vga variant which doesn't occupy any legacy ressources and thus can easily be used as secondary (or legacy-free) graphics adapter. Programming must be done using the MMIO bar.

---
 docs/specs/standard-vga.txt |   13 +++++++--
 hw/vga-pci.c                |   62 +++++++++++++++++++++++++++++++++++++++++++
 hw/vga.c                    |    4 +++
 3 files changed, 76 insertions(+), 3 deletions(-)
docs/specs/standard-vga.txt +10 -3
index 8a4c1e9..f82773e 100644
@@ -5,9 +5,10 @@ QEMU Standard VGA
 Exists in two variants, for isa and pci.
 
 command line switches:
-    -vga std            [ picks isa for -M isapc, otherwise pci ]
-    -device VGA         [ pci variant ]
-    -device isa-vga     [ isa variant ]
+    -vga std               [ picks isa for -M isapc, otherwise pci ]
+    -device VGA            [ pci variant ]
+    -device isa-vga        [ isa variant ]
+    -device secondary-vga  [ legacy-free pci variant ]
 
 
 PCI spec
@@ -31,9 +32,15 @@ PCI ROM Region:
    Holds the vgabios (qemu 0.14+).
 
 
+The legacy-free variant has no ROM and has PCI_CLASS_DISPLAY_OTHER
+instead of PCI_CLASS_DISPLAY_VGA.
+
+
 IO ports used
 -------------
 
+Doesn't apply to the legacy-free pci variant, use the MMIO bar instead.
+
 03c0 - 03df : standard vga ports
 01ce        : bochs vbe interface index port
 01cf        : bochs vbe interface data port (x86 only)
hw/vga-pci.c +62 -0

89 lines not on this page · raw message

hw/vga.c +4 -0
index 2b0200a..b25a058 100644
@@ -174,6 +174,10 @@ static void vga_update_memory_access(VGACommonState *s)
     MemoryRegion *region, *old_region = s->chain4_alias;
     hwaddr base, offset, size;
 
+    if (s->legacy_address_space == NULL) {
+        return;
+    }
+
     s->chain4_alias = NULL;
 
     if ((s->sr[VGA_SEQ_PLANE_WRITE] & VGA_SR02_ALL_PLANES) ==
Signature · 1 line
1.7.1