* [Qemu-devel] [PULL for-2.4 0/3] vga patch queue
@ 2015-07-07 12:23 Gerd Hoffmann
2015-07-07 12:23 ` [Qemu-devel] [PULL 1/3] virtio-gpu: update console device property Gerd Hoffmann
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Gerd Hoffmann @ 2015-07-07 12:23 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Hi,
Here are some small virtio-gpu fixes for 2.4.
A simple testcase is added too.
please pull,
Gerd
The following changes since commit 5317b0f6d4bb581c5c8f88f31138ee301ad2b7e5:
Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20150702-v3' into staging (2015-07-02 15:20:55 +0100)
are available in the git repository at:
git://git.kraxel.org/qemu tags/pull-vga-20150707-1
for you to fetch changes up to 501eea4f4187b6c62b6cf348ab0b100d57d8c56b:
virtio-gpu: add to display-vga test (2015-07-07 11:23:18 +0200)
----------------------------------------------------------------
virtio-gpu property fixes, add testcase
----------------------------------------------------------------
Gerd Hoffmann (3):
virtio-gpu: update console device property.
virtio-gpu: use virtio_instance_init_common, fixup properties
virtio-gpu: add to display-vga test
hw/display/virtio-gpu-pci.c | 14 +++++++++++---
hw/display/virtio-gpu.c | 2 +-
hw/display/virtio-vga.c | 13 ++++++++++---
include/hw/virtio/virtio-gpu.h | 3 ---
tests/Makefile | 3 +++
tests/display-vga-test.c | 18 ++++++++++++++++++
6 files changed, 43 insertions(+), 10 deletions(-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Qemu-devel] [PULL 1/3] virtio-gpu: update console device property.
2015-07-07 12:23 [Qemu-devel] [PULL for-2.4 0/3] vga patch queue Gerd Hoffmann
@ 2015-07-07 12:23 ` Gerd Hoffmann
2015-07-07 12:23 ` [Qemu-devel] [PULL 2/3] virtio-gpu: use virtio_instance_init_common, fixup properties Gerd Hoffmann
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Gerd Hoffmann @ 2015-07-07 12:23 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann, Michael S. Tsirkin
Update the device link of the QemuConsole, so it points to the
virtio-gpu-pci or virtio-vga device instead of virtio-gpu-device.
This is needed because we want to find the device by id, for
example for input routing, and the id specified on the command
line is attached to the pci proxy, not the virtio device.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/display/virtio-gpu-pci.c | 8 ++++++++
hw/display/virtio-vga.c | 7 +++++++
2 files changed, 15 insertions(+)
diff --git a/hw/display/virtio-gpu-pci.c b/hw/display/virtio-gpu-pci.c
index f0f25c7..d3e9aad 100644
--- a/hw/display/virtio-gpu-pci.c
+++ b/hw/display/virtio-gpu-pci.c
@@ -25,13 +25,21 @@ static Property virtio_gpu_pci_properties[] = {
static void virtio_gpu_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
{
VirtIOGPUPCI *vgpu = VIRTIO_GPU_PCI(vpci_dev);
+ VirtIOGPU *g = &vgpu->vdev;
DeviceState *vdev = DEVICE(&vgpu->vdev);
+ int i;
qdev_set_parent_bus(vdev, BUS(&vpci_dev->bus));
/* force virtio-1.0 */
vpci_dev->flags &= ~VIRTIO_PCI_FLAG_DISABLE_MODERN;
vpci_dev->flags |= VIRTIO_PCI_FLAG_DISABLE_LEGACY;
object_property_set_bool(OBJECT(vdev), true, "realized", errp);
+
+ for (i = 0; i < g->conf.max_outputs; i++) {
+ object_property_set_link(OBJECT(g->scanout[i].con),
+ OBJECT(vpci_dev),
+ "device", errp);
+ }
}
static void virtio_gpu_pci_class_init(ObjectClass *klass, void *data)
diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c
index 94f9d0e..1b09a04 100644
--- a/hw/display/virtio-vga.c
+++ b/hw/display/virtio-vga.c
@@ -79,6 +79,7 @@ static void virtio_vga_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
VirtIOGPU *g = &vvga->vdev;
VGACommonState *vga = &vvga->vga;
uint32_t offset;
+ int i;
/* init vga compat bits */
vga->vram_size_mb = 8;
@@ -120,6 +121,12 @@ static void virtio_vga_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
vga->con = g->scanout[0].con;
graphic_console_set_hwops(vga->con, &virtio_vga_ops, vvga);
+
+ for (i = 0; i < g->conf.max_outputs; i++) {
+ object_property_set_link(OBJECT(g->scanout[i].con),
+ OBJECT(vpci_dev),
+ "device", errp);
+ }
}
static void virtio_vga_reset(DeviceState *dev)
--
1.8.3.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Qemu-devel] [PULL 2/3] virtio-gpu: use virtio_instance_init_common, fixup properties
2015-07-07 12:23 [Qemu-devel] [PULL for-2.4 0/3] vga patch queue Gerd Hoffmann
2015-07-07 12:23 ` [Qemu-devel] [PULL 1/3] virtio-gpu: update console device property Gerd Hoffmann
@ 2015-07-07 12:23 ` Gerd Hoffmann
2015-07-07 12:23 ` [Qemu-devel] [PULL 3/3] virtio-gpu: add to display-vga test Gerd Hoffmann
2015-07-07 14:48 ` [Qemu-devel] [PULL for-2.4 0/3] vga patch queue Peter Maydell
3 siblings, 0 replies; 5+ messages in thread
From: Gerd Hoffmann @ 2015-07-07 12:23 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann, Michael S. Tsirkin
Switch over to virtio_instance_init_common. Drop duplicate properties
in virtio-gpu-pci and virtio-vga as they are properly aliased now. Also
drop the indirection via DEFINE_VIRTIO_GPU_PROPERTIES, we don't need it
any more as the properties are defined in a single place now.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/display/virtio-gpu-pci.c | 6 +++---
hw/display/virtio-gpu.c | 2 +-
hw/display/virtio-vga.c | 6 +++---
include/hw/virtio/virtio-gpu.h | 3 ---
4 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/hw/display/virtio-gpu-pci.c b/hw/display/virtio-gpu-pci.c
index d3e9aad..5bc62cf 100644
--- a/hw/display/virtio-gpu-pci.c
+++ b/hw/display/virtio-gpu-pci.c
@@ -17,7 +17,6 @@
#include "hw/virtio/virtio-gpu.h"
static Property virtio_gpu_pci_properties[] = {
- DEFINE_VIRTIO_GPU_PROPERTIES(VirtIOGPUPCI, vdev.conf),
DEFINE_VIRTIO_GPU_PCI_PROPERTIES(VirtIOPCIProxy),
DEFINE_PROP_END_OF_LIST(),
};
@@ -57,8 +56,9 @@ static void virtio_gpu_pci_class_init(ObjectClass *klass, void *data)
static void virtio_gpu_initfn(Object *obj)
{
VirtIOGPUPCI *dev = VIRTIO_GPU_PCI(obj);
- object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_GPU);
- object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
+
+ virtio_instance_init_common(obj, &dev->vdev, sizeof(dev->vdev),
+ TYPE_VIRTIO_GPU);
}
static const TypeInfo virtio_gpu_pci_info = {
diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
index 8c109b7..990a26b 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -871,7 +871,7 @@ static void virtio_gpu_reset(VirtIODevice *vdev)
}
static Property virtio_gpu_properties[] = {
- DEFINE_VIRTIO_GPU_PROPERTIES(VirtIOGPU, conf),
+ DEFINE_PROP_UINT32("max_outputs", VirtIOGPU, conf.max_outputs, 1),
DEFINE_PROP_END_OF_LIST(),
};
diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c
index 1b09a04..f7e539f 100644
--- a/hw/display/virtio-vga.c
+++ b/hw/display/virtio-vga.c
@@ -138,7 +138,6 @@ static void virtio_vga_reset(DeviceState *dev)
}
static Property virtio_vga_properties[] = {
- DEFINE_VIRTIO_GPU_PROPERTIES(VirtIOVGA, vdev.conf),
DEFINE_VIRTIO_GPU_PCI_PROPERTIES(VirtIOPCIProxy),
DEFINE_PROP_END_OF_LIST(),
};
@@ -162,8 +161,9 @@ static void virtio_vga_class_init(ObjectClass *klass, void *data)
static void virtio_vga_inst_initfn(Object *obj)
{
VirtIOVGA *dev = VIRTIO_VGA(obj);
- object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_GPU);
- object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
+
+ virtio_instance_init_common(obj, &dev->vdev, sizeof(dev->vdev),
+ TYPE_VIRTIO_GPU);
}
static TypeInfo virtio_vga_info = {
diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h
index b8c9244..8896761 100644
--- a/include/hw/virtio/virtio-gpu.h
+++ b/include/hw/virtio/virtio-gpu.h
@@ -112,9 +112,6 @@ extern const GraphicHwOps virtio_gpu_ops;
VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT, false), \
DEFINE_PROP_UINT32("vectors", _state, nvectors, 3)
-#define DEFINE_VIRTIO_GPU_PROPERTIES(_state, _conf_field) \
- DEFINE_PROP_UINT32("max_outputs", _state, _conf_field.max_outputs, 1)
-
#define VIRTIO_GPU_FILL_CMD(out) do { \
size_t s; \
s = iov_to_buf(cmd->elem.out_sg, cmd->elem.out_num, 0, \
--
1.8.3.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Qemu-devel] [PULL 3/3] virtio-gpu: add to display-vga test
2015-07-07 12:23 [Qemu-devel] [PULL for-2.4 0/3] vga patch queue Gerd Hoffmann
2015-07-07 12:23 ` [Qemu-devel] [PULL 1/3] virtio-gpu: update console device property Gerd Hoffmann
2015-07-07 12:23 ` [Qemu-devel] [PULL 2/3] virtio-gpu: use virtio_instance_init_common, fixup properties Gerd Hoffmann
@ 2015-07-07 12:23 ` Gerd Hoffmann
2015-07-07 14:48 ` [Qemu-devel] [PULL for-2.4 0/3] vga patch queue Peter Maydell
3 siblings, 0 replies; 5+ messages in thread
From: Gerd Hoffmann @ 2015-07-07 12:23 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
tests/Makefile | 3 +++
tests/display-vga-test.c | 18 ++++++++++++++++++
2 files changed, 21 insertions(+)
diff --git a/tests/Makefile b/tests/Makefile
index eff5e11..2cd1195 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -135,6 +135,9 @@ check-qtest-pci-y += tests/display-vga-test$(EXESUF)
gcov-files-pci-y += hw/display/vga.c
gcov-files-pci-y += hw/display/cirrus_vga.c
gcov-files-pci-y += hw/display/vga-pci.c
+gcov-files-pci-y += hw/display/virtio-gpu.c
+gcov-files-pci-y += hw/display/virtio-gpu-pci.c
+gcov-files-pci-$(CONFIG_VIRTIO_VGA) += hw/display/virtio-vga.c
check-qtest-pci-y += tests/intel-hda-test$(EXESUF)
gcov-files-pci-y += hw/audio/intel-hda.c hw/audio/hda-codec.c
diff --git a/tests/display-vga-test.c b/tests/display-vga-test.c
index 17f5910..7694344 100644
--- a/tests/display-vga-test.c
+++ b/tests/display-vga-test.c
@@ -36,6 +36,20 @@ static void pci_multihead(void)
qtest_end();
}
+static void pci_virtio_gpu(void)
+{
+ qtest_start("-vga none -device virtio-gpu-pci");
+ qtest_end();
+}
+
+#ifdef CONFIG_VIRTIO_VGA
+static void pci_virtio_vga(void)
+{
+ qtest_start("-vga none -device virtio-vga");
+ qtest_end();
+}
+#endif
+
int main(int argc, char **argv)
{
int ret;
@@ -46,6 +60,10 @@ int main(int argc, char **argv)
qtest_add_func("/display/pci/stdvga", pci_stdvga);
qtest_add_func("/display/pci/secondary", pci_secondary);
qtest_add_func("/display/pci/multihead", pci_multihead);
+ qtest_add_func("/display/pci/virtio-gpu", pci_virtio_gpu);
+#ifdef CONFIG_VIRTIO_VGA
+ qtest_add_func("/display/pci/virtio-vga", pci_virtio_vga);
+#endif
ret = g_test_run();
return ret;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PULL for-2.4 0/3] vga patch queue
2015-07-07 12:23 [Qemu-devel] [PULL for-2.4 0/3] vga patch queue Gerd Hoffmann
` (2 preceding siblings ...)
2015-07-07 12:23 ` [Qemu-devel] [PULL 3/3] virtio-gpu: add to display-vga test Gerd Hoffmann
@ 2015-07-07 14:48 ` Peter Maydell
3 siblings, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2015-07-07 14:48 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: QEMU Developers
On 7 July 2015 at 13:23, Gerd Hoffmann <kraxel@redhat.com> wrote:
> Hi,
>
> Here are some small virtio-gpu fixes for 2.4.
> A simple testcase is added too.
>
> please pull,
> Gerd
>
> The following changes since commit 5317b0f6d4bb581c5c8f88f31138ee301ad2b7e5:
>
> Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20150702-v3' into staging (2015-07-02 15:20:55 +0100)
>
> are available in the git repository at:
>
>
> git://git.kraxel.org/qemu tags/pull-vga-20150707-1
>
> for you to fetch changes up to 501eea4f4187b6c62b6cf348ab0b100d57d8c56b:
>
> virtio-gpu: add to display-vga test (2015-07-07 11:23:18 +0200)
>
> ----------------------------------------------------------------
> virtio-gpu property fixes, add testcase
>
> ----------------------------------------------------------------
> Gerd Hoffmann (3):
> virtio-gpu: update console device property.
> virtio-gpu: use virtio_instance_init_common, fixup properties
> virtio-gpu: add to display-vga test
>
Applied, thanks.
-- PMM
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-07-07 14:48 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-07 12:23 [Qemu-devel] [PULL for-2.4 0/3] vga patch queue Gerd Hoffmann
2015-07-07 12:23 ` [Qemu-devel] [PULL 1/3] virtio-gpu: update console device property Gerd Hoffmann
2015-07-07 12:23 ` [Qemu-devel] [PULL 2/3] virtio-gpu: use virtio_instance_init_common, fixup properties Gerd Hoffmann
2015-07-07 12:23 ` [Qemu-devel] [PULL 3/3] virtio-gpu: add to display-vga test Gerd Hoffmann
2015-07-07 14:48 ` [Qemu-devel] [PULL for-2.4 0/3] vga patch queue Peter Maydell
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).