From 11c82b584a4578f7c7e408448c9f61c729acabae Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Tue, 6 Mar 2018 10:09:46 +0100 Subject: ui/gtk: make GtkGlArea usage a runtime option Compile in both gtk-egl and gtk-gl-area, then allow to choose at runtime instead of compile time which opengl variant we want use. Signed-off-by: Gerd Hoffmann Message-id: 20180306090951.22932-2-kraxel@redhat.com --- include/ui/gtk.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/ui/gtk.h b/include/ui/gtk.h index 849c896..f6dafc5 100644 --- a/include/ui/gtk.h +++ b/include/ui/gtk.h @@ -90,6 +90,8 @@ typedef struct VirtualConsole { }; } VirtualConsole; +extern bool gtk_use_gl_area; + /* ui/gtk.c */ void gd_update_windowsize(VirtualConsole *vc); -- cgit v1.1 From 70763fea4fbbe2984fd2a8f6ce9c77114af80792 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Tue, 6 Mar 2018 10:09:50 +0100 Subject: ui/gtk-egl: add scanout_dmabuf support Add support for dmabuf scanouts to gtk-egl. Signed-off-by: Gerd Hoffmann Message-id: 20180306090951.22932-6-kraxel@redhat.com --- include/ui/gtk.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/ui/gtk.h b/include/ui/gtk.h index f6dafc5..84c992c 100644 --- a/include/ui/gtk.h +++ b/include/ui/gtk.h @@ -113,6 +113,10 @@ void gd_egl_scanout_texture(DisplayChangeListener *dcl, uint32_t backing_height, uint32_t x, uint32_t y, uint32_t w, uint32_t h); +void gd_egl_scanout_dmabuf(DisplayChangeListener *dcl, + QemuDmaBuf *dmabuf); +void gd_egl_release_dmabuf(DisplayChangeListener *dcl, + QemuDmaBuf *dmabuf); void gd_egl_scanout_flush(DisplayChangeListener *dcl, uint32_t x, uint32_t y, uint32_t w, uint32_t h); void gtk_egl_init(void); -- cgit v1.1 From f1bd313264925dfb229a2152eb3f60fe55746b83 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Tue, 6 Mar 2018 10:09:51 +0100 Subject: ui/gtk-egl: add cursor_dmabuf support Add support for cursor dmabufs to gtk-egl. Just blend in the cursor (if we have one) when rendering the dmabuf. Signed-off-by: Gerd Hoffmann Message-id: 20180306090951.22932-7-kraxel@redhat.com --- include/ui/gtk.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/ui/gtk.h b/include/ui/gtk.h index 84c992c..2922fc6 100644 --- a/include/ui/gtk.h +++ b/include/ui/gtk.h @@ -54,6 +54,9 @@ typedef struct VirtualGfxConsole { int x, y, w, h; egl_fb guest_fb; egl_fb win_fb; + egl_fb cursor_fb; + int cursor_x; + int cursor_y; bool y0_top; bool scanout_mode; #endif @@ -115,6 +118,11 @@ void gd_egl_scanout_texture(DisplayChangeListener *dcl, uint32_t w, uint32_t h); void gd_egl_scanout_dmabuf(DisplayChangeListener *dcl, QemuDmaBuf *dmabuf); +void gd_egl_cursor_dmabuf(DisplayChangeListener *dcl, + QemuDmaBuf *dmabuf, bool have_hot, + uint32_t hot_x, uint32_t hot_y); +void gd_egl_cursor_position(DisplayChangeListener *dcl, + uint32_t pos_x, uint32_t pos_y); void gd_egl_release_dmabuf(DisplayChangeListener *dcl, QemuDmaBuf *dmabuf); void gd_egl_scanout_flush(DisplayChangeListener *dcl, -- cgit v1.1 From 2e5567c903ad05d312de0c3188cb2d3b856fa4c4 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Thu, 8 Mar 2018 17:18:03 +0100 Subject: vnc: deal with surface NULL pointers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Secondary displays in multihead setups are allowed to have a NULL DisplaySurface. Typically user interfaces handle this by hiding the window which shows the display in question. This isn't an option for vnc though because it simply hasn't a concept of windows or outputs. So handle the situation by showing a placeholder DisplaySurface instead. Also check in console_select whenever a surface is preset in the first place before requesting an update. This fixes a segfault which can be triggered by switching to an unused display (via vtrl-alt-) in a multihead setup, for example using -device virtio-vga,max_outputs=2. Cc: Christian Borntraeger Signed-off-by: Gerd Hoffmann Reviewed-by: Philippe Mathieu-Daudé Tested-by: Christian Borntraeger Message-id: 20180308161803.6152-1-kraxel@redhat.com --- include/ui/console.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/ui/console.h b/include/ui/console.h index aae9e44..5fca9af 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -260,6 +260,8 @@ DisplaySurface *qemu_create_displaysurface_guestmem(int width, int height, pixman_format_code_t format, int linesize, uint64_t addr); +DisplaySurface *qemu_create_message_surface(int w, int h, + const char *msg); PixelFormat qemu_default_pixelformat(int bpp); DisplaySurface *qemu_create_displaysurface(int width, int height); -- cgit v1.1 From b153f9019b5fcf7c085de688b123eb34f924f870 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Thu, 8 Mar 2018 10:06:17 +0100 Subject: spice: add cursor_dmabuf support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add support for cursor dmabufs. qemu has to render the cursor for that, so in case a cursor is present qemu allocates a new dmabuf, blits the scanout, blends in the pointer and passes on the new dmabuf to spice-server. Without cursor qemu continues to simply pass on the scanout dmabuf as-is. Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-André Lureau Message-id: 20180308090618.30147-4-kraxel@redhat.com --- include/ui/spice-display.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/ui/spice-display.h b/include/ui/spice-display.h index 6b5c73b..87a84a5 100644 --- a/include/ui/spice-display.h +++ b/include/ui/spice-display.h @@ -122,6 +122,15 @@ struct SimpleSpiceDisplay { int gl_updates; bool have_scanout; bool have_surface; + + QemuDmaBuf *guest_dmabuf; + bool guest_dmabuf_refresh; + bool render_cursor; + + egl_fb guest_fb; + egl_fb blit_fb; + egl_fb cursor_fb; + bool have_hot; #endif }; -- cgit v1.1