[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 14/18] virtio-gpu: batch virtio_notify when using a
From: |
Marc-André Lureau |
Subject: |
[Qemu-devel] [PATCH 14/18] virtio-gpu: batch virtio_notify when using a data-plane |
Date: |
Mon, 5 Sep 2016 02:20:35 +0400 |
Use a helper to call virtio notify. If the dataplane is running,
set the notify bit and schedule the bh.
(note: this could eventually be good in non-dataplane too)
Signed-off-by: Marc-André Lureau <address@hidden>
---
hw/display/virtio-gpu.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
index 816f37c..34d4a92 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -228,6 +228,16 @@ virtio_gpu_find_resource(VirtIOGPU *g, uint32_t
resource_id)
return NULL;
}
+static void virtio_gpu_notify_vq(VirtIOGPU *g, VirtQueue *vq)
+{
+ if (VIRTIO_GPU_DATA_PLANE_OK(g->dp)) {
+ set_bit(virtio_get_queue_index(vq), g->dp->batch_notify_vqs);
+ qemu_bh_schedule(g->dp->notify_guest_bh);
+ } else {
+ virtio_notify(VIRTIO_DEVICE(g), vq);
+ }
+}
+
void virtio_gpu_ctrl_response(VirtIOGPU *g,
struct virtio_gpu_ctrl_command *cmd,
struct virtio_gpu_ctrl_hdr *resp,
@@ -249,7 +259,7 @@ void virtio_gpu_ctrl_response(VirtIOGPU *g,
__func__, s, resp_len);
}
virtqueue_push(vq, &cmd->elem, s);
- virtio_notify(VIRTIO_DEVICE(g), vq);
+ virtio_gpu_notify_vq(g, vq);
cmd->finished = true;
}
@@ -925,7 +935,7 @@ static void virtio_gpu_handle_cursor(VirtIODevice *vdev,
VirtQueue *vq)
update_cursor(g, &cursor_info);
}
virtqueue_push(vq, elem, 0);
- virtio_notify(vdev, vq);
+ virtio_gpu_notify_vq(g, vq);
g_free(elem);
}
}
--
2.9.0
- [Qemu-devel] [PATCH 01/18] console: skip same-size resize, (continued)
- [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, 2016/09/04
- [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 <=
- [Qemu-devel] [PATCH 13/18] virtio-gpu: add a virgl data-plane, Marc-André Lureau, 2016/09/04
- [Qemu-devel] [PATCH 16/18] virtio-gpu: use virgl thread sync with the data-plane, Marc-André Lureau, 2016/09/04
- [Qemu-devel] [PATCH 15/18] virtio-gpu: dispatch to main thread for scanout & flush, Marc-André Lureau, 2016/09/04
- [Qemu-devel] [PATCH 17/18] virtio-gpu: schedule a bh to unblock the data-plane, Marc-André Lureau, 2016/09/04
- [Qemu-devel] [PATCH 18/18] virtio-gpu: start/stop the data-plane, Marc-André Lureau, 2016/09/04
- Re: [Qemu-devel] [PATCH 00/18] virgl: use a seperate rendering thread, no-reply, 2016/09/04
- Re: [Qemu-devel] [PATCH 00/18] virgl: use a seperate rendering thread, no-reply, 2016/09/04
- Re: [Qemu-devel] [PATCH 00/18] virgl: use a seperate rendering thread, Gerd Hoffmann, 2016/09/08