From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Dave Airlie <airlied@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Gerd Hoffmann <kraxel@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>
Subject: [Qemu-devel] [PATCH 5/9] virtio-vga: add '-vga virtio' support
Date: Fri, 13 Mar 2015 10:47:09 +0100 [thread overview]
Message-ID: <1426240033-24673-7-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1426240033-24673-1-git-send-email-kraxel@redhat.com>
Some convinience fluff: Add support for '-vga virtio', also add
virtio-vga to the list of vga cards so '-device virtio-vga' will
turn off the default vga.
Written by Dave Airlie and Gerd Hoffmann.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/pci/pci.c | 2 ++
include/sysemu/sysemu.h | 2 +-
qemu-options.hx | 4 +++-
vl.c | 13 +++++++++++++
4 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 6941a82..f6eeaa9 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -1677,6 +1677,8 @@ PCIDevice *pci_vga_init(PCIBus *bus)
return pci_create_simple(bus, -1, "VGA");
case VGA_VMWARE:
return pci_create_simple(bus, -1, "vmware-svga");
+ case VGA_VIRTIO:
+ return pci_create_simple(bus, -1, "virtio-vga");
case VGA_NONE:
default: /* Other non-PCI types. Checking for unsupported types is already
done in vl.c. */
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index 6e85097..4ee32bf 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -104,7 +104,7 @@ extern int autostart;
typedef enum {
VGA_NONE, VGA_STD, VGA_CIRRUS, VGA_VMWARE, VGA_XENFB, VGA_QXL,
- VGA_TCX, VGA_CG3, VGA_DEVICE
+ VGA_TCX, VGA_CG3, VGA_DEVICE, VGA_VIRTIO,
} VGAInterfaceType;
extern int vga_interface_type;
diff --git a/qemu-options.hx b/qemu-options.hx
index 837624d..49b0f8f 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -1089,7 +1089,7 @@ Rotate graphical output some deg left (only PXA LCD).
ETEXI
DEF("vga", HAS_ARG, QEMU_OPTION_vga,
- "-vga [std|cirrus|vmware|qxl|xenfb|tcx|cg3|none]\n"
+ "-vga [std|cirrus|vmware|qxl|xenfb|tcx|cg3|virtio|none]\n"
" select video card type\n", QEMU_ARCH_ALL)
STEXI
@item -vga @var{type}
@@ -1122,6 +1122,8 @@ fixed resolution of 1024x768.
(sun4m only) Sun cgthree framebuffer. This is a simple 8-bit framebuffer
for sun4m machines available in both 1024x768 (OpenBIOS) and 1152x900 (OBP)
resolutions aimed at people wishing to run older Solaris versions.
+@item virtio
+Virtio VGA card.
@item none
Disable VGA card.
@end table
diff --git a/vl.c b/vl.c
index eba5d4c..7f903a5 100644
--- a/vl.c
+++ b/vl.c
@@ -231,6 +231,7 @@ static struct {
{ .driver = "isa-cirrus-vga", .flag = &default_vga },
{ .driver = "vmware-svga", .flag = &default_vga },
{ .driver = "qxl-vga", .flag = &default_vga },
+ { .driver = "virtio-vga", .flag = &default_vga },
};
static QemuOptsList qemu_rtc_opts = {
@@ -1871,6 +1872,11 @@ static bool cg3_vga_available(void)
return object_class_by_name("cgthree");
}
+static bool virtio_vga_available(void)
+{
+ return object_class_by_name("virtio-vga");
+}
+
static void select_vgahw (const char *p)
{
const char *opts;
@@ -1897,6 +1903,13 @@ static void select_vgahw (const char *p)
fprintf(stderr, "Error: VMWare SVGA not available\n");
exit(0);
}
+ } else if (strstart(p, "virtio", &opts)) {
+ if (virtio_vga_available()) {
+ vga_interface_type = VGA_VIRTIO;
+ } else {
+ fprintf(stderr, "Error: Virtio VGA not available\n");
+ exit(0);
+ }
} else if (strstart(p, "xenfb", &opts)) {
vga_interface_type = VGA_XENFB;
} else if (strstart(p, "qxl", &opts)) {
--
1.8.3.1
next prev parent reply other threads:[~2015-03-13 9:47 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-13 9:47 [Qemu-devel] [PATCH 0/9] add virtio-gpu with 2d support Gerd Hoffmann
2015-03-13 9:47 ` [Qemu-devel] [PATCH] opengl: require glx Gerd Hoffmann
2015-03-13 10:31 ` Gerd Hoffmann
2015-03-13 9:47 ` [Qemu-devel] [PATCH 1/9] virtio-gpu/2d: add hardware spec include file Gerd Hoffmann
2015-03-16 16:20 ` Max Reitz
2015-03-17 7:54 ` Gerd Hoffmann
2015-03-13 9:47 ` [Qemu-devel] [PATCH 2/9] virtio-gpu/2d: add virtio gpu core code Gerd Hoffmann
2015-03-16 18:28 ` Max Reitz
2015-03-16 20:15 ` Max Reitz
2015-03-17 8:21 ` Gerd Hoffmann
2015-03-13 9:47 ` [Qemu-devel] [PATCH 3/9] virtio-gpu-pci: add virtio pci support Gerd Hoffmann
2015-03-16 18:49 ` Max Reitz
2015-03-13 9:47 ` [Qemu-devel] [PATCH 4/9] virtio-vga: add virtio gpu device with vga compatibility Gerd Hoffmann
2015-03-16 19:17 ` Max Reitz
2015-03-13 9:47 ` Gerd Hoffmann [this message]
2015-03-16 19:30 ` [Qemu-devel] [PATCH 5/9] virtio-vga: add '-vga virtio' support Max Reitz
2015-03-13 9:47 ` [Qemu-devel] [PATCH 6/9] virtio-vga: add vgabios configuration Gerd Hoffmann
2015-03-16 19:38 ` Max Reitz
2015-03-13 9:47 ` [Qemu-devel] [PATCH 7/9] virtio-vga: add vgabios binary Gerd Hoffmann
2015-03-16 19:39 ` Max Reitz
2015-03-13 9:47 ` [Qemu-devel] [PATCH 8/9] virtio-gpu: add to display-vga test Gerd Hoffmann
2015-03-16 17:16 ` Paolo Bonzini
2015-03-17 8:25 ` Gerd Hoffmann
2015-03-13 9:47 ` [Qemu-devel] [PATCH 9/9] [hack] virtio-gpu: maskerade as -device VGA Gerd Hoffmann
2015-03-23 20:19 ` [Qemu-devel] [PATCH 0/9] add virtio-gpu with 2d support Christopher Covington
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1426240033-24673-7-git-send-email-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=airlied@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).