qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] virtio-vga: adapt to page-per-vq=off
@ 2016-09-08  7:16 Gerd Hoffmann
  2016-09-08  7:25 ` no-reply
  0 siblings, 1 reply; 2+ messages in thread
From: Gerd Hoffmann @ 2016-09-08  7:16 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcel, Michael S. Tsirkin, Gerd Hoffmann

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/display/virtio-vga.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c
index 5b510a1..f77b401 100644
--- a/hw/display/virtio-vga.c
+++ b/hw/display/virtio-vga.c
@@ -122,6 +122,17 @@ static void virtio_vga_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
      */
     vpci_dev->modern_mem_bar = 2;
     vpci_dev->msix_bar = 4;
+
+    if (!(vpci_dev->flags & VIRTIO_PCI_FLAG_PAGE_PER_VQ)) {
+        /*
+         * with page-per-vq=off there is no padding space we can use
+         * for the stdvga registers.  Make the common and isr regions
+         * smaller then.
+         */
+        vpci_dev->common.size /= 2;
+        vpci_dev->isr.size /= 2;
+    }
+
     offset = memory_region_size(&vpci_dev->modern_bar);
     offset -= vpci_dev->notify.size;
     vpci_dev->notify.offset = offset;
-- 
1.8.3.1

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

end of thread, other threads:[~2016-09-08  7:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-08  7:16 [Qemu-devel] [PATCH] virtio-vga: adapt to page-per-vq=off Gerd Hoffmann
2016-09-08  7:25 ` no-reply

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).