Skip to content

Commit

Permalink
cirrus: switch to 4 MB video memory by default
Browse files Browse the repository at this point in the history
Quoting cirrus source code:
   Follow real hardware, cirrus card emulated has 4 MB video memory.
   Also accept 8 MB/16 MB for backward compatibility.

So just use 4MB by default.  We decided to leave that at 8MB by default
a while ago, for live migration compatibility reasons.  But we have
compat properties to handle that, so that isn't a compeling reason.

This also removes some sanity check inconsistencies in the cirrus code.
Some places check against the allocated video memory, some places check
against the 4MB physical hardware has.  Guest code can trigger asserts
because of that.

Signed-off-by: Gerd Hoffmann <[email protected]>
Message-id: [email protected]
  • Loading branch information
kraxel committed Mar 16, 2017
1 parent 50628d3 commit 73c1481
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hw/display/cirrus_vga.c
Original file line number Diff line number Diff line change
Expand Up @@ -3023,7 +3023,7 @@ static void isa_cirrus_vga_realizefn(DeviceState *dev, Error **errp)

static Property isa_cirrus_vga_properties[] = {
DEFINE_PROP_UINT32("vgamem_mb", struct ISACirrusVGAState,
cirrus_vga.vga.vram_size_mb, 8),
cirrus_vga.vga.vram_size_mb, 4),
DEFINE_PROP_END_OF_LIST(),
};

Expand Down Expand Up @@ -3092,7 +3092,7 @@ static void pci_cirrus_vga_realize(PCIDevice *dev, Error **errp)

static Property pci_vga_cirrus_properties[] = {
DEFINE_PROP_UINT32("vgamem_mb", struct PCICirrusVGAState,
cirrus_vga.vga.vram_size_mb, 8),
cirrus_vga.vga.vram_size_mb, 4),
DEFINE_PROP_END_OF_LIST(),
};

Expand Down
8 changes: 8 additions & 0 deletions include/hw/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@
.driver = "pci-bridge",\
.property = "shpc",\
.value = "on",\
},{\
.driver = "cirrus-vga",\
.property = "vgamem_mb",\
.value = "8",\
},{\
.driver = "isa-cirrus-vga",\
.property = "vgamem_mb",\
.value = "8",\
},

#define HW_COMPAT_2_7 \
Expand Down

0 comments on commit 73c1481

Please sign in to comment.