qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hw/display/virtio-vga: made vga memory size configurable
@ 2021-03-14 12:23 vitaly
  2021-03-14 12:45 ` BALATON Zoltan
  2021-03-15  7:21 ` Gerd Hoffmann
  0 siblings, 2 replies; 8+ messages in thread
From: vitaly @ 2021-03-14 12:23 UTC (permalink / raw)
  To: qemu-devel; +Cc: Vitaly Chipounov, kraxel

From: Vitaly Chipounov <vitaly@cyberhaven.com>

This enables higher resolutions. The default is still 8MB for
backwards compatibility with existing snapshots.

The property name "vgamem_fb" is similar to that of the other
graphic adapters.

seabios/vgasrc/svgamodes.c needs to be updated as well.
For example, adding the following line would expose
a 3840x2160 resolution to the guest.

{ 0x199, { MM_DIRECT, 3840, 2160, 32, 8, 16, SEG_GRAPH } },

Signed-off-by: Vitaly Chipounov <vitaly@cyberhaven.com>
---
 hw/display/virtio-vga.c | 3 ++-
 hw/virtio/virtio-pci.h  | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c
index d3c6404061..657fafc48f 100644
--- a/hw/display/virtio-vga.c
+++ b/hw/display/virtio-vga.c
@@ -118,7 +118,7 @@ static void virtio_vga_base_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
     int i;
 
     /* init vga compat bits */
-    vga->vram_size_mb = 8;
+    vga->vram_size_mb = vpci_dev->vgamem_size_mb;
     vga_common_init(vga, OBJECT(vpci_dev));
     vga_init(vga, OBJECT(vpci_dev), pci_address_space(&vpci_dev->pci_dev),
              pci_address_space_io(&vpci_dev->pci_dev), true);
@@ -204,6 +204,7 @@ static void virtio_vga_set_big_endian_fb(Object *obj, bool value, Error **errp)
 
 static Property virtio_vga_base_properties[] = {
     DEFINE_VIRTIO_GPU_PCI_PROPERTIES(VirtIOPCIProxy),
+    DEFINE_PROP_UINT32("vgamem_mb", VirtIOPCIProxy, vgamem_size_mb, 8),
     DEFINE_PROP_END_OF_LIST(),
 };
 
diff --git a/hw/virtio/virtio-pci.h b/hw/virtio/virtio-pci.h
index d7d5d403a9..8684311a8d 100644
--- a/hw/virtio/virtio-pci.h
+++ b/hw/virtio/virtio-pci.h
@@ -151,6 +151,8 @@ struct VirtIOPCIProxy {
     VirtIOIRQFD *vector_irqfd;
     int nvqs_with_notifiers;
     VirtioBusState bus;
+
+    uint32_t vgamem_size_mb;
 };
 
 static inline bool virtio_pci_modern(VirtIOPCIProxy *proxy)
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-03-17  6:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-14 12:23 [PATCH] hw/display/virtio-vga: made vga memory size configurable vitaly
2021-03-14 12:45 ` BALATON Zoltan
2021-03-14 12:50   ` Vitaly Chipounov
2021-03-15  7:21 ` Gerd Hoffmann
2021-03-15 11:29   ` Vitaly Chipounov
2021-03-15 15:24     ` Gerd Hoffmann
2021-03-16 19:51       ` Vitaly Chipounov
2021-03-17  6:45         ` Gerd Hoffmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).