* [Qemu-devel] [PATCH 0/3] virtio-gpu & spice multihead fixes
@ 2016-06-14 13:44 marcandre.lureau
2016-06-14 13:44 ` [Qemu-devel] [PATCH 1/3] virgl: count the calls to gl_block marcandre.lureau
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: marcandre.lureau @ 2016-06-14 13:44 UTC (permalink / raw)
To: qemu-devel; +Cc: kraxel, Marc-André Lureau
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Hi
Here are a few fixes for virtio-gpu multihead & spice support. To
actually test this, you also need pending kernel fixes, and a small
fix in spice-gtk for the virgl case.
Marc-André Lureau (3):
virgl: count the calls to gl_block
spice: use the right head for multi-monitor
virgl: pass whole GL scanout dimensions
hw/display/virtio-gpu-3d.c | 5 +++--
hw/display/virtio-gpu.c | 10 ++++++++--
include/hw/virtio/virtio-gpu.h | 2 +-
include/ui/console.h | 2 ++
include/ui/gtk.h | 1 +
include/ui/sdl2.h | 1 +
ui/console.c | 2 ++
ui/gtk-egl.c | 1 +
ui/sdl2-gl.c | 1 +
ui/spice-display.c | 19 +++++++++----------
10 files changed, 29 insertions(+), 15 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Qemu-devel] [PATCH 1/3] virgl: count the calls to gl_block
2016-06-14 13:44 [Qemu-devel] [PATCH 0/3] virtio-gpu & spice multihead fixes marcandre.lureau
@ 2016-06-14 13:44 ` marcandre.lureau
2016-06-14 13:44 ` [Qemu-devel] [PATCH 2/3] spice: use the right head for multi-monitor marcandre.lureau
2016-06-14 13:44 ` [Qemu-devel] [PATCH 3/3] virgl: pass whole GL scanout dimensions marcandre.lureau
2 siblings, 0 replies; 4+ messages in thread
From: marcandre.lureau @ 2016-06-14 13:44 UTC (permalink / raw)
To: qemu-devel; +Cc: kraxel, Marc-André Lureau
From: Marc-André Lureau <marcandre.lureau@redhat.com>
In virgl_cmd_resource_flush(), when several consoles are updated, it
needs to keep blocking until all spice gl draws are done. This fixes an
assert() in spice when using multiple monitors with virgl.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
hw/display/virtio-gpu.c | 10 ++++++++--
include/hw/virtio/virtio-gpu.h | 2 +-
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
index 136c095..f8b0274 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -934,8 +934,14 @@ static void virtio_gpu_gl_block(void *opaque, bool block)
{
VirtIOGPU *g = opaque;
- g->renderer_blocked = block;
- if (!block) {
+ if (block) {
+ g->renderer_blocked++;
+ } else {
+ g->renderer_blocked--;
+ }
+ assert(g->renderer_blocked >= 0);
+
+ if (g->renderer_blocked == 0) {
virtio_gpu_process_cmdq(g);
}
}
diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h
index 89f4879..3dff0c9 100644
--- a/include/hw/virtio/virtio-gpu.h
+++ b/include/hw/virtio/virtio-gpu.h
@@ -107,7 +107,7 @@ typedef struct VirtIOGPU {
bool use_virgl_renderer;
bool renderer_inited;
- bool renderer_blocked;
+ int renderer_blocked;
QEMUTimer *fence_poll;
QEMUTimer *print_stats;
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Qemu-devel] [PATCH 2/3] spice: use the right head for multi-monitor
2016-06-14 13:44 [Qemu-devel] [PATCH 0/3] virtio-gpu & spice multihead fixes marcandre.lureau
2016-06-14 13:44 ` [Qemu-devel] [PATCH 1/3] virgl: count the calls to gl_block marcandre.lureau
@ 2016-06-14 13:44 ` marcandre.lureau
2016-06-14 13:44 ` [Qemu-devel] [PATCH 3/3] virgl: pass whole GL scanout dimensions marcandre.lureau
2 siblings, 0 replies; 4+ messages in thread
From: marcandre.lureau @ 2016-06-14 13:44 UTC (permalink / raw)
To: qemu-devel; +Cc: kraxel, Marc-André Lureau
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Look up the associated head monitor config.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
ui/spice-display.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/ui/spice-display.c b/ui/spice-display.c
index 34095fb..142c941 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -686,6 +686,7 @@ static int interface_client_monitors_config(QXLInstance *sin,
{
SimpleSpiceDisplay *ssd = container_of(sin, SimpleSpiceDisplay, qxl);
QemuUIInfo info;
+ int head;
if (!dpy_ui_info_supported(ssd->dcl.con)) {
return 0; /* == not supported by guest */
@@ -695,14 +696,12 @@ static int interface_client_monitors_config(QXLInstance *sin,
return 1;
}
- /*
- * FIXME: multihead is tricky due to the way
- * spice has multihead implemented.
- */
memset(&info, 0, sizeof(info));
- if (mc->num_of_monitors > 0) {
- info.width = mc->monitors[0].width;
- info.height = mc->monitors[0].height;
+
+ head = qemu_console_get_head(ssd->dcl.con);
+ if (mc->num_of_monitors > head) {
+ info.width = mc->monitors[head].width;
+ info.height = mc->monitors[head].height;
}
dpy_set_ui_info(ssd->dcl.con, &info);
dprint(1, "%s/%d: size %dx%d\n", __func__, ssd->qxl.id,
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Qemu-devel] [PATCH 3/3] virgl: pass whole GL scanout dimensions
2016-06-14 13:44 [Qemu-devel] [PATCH 0/3] virtio-gpu & spice multihead fixes marcandre.lureau
2016-06-14 13:44 ` [Qemu-devel] [PATCH 1/3] virgl: count the calls to gl_block marcandre.lureau
2016-06-14 13:44 ` [Qemu-devel] [PATCH 2/3] spice: use the right head for multi-monitor marcandre.lureau
@ 2016-06-14 13:44 ` marcandre.lureau
2 siblings, 0 replies; 4+ messages in thread
From: marcandre.lureau @ 2016-06-14 13:44 UTC (permalink / raw)
To: qemu-devel; +Cc: kraxel, Marc-André Lureau
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Spice client needs the whole GL texture dimension to be able to show a
scanout with a monitor offset (different than +0+0).
Furthermore, this fixes a crash when calling surface_{width,height}()
after dpy_gfx_replace_surface(con, NULL) was called in
virgl_cmd_set_scanout()
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
hw/display/virtio-gpu-3d.c | 5 +++--
include/ui/console.h | 2 ++
include/ui/gtk.h | 1 +
include/ui/sdl2.h | 1 +
ui/console.c | 2 ++
ui/gtk-egl.c | 1 +
ui/sdl2-gl.c | 1 +
ui/spice-display.c | 6 +++---
8 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/hw/display/virtio-gpu-3d.c b/hw/display/virtio-gpu-3d.c
index 29918a0..d6c8c6e 100644
--- a/hw/display/virtio-gpu-3d.c
+++ b/hw/display/virtio-gpu-3d.c
@@ -171,13 +171,14 @@ static void virgl_cmd_set_scanout(VirtIOGPU *g,
virgl_renderer_force_ctx_0();
dpy_gl_scanout(g->scanout[ss.scanout_id].con, info.tex_id,
info.flags & 1 /* FIXME: Y_0_TOP */,
+ info.width, info.height,
ss.r.x, ss.r.y, ss.r.width, ss.r.height);
} else {
if (ss.scanout_id != 0) {
dpy_gfx_replace_surface(g->scanout[ss.scanout_id].con, NULL);
}
dpy_gl_scanout(g->scanout[ss.scanout_id].con, 0, false,
- 0, 0, 0, 0);
+ 0, 0, 0, 0, 0, 0);
}
g->scanout[ss.scanout_id].resource_id = ss.resource_id;
}
@@ -580,7 +581,7 @@ void virtio_gpu_virgl_reset(VirtIOGPU *g)
if (i != 0) {
dpy_gfx_replace_surface(g->scanout[i].con, NULL);
}
- dpy_gl_scanout(g->scanout[i].con, 0, false, 0, 0, 0, 0);
+ dpy_gl_scanout(g->scanout[i].con, 0, false, 0, 0, 0, 0, 0, 0);
}
}
diff --git a/include/ui/console.h b/include/ui/console.h
index 52a5f65..c2d75ff 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -217,6 +217,7 @@ typedef struct DisplayChangeListenerOps {
void (*dpy_gl_scanout)(DisplayChangeListener *dcl,
uint32_t backing_id, bool backing_y_0_top,
+ uint32_t backing_width, uint32_t backing_height,
uint32_t x, uint32_t y, uint32_t w, uint32_t h);
void (*dpy_gl_update)(DisplayChangeListener *dcl,
uint32_t x, uint32_t y, uint32_t w, uint32_t h);
@@ -285,6 +286,7 @@ bool dpy_gfx_check_format(QemuConsole *con,
void dpy_gl_scanout(QemuConsole *con,
uint32_t backing_id, bool backing_y_0_top,
+ uint32_t backing_width, uint32_t backing_height,
uint32_t x, uint32_t y, uint32_t w, uint32_t h);
void dpy_gl_update(QemuConsole *con,
uint32_t x, uint32_t y, uint32_t w, uint32_t h);
diff --git a/include/ui/gtk.h b/include/ui/gtk.h
index 2bf60f3..a764404 100644
--- a/include/ui/gtk.h
+++ b/include/ui/gtk.h
@@ -101,6 +101,7 @@ QEMUGLContext gd_egl_create_context(DisplayChangeListener *dcl,
QEMUGLParams *params);
void gd_egl_scanout(DisplayChangeListener *dcl,
uint32_t backing_id, bool backing_y_0_top,
+ uint32_t backing_width, uint32_t backing_height,
uint32_t x, uint32_t y,
uint32_t w, uint32_t h);
void gd_egl_scanout_flush(DisplayChangeListener *dcl,
diff --git a/include/ui/sdl2.h b/include/ui/sdl2.h
index 3f0b57b..683bb6a 100644
--- a/include/ui/sdl2.h
+++ b/include/ui/sdl2.h
@@ -64,6 +64,7 @@ QEMUGLContext sdl2_gl_get_current_context(DisplayChangeListener *dcl);
void sdl2_gl_scanout(DisplayChangeListener *dcl,
uint32_t backing_id, bool backing_y_0_top,
+ uint32_t backing_width, uint32_t backing_height,
uint32_t x, uint32_t y,
uint32_t w, uint32_t h);
void sdl2_gl_scanout_flush(DisplayChangeListener *dcl,
diff --git a/ui/console.c b/ui/console.c
index ce1e105..c24bfe4 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -1709,11 +1709,13 @@ QEMUGLContext dpy_gl_ctx_get_current(QemuConsole *con)
void dpy_gl_scanout(QemuConsole *con,
uint32_t backing_id, bool backing_y_0_top,
+ uint32_t backing_width, uint32_t backing_height,
uint32_t x, uint32_t y, uint32_t width, uint32_t height)
{
assert(con->gl);
con->gl->ops->dpy_gl_scanout(con->gl, backing_id,
backing_y_0_top,
+ backing_width, backing_height,
x, y, width, height);
}
diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c
index 431457c..3f5d328 100644
--- a/ui/gtk-egl.c
+++ b/ui/gtk-egl.c
@@ -172,6 +172,7 @@ QEMUGLContext gd_egl_create_context(DisplayChangeListener *dcl,
void gd_egl_scanout(DisplayChangeListener *dcl,
uint32_t backing_id, bool backing_y_0_top,
+ uint32_t backing_width, uint32_t backing_height,
uint32_t x, uint32_t y,
uint32_t w, uint32_t h)
{
diff --git a/ui/sdl2-gl.c b/ui/sdl2-gl.c
index a324eca..039645d 100644
--- a/ui/sdl2-gl.c
+++ b/ui/sdl2-gl.c
@@ -186,6 +186,7 @@ QEMUGLContext sdl2_gl_get_current_context(DisplayChangeListener *dcl)
void sdl2_gl_scanout(DisplayChangeListener *dcl,
uint32_t backing_id, bool backing_y_0_top,
+ uint32_t backing_width, uint32_t backing_height,
uint32_t x, uint32_t y,
uint32_t w, uint32_t h)
{
diff --git a/ui/spice-display.c b/ui/spice-display.c
index 142c941..b511ff6 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -857,6 +857,8 @@ static QEMUGLContext qemu_spice_gl_create_context(DisplayChangeListener *dcl,
static void qemu_spice_gl_scanout(DisplayChangeListener *dcl,
uint32_t tex_id,
bool y_0_top,
+ uint32_t backing_width,
+ uint32_t backing_height,
uint32_t x, uint32_t y,
uint32_t w, uint32_t h)
{
@@ -879,9 +881,7 @@ static void qemu_spice_gl_scanout(DisplayChangeListener *dcl,
assert(!tex_id || fd >= 0);
/* note: spice server will close the fd */
- spice_qxl_gl_scanout(&ssd->qxl, fd,
- surface_width(ssd->ds),
- surface_height(ssd->ds),
+ spice_qxl_gl_scanout(&ssd->qxl, fd, backing_width, backing_height,
stride, fourcc, y_0_top);
qemu_spice_gl_monitor_config(ssd, x, y, w, h);
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-06-14 13:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-14 13:44 [Qemu-devel] [PATCH 0/3] virtio-gpu & spice multihead fixes marcandre.lureau
2016-06-14 13:44 ` [Qemu-devel] [PATCH 1/3] virgl: count the calls to gl_block marcandre.lureau
2016-06-14 13:44 ` [Qemu-devel] [PATCH 2/3] spice: use the right head for multi-monitor marcandre.lureau
2016-06-14 13:44 ` [Qemu-devel] [PATCH 3/3] virgl: pass whole GL scanout dimensions marcandre.lureau
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).