[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 18/27] vhost-user-gpu: add vg_send_dmabuf_update()
From: |
marcandre . lureau |
Subject: |
[PATCH 18/27] vhost-user-gpu: add vg_send_dmabuf_update() |
Date: |
Fri, 12 Mar 2021 14:00:59 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
contrib/vhost-user-gpu/vugpu.h | 6 +++++
contrib/vhost-user-gpu/vhost-user-gpu.c | 32 +++++++++++++++----------
contrib/vhost-user-gpu/virgl.c | 11 +--------
3 files changed, 27 insertions(+), 22 deletions(-)
diff --git a/contrib/vhost-user-gpu/vugpu.h b/contrib/vhost-user-gpu/vugpu.h
index 759de56502..f2e80d255d 100644
--- a/contrib/vhost-user-gpu/vugpu.h
+++ b/contrib/vhost-user-gpu/vugpu.h
@@ -188,5 +188,11 @@ void vg_send_dmabuf_scanout(VuGpu *g,
int fd_drm_fourcc,
uint32_t fd_flags,
int fd);
+void vg_send_dmabuf_update(VuGpu *g,
+ uint32_t scanout_id,
+ uint32_t x,
+ uint32_t y,
+ uint32_t width,
+ uint32_t height);
#endif
diff --git a/contrib/vhost-user-gpu/vhost-user-gpu.c
b/contrib/vhost-user-gpu/vhost-user-gpu.c
index 8c3ee8aad8..fc8e62f20e 100644
--- a/contrib/vhost-user-gpu/vhost-user-gpu.c
+++ b/contrib/vhost-user-gpu/vhost-user-gpu.c
@@ -618,6 +618,25 @@ vg_send_dmabuf_scanout(VuGpu *g,
vg_send_msg(g, &msg, fd);
}
+void
+vg_send_dmabuf_update(VuGpu *g,
+ uint32_t scanout_id,
+ uint32_t x,
+ uint32_t y,
+ uint32_t width,
+ uint32_t height)
+{
+ VhostUserGpuMsg msg = {
+ .request = VHOST_USER_GPU_DMABUF_UPDATE,
+ .size = sizeof(VhostUserGpuUpdate),
+ .payload.update.scanout_id = scanout_id,
+ .payload.update.x = x,
+ .payload.update.y = y,
+ .payload.update.width = width,
+ .payload.update.height = height
+ };
+ vg_send_msg(g, &msg, -1);
+}
static void
vg_set_scanout(VuGpu *g,
@@ -765,18 +784,7 @@ vg_resource_flush(VuGpu *g,
size_t height = extents->y2 - extents->y1;
if (vugbm_buffer_can_get_dmabuf_fd(&res->buffer)) {
- VhostUserGpuMsg vmsg = {
- .request = VHOST_USER_GPU_DMABUF_UPDATE,
- .size = sizeof(VhostUserGpuUpdate),
- .payload.update = (VhostUserGpuUpdate) {
- .scanout_id = i,
- .x = extents->x1,
- .y = extents->y1,
- .width = width,
- .height = height,
- }
- };
- vg_send_msg(g, &vmsg, -1);
+ vg_send_dmabuf_update(g, i, extents->x1, extents->y1, width,
height);
vg_wait_ok(g);
} else {
size_t bpp =
diff --git a/contrib/vhost-user-gpu/virgl.c b/contrib/vhost-user-gpu/virgl.c
index 0c7f118556..b17cf22986 100644
--- a/contrib/vhost-user-gpu/virgl.c
+++ b/contrib/vhost-user-gpu/virgl.c
@@ -370,16 +370,7 @@ virgl_cmd_resource_flush(VuGpu *g,
if (g->scanout[i].resource_id != rf.resource_id) {
continue;
}
- VhostUserGpuMsg msg = {
- .request = VHOST_USER_GPU_DMABUF_UPDATE,
- .size = sizeof(VhostUserGpuUpdate),
- .payload.update.scanout_id = i,
- .payload.update.x = rf.r.x,
- .payload.update.y = rf.r.y,
- .payload.update.width = rf.r.width,
- .payload.update.height = rf.r.height
- };
- vg_send_msg(g, &msg, -1);
+ vg_send_dmabuf_update(g, i, rf.r.x, rf.r.y, rf.r.width, rf.r.height);
vg_wait_ok(g);
}
}
--
2.29.0
- [PATCH 09/27] ui: simplify gl unblock & flush, (continued)
- [PATCH 09/27] ui: simplify gl unblock & flush, marcandre . lureau, 2021/03/12
- [PATCH 10/27] ui: dispatch GL events to all listeners, marcandre . lureau, 2021/03/12
- [PATCH 11/27] ui: split the GL context in a different object, marcandre . lureau, 2021/03/12
- [PATCH 12/27] ui: move qemu_spice_fill_device_address to ui/util.c, marcandre . lureau, 2021/03/12
- [PATCH 13/27] console: save current scanout details, marcandre . lureau, 2021/03/12
- [PATCH 14/27] ui: add a D-Bus display backend, marcandre . lureau, 2021/03/12
- [PATCH 15/27] audio: add dbusaudio backend, marcandre . lureau, 2021/03/12
- [PATCH 16/27] vhost-user-gpu: add vg_send_disable_scanout(), marcandre . lureau, 2021/03/12
- [PATCH 17/27] vhost-user-gpu: add vg_send_scanout_dmabuf(), marcandre . lureau, 2021/03/12
- [PATCH 18/27] vhost-user-gpu: add vg_send_dmabuf_update(),
marcandre . lureau <=
- [PATCH 19/27] vhost-user-gpu: add vg_send_scanout(), marcandre . lureau, 2021/03/12
- [PATCH 20/27] vhost-user-gpu: add vg_send_cursor_update(), marcandre . lureau, 2021/03/12
- [PATCH 21/27] vhost-user-gpu: add vg_send_cursor_pos(), marcandre . lureau, 2021/03/12
- [PATCH 22/27] vhost-user-gpu: add vg_send_update(), marcandre . lureau, 2021/03/12
- [PATCH 23/27] vhost-user: add VHOST_USER_GPU_QEMU_DBUS_LISTENER, marcandre . lureau, 2021/03/12
- [PATCH 24/27] ui: add GraphicHwOps.register_dbus_listener(), marcandre . lureau, 2021/03/12
- [PATCH 25/27] vhost-user-gpu: implement register_dbus_listener(), marcandre . lureau, 2021/03/12
- [PATCH 26/27] vhost-user-gpu: check the PIXMAN format is supported, marcandre . lureau, 2021/03/12
- [PATCH 27/27] vhost-user-gpu: implement GPU_QEMU_DBUS_LISTENER, marcandre . lureau, 2021/03/12
- Re: [PATCH 00/27] Add D-Bus display backend, no-reply, 2021/03/12