[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 03/18] virtio-gpu: add "iothread" property
From: |
Marc-André Lureau |
Subject: |
[Qemu-devel] [PATCH 03/18] virtio-gpu: add "iothread" property |
Date: |
Mon, 5 Sep 2016 02:20:24 +0400 |
For now, this just links the device with an iothread, but doesn't make
use of it yet. (the following commits will create context for it,
messages, and then dispatch virtio queues to run the renderer)
Signed-off-by: Marc-André Lureau <address@hidden>
---
hw/display/virtio-gpu-pci.c | 2 ++
hw/display/virtio-gpu.c | 6 ++++++
hw/display/virtio-vga.c | 2 ++
include/hw/virtio/virtio-gpu.h | 4 ++++
4 files changed, 14 insertions(+)
diff --git a/hw/display/virtio-gpu-pci.c b/hw/display/virtio-gpu-pci.c
index 34a724c..df583ed 100644
--- a/hw/display/virtio-gpu-pci.c
+++ b/hw/display/virtio-gpu-pci.c
@@ -58,6 +58,8 @@ static void virtio_gpu_initfn(Object *obj)
virtio_instance_init_common(obj, &dev->vdev, sizeof(dev->vdev),
TYPE_VIRTIO_GPU);
+ object_property_add_alias(obj, "iothread", OBJECT(&dev->vdev), "iothread",
+ &error_abort);
}
static const TypeInfo virtio_gpu_pci_info = {
diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
index 7fe6ed8..78b3453 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -1177,6 +1177,12 @@ static void virtio_gpu_device_unrealize(DeviceState
*qdev, Error **errp)
static void virtio_gpu_instance_init(Object *obj)
{
+ VirtIOGPU *g = VIRTIO_GPU(obj);
+
+ object_property_add_link(obj, "iothread", TYPE_IOTHREAD,
+ (Object **)&g->iothread,
+ qdev_prop_allow_set_link_before_realize,
+ OBJ_PROP_LINK_UNREF_ON_RELEASE, NULL);
}
static void virtio_gpu_reset(VirtIODevice *vdev)
diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c
index 5b510a1..5ba6daa 100644
--- a/hw/display/virtio-vga.c
+++ b/hw/display/virtio-vga.c
@@ -191,6 +191,8 @@ static void virtio_vga_inst_initfn(Object *obj)
virtio_instance_init_common(obj, &dev->vdev, sizeof(dev->vdev),
TYPE_VIRTIO_GPU);
+ object_property_add_alias(obj, "iothread", OBJECT(&dev->vdev), "iothread",
+ &error_abort);
}
static TypeInfo virtio_vga_info = {
diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h
index 20d1cd6..270aaf5 100644
--- a/include/hw/virtio/virtio-gpu.h
+++ b/include/hw/virtio/virtio-gpu.h
@@ -20,6 +20,7 @@
#include "hw/virtio/virtio.h"
#include "hw/pci/pci.h"
#include "qemu/log.h"
+#include "sysemu/iothread.h"
#include "standard-headers/linux/virtio_gpu.h"
#define TYPE_VIRTIO_GPU "virtio-gpu-device"
@@ -109,6 +110,9 @@ typedef struct VirtIOGPU {
bool use_virgl_renderer;
bool renderer_inited;
int renderer_blocked;
+
+ IOThread *iothread;
+
QEMUTimer *fence_poll;
QEMUTimer *print_stats;
--
2.9.0
- [Qemu-devel] [PATCH 00/18] virgl: use a seperate rendering thread, Marc-André Lureau, 2016/09/04
- [Qemu-devel] [PATCH 02/18] console: add dpy_gl_ctx_is_mt_safe, Marc-André Lureau, 2016/09/04
- [Qemu-devel] [PATCH 04/18] virtio-gpu: start splitting scanout/resource flushing, Marc-André Lureau, 2016/09/04
- [Qemu-devel] [PATCH 01/18] console: skip same-size resize, Marc-André Lureau, 2016/09/04
- [Qemu-devel] [PATCH 03/18] virtio-gpu: add "iothread" property,
Marc-André Lureau <=
- [Qemu-devel] [PATCH 05/18] virtio-gpu: start introducing a lock around the display info, Marc-André Lureau, 2016/09/04
- [Qemu-devel] [PATCH 06/18] virtio-gpu: create a thread context, Marc-André Lureau, 2016/09/04
- [Qemu-devel] [PATCH 08/18] gl: bind GL api before context creation, Marc-André Lureau, 2016/09/04
- [Qemu-devel] [PATCH 07/18] gl: allow to keep current context in ctx-create, Marc-André Lureau, 2016/09/04
- [Qemu-devel] [PATCH 09/18] bitmap: add a simple foreach util, Marc-André Lureau, 2016/09/04
- [Qemu-devel] [PATCH 11/18] virtio-gpu: use a bh for cursor modifications, Marc-André Lureau, 2016/09/04
- [Qemu-devel] [PATCH 10/18] virtio-blk: use bitmap_foreach, Marc-André Lureau, 2016/09/04
- [Qemu-devel] [PATCH 12/18] virtio-gpu: save a pointer from virtio_gpu_ctrl_command, Marc-André Lureau, 2016/09/04
- [Qemu-devel] [PATCH 14/18] virtio-gpu: batch virtio_notify when using a data-plane, Marc-André Lureau, 2016/09/04
- [Qemu-devel] [PATCH 13/18] virtio-gpu: add a virgl data-plane, Marc-André Lureau, 2016/09/04