From nobody Thu Nov 6 18:06:05 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1488213234463721.4187105668848; Mon, 27 Feb 2017 08:33:54 -0800 (PST) Received: from localhost ([::1]:54156 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciOFE-0006Qg-Gs for importer@patchew.org; Mon, 27 Feb 2017 11:33:52 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41571) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciO0i-0002RA-6Y for qemu-devel@nongnu.org; Mon, 27 Feb 2017 11:18:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ciO0g-0002mD-Db for qemu-devel@nongnu.org; Mon, 27 Feb 2017 11:18:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48274) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ciO0g-0002lf-4o for qemu-devel@nongnu.org; Mon, 27 Feb 2017 11:18:50 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6277164A53 for ; Mon, 27 Feb 2017 16:18:50 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1RGIlPZ007727; Mon, 27 Feb 2017 11:18:48 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id DFD0180855; Mon, 27 Feb 2017 17:18:44 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 27 Feb 2017 17:18:35 +0100 Message-Id: <1488212323-26882-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1488212323-26882-1-git-send-email-kraxel@redhat.com> References: <1488212323-26882-1-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 27 Feb 2017 16:18:50 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/9] console: rename dpy_gl_scanout to dpy_gl_scanout_texture X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We'll add a variant which accepts dmabufs soon. Change the name so we can easily disturgish the two variants. Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-Andr=C3=A9 Lureau Message-id: 1487669841-13668-2-git-send-email-kraxel@redhat.com --- hw/display/virtio-gpu-3d.c | 14 +++++++------- include/ui/console.h | 19 +++++++++++-------- include/ui/gtk.h | 24 ++++++++++++++---------- include/ui/sdl2.h | 12 +++++++----- ui/console.c | 19 +++++++++++-------- ui/gtk-egl.c | 10 +++++----- ui/gtk-gl-area.c | 12 +++++++----- ui/gtk.c | 4 ++-- ui/sdl2-gl.c | 12 +++++++----- ui/sdl2.c | 2 +- ui/spice-display.c | 16 ++++++++-------- 11 files changed, 80 insertions(+), 64 deletions(-) diff --git a/hw/display/virtio-gpu-3d.c b/hw/display/virtio-gpu-3d.c index ecb09d1..b526b3f 100644 --- a/hw/display/virtio-gpu-3d.c +++ b/hw/display/virtio-gpu-3d.c @@ -177,16 +177,16 @@ static void virgl_cmd_set_scanout(VirtIOGPU *g, qemu_console_resize(g->scanout[ss.scanout_id].con, ss.r.width, ss.r.height); 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); + dpy_gl_scanout_texture(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 !=3D 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); + dpy_gl_scanout_texture(g->scanout[ss.scanout_id].con, 0, false, + 0, 0, 0, 0, 0, 0); } g->scanout[ss.scanout_id].resource_id =3D ss.resource_id; } @@ -597,7 +597,7 @@ void virtio_gpu_virgl_reset(VirtIOGPU *g) if (i !=3D 0) { dpy_gfx_replace_surface(g->scanout[i].con, NULL); } - dpy_gl_scanout(g->scanout[i].con, 0, false, 0, 0, 0, 0, 0, 0); + dpy_gl_scanout_texture(g->scanout[i].con, 0, false, 0, 0, 0, 0, 0,= 0); } } =20 diff --git a/include/ui/console.h b/include/ui/console.h index af6350e..e6ae637 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -215,10 +215,13 @@ typedef struct DisplayChangeListenerOps { QEMUGLContext ctx); QEMUGLContext (*dpy_gl_ctx_get_current)(DisplayChangeListener *dcl); =20 - 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_scanout_texture)(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); =20 @@ -284,10 +287,10 @@ bool dpy_cursor_define_supported(QemuConsole *con); bool dpy_gfx_check_format(QemuConsole *con, pixman_format_code_t format); =20 -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_scanout_texture(QemuConsole *con, + uint32_t backing_id, bool backing_y_0_top, + uint32_t backing_width, uint32_t backing_heigh= t, + 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); =20 diff --git a/include/ui/gtk.h b/include/ui/gtk.h index 47ffddb..408e21b 100644 --- a/include/ui/gtk.h +++ b/include/ui/gtk.h @@ -103,11 +103,13 @@ void gd_egl_switch(DisplayChangeListener *dcl, DisplaySurface *surface); 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_texture(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, uint32_t x, uint32_t y, uint32_t w, uint32_t h); void gtk_egl_init(void); @@ -126,11 +128,13 @@ QEMUGLContext gd_gl_area_create_context(DisplayChange= Listener *dcl, QEMUGLParams *params); void gd_gl_area_destroy_context(DisplayChangeListener *dcl, QEMUGLContext ctx); -void gd_gl_area_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_gl_area_scanout_texture(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_gl_area_scanout_flush(DisplayChangeListener *dcl, uint32_t x, uint32_t y, uint32_t w, uint32_t= h); void gtk_gl_area_init(void); diff --git a/include/ui/sdl2.h b/include/ui/sdl2.h index 683bb6a..2de792f 100644 --- a/include/ui/sdl2.h +++ b/include/ui/sdl2.h @@ -62,11 +62,13 @@ int sdl2_gl_make_context_current(DisplayChangeListener = *dcl, QEMUGLContext ctx); QEMUGLContext sdl2_gl_get_current_context(DisplayChangeListener *dcl); =20 -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_texture(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, uint32_t x, uint32_t y, uint32_t w, uint32_t h); =20 diff --git a/ui/console.c b/ui/console.c index 49d0740..22c3c7d 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1735,16 +1735,19 @@ QEMUGLContext dpy_gl_ctx_get_current(QemuConsole *c= on) return con->gl->ops->dpy_gl_ctx_get_current(con->gl); } =20 -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 heigh= t) +void dpy_gl_scanout_texture(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); + con->gl->ops->dpy_gl_scanout_texture(con->gl, backing_id, + backing_y_0_top, + backing_width, backing_height, + x, y, width, height); } =20 void dpy_gl_update(QemuConsole *con, diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c index 3f5d328..d5541c3 100644 --- a/ui/gtk-egl.c +++ b/ui/gtk-egl.c @@ -170,11 +170,11 @@ QEMUGLContext gd_egl_create_context(DisplayChangeList= ener *dcl, return qemu_egl_create_context(dcl, params); } =20 -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_texture(DisplayChangeListener *dcl, + uint32_t backing_id, bool backing_y_0_top, + uint32_t backing_width, uint32_t backing_heigh= t, + uint32_t x, uint32_t y, + uint32_t w, uint32_t h) { VirtualConsole *vc =3D container_of(dcl, VirtualConsole, gfx.dcl); =20 diff --git a/ui/gtk-gl-area.c b/ui/gtk-gl-area.c index 0df5a36..b05c665 100644 --- a/ui/gtk-gl-area.c +++ b/ui/gtk-gl-area.c @@ -167,11 +167,13 @@ void gd_gl_area_destroy_context(DisplayChangeListener= *dcl, QEMUGLContext ctx) /* FIXME */ } =20 -void gd_gl_area_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_gl_area_scanout_texture(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) { VirtualConsole *vc =3D container_of(dcl, VirtualConsole, gfx.dcl); =20 diff --git a/ui/gtk.c b/ui/gtk.c index f21e9e7..1dd0b53 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -669,7 +669,7 @@ static const DisplayChangeListenerOps dcl_gl_area_ops = =3D { .dpy_gl_ctx_destroy =3D gd_gl_area_destroy_context, .dpy_gl_ctx_make_current =3D gd_gl_area_make_current, .dpy_gl_ctx_get_current =3D gd_gl_area_get_current_context, - .dpy_gl_scanout =3D gd_gl_area_scanout, + .dpy_gl_scanout_texture =3D gd_gl_area_scanout_texture, .dpy_gl_update =3D gd_gl_area_scanout_flush, }; =20 @@ -688,7 +688,7 @@ static const DisplayChangeListenerOps dcl_egl_ops =3D { .dpy_gl_ctx_destroy =3D qemu_egl_destroy_context, .dpy_gl_ctx_make_current =3D gd_egl_make_current, .dpy_gl_ctx_get_current =3D qemu_egl_get_current_context, - .dpy_gl_scanout =3D gd_egl_scanout, + .dpy_gl_scanout_texture =3D gd_egl_scanout_texture, .dpy_gl_update =3D gd_egl_scanout_flush, }; =20 diff --git a/ui/sdl2-gl.c b/ui/sdl2-gl.c index 039645d..e25aa3b 100644 --- a/ui/sdl2-gl.c +++ b/ui/sdl2-gl.c @@ -184,11 +184,13 @@ QEMUGLContext sdl2_gl_get_current_context(DisplayChan= geListener *dcl) return (QEMUGLContext)sdlctx; } =20 -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_texture(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) { struct sdl2_console *scon =3D container_of(dcl, struct sdl2_console, d= cl); =20 diff --git a/ui/sdl2.c b/ui/sdl2.c index 91fb111..febda80 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -733,7 +733,7 @@ static const DisplayChangeListenerOps dcl_gl_ops =3D { .dpy_gl_ctx_destroy =3D sdl2_gl_destroy_context, .dpy_gl_ctx_make_current =3D sdl2_gl_make_context_current, .dpy_gl_ctx_get_current =3D sdl2_gl_get_current_context, - .dpy_gl_scanout =3D sdl2_gl_scanout, + .dpy_gl_scanout_texture =3D sdl2_gl_scanout_texture, .dpy_gl_update =3D sdl2_gl_scanout_flush, }; #endif diff --git a/ui/spice-display.c b/ui/spice-display.c index 64e472e..b80a9f3 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -928,13 +928,13 @@ static QEMUGLContext qemu_spice_gl_create_context(Dis= playChangeListener *dcl, return qemu_egl_create_context(dcl, params); } =20 -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) +static void qemu_spice_gl_scanout_texture(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) { SimpleSpiceDisplay *ssd =3D container_of(dcl, SimpleSpiceDisplay, dcl); EGLint stride =3D 0, fourcc =3D 0; @@ -993,7 +993,7 @@ static const DisplayChangeListenerOps display_listener_= gl_ops =3D { .dpy_gl_ctx_make_current =3D qemu_egl_make_context_current, .dpy_gl_ctx_get_current =3D qemu_egl_get_current_context, =20 - .dpy_gl_scanout =3D qemu_spice_gl_scanout, + .dpy_gl_scanout_texture =3D qemu_spice_gl_scanout_texture, .dpy_gl_update =3D qemu_spice_gl_update, }; =20 --=20 1.8.3.1 From nobody Thu Nov 6 18:06:05 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1488212739456670.2528853243701; Mon, 27 Feb 2017 08:25:39 -0800 (PST) Received: from localhost ([::1]:54116 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciO7E-0007go-RZ for importer@patchew.org; Mon, 27 Feb 2017 11:25:36 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41567) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciO0i-0002R4-3j for qemu-devel@nongnu.org; Mon, 27 Feb 2017 11:18:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ciO0f-0002lM-6n for qemu-devel@nongnu.org; Mon, 27 Feb 2017 11:18:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56606) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ciO0f-0002l0-0j for qemu-devel@nongnu.org; Mon, 27 Feb 2017 11:18:49 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 39D1F7FB62 for ; Mon, 27 Feb 2017 16:18:49 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1RGIlUJ028560; Mon, 27 Feb 2017 11:18:48 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 00EF78087C; Mon, 27 Feb 2017 17:18:44 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 27 Feb 2017 17:18:36 +0100 Message-Id: <1488212323-26882-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1488212323-26882-1-git-send-email-kraxel@redhat.com> References: <1488212323-26882-1-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 27 Feb 2017 16:18:49 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 2/9] console: add dpy_gl_scanout_disable X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Helper function (and DisplayChangeListenerOps ptr) to disable scanouts. Replaces using dpy_gl_scanout_texture with 0x0 size and no texture specified. Allows cleanups to make the io and gfx emulation code more readable. Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-Andr=C3=A9 Lureau Message-id: 1487669841-13668-3-git-send-email-kraxel@redhat.com --- include/ui/console.h | 2 ++ ui/console.c | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/ui/console.h b/include/ui/console.h index e6ae637..ac2895c 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -215,6 +215,7 @@ typedef struct DisplayChangeListenerOps { QEMUGLContext ctx); QEMUGLContext (*dpy_gl_ctx_get_current)(DisplayChangeListener *dcl); =20 + void (*dpy_gl_scanout_disable)(DisplayChangeListener *dcl); void (*dpy_gl_scanout_texture)(DisplayChangeListener *dcl, uint32_t backing_id, bool backing_y_0_top, @@ -287,6 +288,7 @@ bool dpy_cursor_define_supported(QemuConsole *con); bool dpy_gfx_check_format(QemuConsole *con, pixman_format_code_t format); =20 +void dpy_gl_scanout_disable(QemuConsole *con); void dpy_gl_scanout_texture(QemuConsole *con, uint32_t backing_id, bool backing_y_0_top, uint32_t backing_width, uint32_t backing_heigh= t, diff --git a/ui/console.c b/ui/console.c index 22c3c7d..d1ff750 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1735,6 +1735,17 @@ QEMUGLContext dpy_gl_ctx_get_current(QemuConsole *co= n) return con->gl->ops->dpy_gl_ctx_get_current(con->gl); } =20 +void dpy_gl_scanout_disable(QemuConsole *con) +{ + assert(con->gl); + if (con->gl->ops->dpy_gl_scanout_disable) { + con->gl->ops->dpy_gl_scanout_disable(con->gl); + } else { + con->gl->ops->dpy_gl_scanout_texture(con->gl, 0, false, 0, 0, + 0, 0, 0, 0); + } +} + void dpy_gl_scanout_texture(QemuConsole *con, uint32_t backing_id, bool backing_y_0_top, --=20 1.8.3.1 From nobody Thu Nov 6 18:06:05 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1488212914243318.16110521584903; Mon, 27 Feb 2017 08:28:34 -0800 (PST) Received: from localhost ([::1]:54133 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciOA3-00023W-1O for importer@patchew.org; Mon, 27 Feb 2017 11:28:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41562) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciO0i-0002R1-2k for qemu-devel@nongnu.org; Mon, 27 Feb 2017 11:18:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ciO0f-0002lX-CV for qemu-devel@nongnu.org; Mon, 27 Feb 2017 11:18:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51320) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ciO0f-0002l3-6g for qemu-devel@nongnu.org; Mon, 27 Feb 2017 11:18:49 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6E53F3B71F for ; Mon, 27 Feb 2017 16:18:49 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1RGIlqN017353; Mon, 27 Feb 2017 11:18:48 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 1845E805AD; Mon, 27 Feb 2017 17:18:45 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 27 Feb 2017 17:18:37 +0100 Message-Id: <1488212323-26882-4-git-send-email-kraxel@redhat.com> In-Reply-To: <1488212323-26882-1-git-send-email-kraxel@redhat.com> References: <1488212323-26882-1-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 27 Feb 2017 16:18:49 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 3/9] virtio-gpu: use dpy_gl_scanout_disable X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-Andr=C3=A9 Lureau Message-id: 1487669841-13668-4-git-send-email-kraxel@redhat.com --- hw/display/virtio-gpu-3d.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/display/virtio-gpu-3d.c b/hw/display/virtio-gpu-3d.c index b526b3f..f49b7fe 100644 --- a/hw/display/virtio-gpu-3d.c +++ b/hw/display/virtio-gpu-3d.c @@ -185,8 +185,7 @@ static void virgl_cmd_set_scanout(VirtIOGPU *g, if (ss.scanout_id !=3D 0) { dpy_gfx_replace_surface(g->scanout[ss.scanout_id].con, NULL); } - dpy_gl_scanout_texture(g->scanout[ss.scanout_id].con, 0, false, - 0, 0, 0, 0, 0, 0); + dpy_gl_scanout_disable(g->scanout[ss.scanout_id].con); } g->scanout[ss.scanout_id].resource_id =3D ss.resource_id; } @@ -597,7 +596,7 @@ void virtio_gpu_virgl_reset(VirtIOGPU *g) if (i !=3D 0) { dpy_gfx_replace_surface(g->scanout[i].con, NULL); } - dpy_gl_scanout_texture(g->scanout[i].con, 0, false, 0, 0, 0, 0, 0,= 0); + dpy_gl_scanout_disable(g->scanout[i].con); } } =20 --=20 1.8.3.1 From nobody Thu Nov 6 18:06:05 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1488213179118224.79601861316928; Mon, 27 Feb 2017 08:32:59 -0800 (PST) Received: from localhost ([::1]:54154 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciOEK-0005mc-OR for importer@patchew.org; Mon, 27 Feb 2017 11:32:56 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41561) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciO0i-0002Qz-2O for qemu-devel@nongnu.org; Mon, 27 Feb 2017 11:18:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ciO0e-0002lB-Sl for qemu-devel@nongnu.org; Mon, 27 Feb 2017 11:18:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56604) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ciO0e-0002ku-Js for qemu-devel@nongnu.org; Mon, 27 Feb 2017 11:18:48 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CCCCA7FB60 for ; Mon, 27 Feb 2017 16:18:48 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1RGIllT007729; Mon, 27 Feb 2017 11:18:48 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 29539808F9; Mon, 27 Feb 2017 17:18:45 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 27 Feb 2017 17:18:38 +0100 Message-Id: <1488212323-26882-5-git-send-email-kraxel@redhat.com> In-Reply-To: <1488212323-26882-1-git-send-email-kraxel@redhat.com> References: <1488212323-26882-1-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 27 Feb 2017 16:18:48 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 4/9] spice: add scanout_disable support X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-Andr=C3=A9 Lureau Message-id: 1487669841-13668-5-git-send-email-kraxel@redhat.com --- ui/spice-display.c | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/ui/spice-display.c b/ui/spice-display.c index b80a9f3..23ccf2a 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -928,6 +928,17 @@ static QEMUGLContext qemu_spice_gl_create_context(Disp= layChangeListener *dcl, return qemu_egl_create_context(dcl, params); } =20 +static void qemu_spice_gl_scanout_disable(DisplayChangeListener *dcl) +{ + SimpleSpiceDisplay *ssd =3D container_of(dcl, SimpleSpiceDisplay, dcl); + + dprint(1, "%s: no framebuffer\n", __func__); + spice_qxl_gl_scanout(&ssd->qxl, -1, 0, 0, 0, 0, false); + qemu_spice_gl_monitor_config(ssd, 0, 0, 0, 0); + ssd->have_surface =3D false; + ssd->have_scanout =3D false; +} + static void qemu_spice_gl_scanout_texture(DisplayChangeListener *dcl, uint32_t tex_id, bool y_0_top, @@ -940,27 +951,21 @@ static void qemu_spice_gl_scanout_texture(DisplayChan= geListener *dcl, EGLint stride =3D 0, fourcc =3D 0; int fd =3D -1; =20 - if (tex_id) { - fd =3D egl_get_fd_for_texture(tex_id, &stride, &fourcc); - if (fd < 0) { - fprintf(stderr, "%s: failed to get fd for texture\n", __func__= ); - return; - } - dprint(1, "%s: %dx%d (stride %d, fourcc 0x%x)\n", __func__, - w, h, stride, fourcc); - } else { - dprint(1, "%s: no texture (no framebuffer)\n", __func__); + assert(tex_id); + fd =3D egl_get_fd_for_texture(tex_id, &stride, &fourcc); + if (fd < 0) { + fprintf(stderr, "%s: failed to get fd for texture\n", __func__); + return; } - - assert(!tex_id || fd >=3D 0); + dprint(1, "%s: %dx%d (stride %d, fourcc 0x%x)\n", __func__, + w, h, stride, fourcc); =20 /* note: spice server will close the fd */ spice_qxl_gl_scanout(&ssd->qxl, fd, backing_width, backing_height, stride, fourcc, y_0_top); - ssd->have_surface =3D false; - ssd->have_scanout =3D (tex_id !=3D 0); - qemu_spice_gl_monitor_config(ssd, x, y, w, h); + ssd->have_surface =3D false; + ssd->have_scanout =3D true; } =20 static void qemu_spice_gl_update(DisplayChangeListener *dcl, @@ -993,6 +998,7 @@ static const DisplayChangeListenerOps display_listener_= gl_ops =3D { .dpy_gl_ctx_make_current =3D qemu_egl_make_context_current, .dpy_gl_ctx_get_current =3D qemu_egl_get_current_context, =20 + .dpy_gl_scanout_disable =3D qemu_spice_gl_scanout_disable, .dpy_gl_scanout_texture =3D qemu_spice_gl_scanout_texture, .dpy_gl_update =3D qemu_spice_gl_update, }; --=20 1.8.3.1 From nobody Thu Nov 6 18:06:05 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1488212512879253.4811436902487; Mon, 27 Feb 2017 08:21:52 -0800 (PST) Received: from localhost ([::1]:54091 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciO3Z-0004W2-Jy for importer@patchew.org; Mon, 27 Feb 2017 11:21:49 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41574) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciO0i-0002RF-9R for qemu-devel@nongnu.org; Mon, 27 Feb 2017 11:18:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ciO0h-0002mt-AK for qemu-devel@nongnu.org; Mon, 27 Feb 2017 11:18:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58838) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ciO0h-0002mM-4m for qemu-devel@nongnu.org; Mon, 27 Feb 2017 11:18:51 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5BD704E4D6 for ; Mon, 27 Feb 2017 16:18:51 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1RGIoDe028603; Mon, 27 Feb 2017 11:18:50 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 3E1D380915; Mon, 27 Feb 2017 17:18:45 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 27 Feb 2017 17:18:39 +0100 Message-Id: <1488212323-26882-6-git-send-email-kraxel@redhat.com> In-Reply-To: <1488212323-26882-1-git-send-email-kraxel@redhat.com> References: <1488212323-26882-1-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 27 Feb 2017 16:18:51 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 5/9] sdl2: add scanout_disable support X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-Andr=C3=A9 Lureau Message-id: 1487669841-13668-6-git-send-email-kraxel@redhat.com --- include/ui/sdl2.h | 1 + ui/sdl2-gl.c | 16 +++++++++++----- ui/sdl2.c | 1 + 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/include/ui/sdl2.h b/include/ui/sdl2.h index 2de792f..aaf226c 100644 --- a/include/ui/sdl2.h +++ b/include/ui/sdl2.h @@ -62,6 +62,7 @@ int sdl2_gl_make_context_current(DisplayChangeListener *d= cl, QEMUGLContext ctx); QEMUGLContext sdl2_gl_get_current_context(DisplayChangeListener *dcl); =20 +void sdl2_gl_scanout_disable(DisplayChangeListener *dcl); void sdl2_gl_scanout_texture(DisplayChangeListener *dcl, uint32_t backing_id, bool backing_y_0_top, diff --git a/ui/sdl2-gl.c b/ui/sdl2-gl.c index e25aa3b..1cd77e2 100644 --- a/ui/sdl2-gl.c +++ b/ui/sdl2-gl.c @@ -184,6 +184,17 @@ QEMUGLContext sdl2_gl_get_current_context(DisplayChang= eListener *dcl) return (QEMUGLContext)sdlctx; } =20 +void sdl2_gl_scanout_disable(DisplayChangeListener *dcl) +{ + struct sdl2_console *scon =3D container_of(dcl, struct sdl2_console, d= cl); + + assert(scon->opengl); + scon->w =3D 0; + scon->h =3D 0; + scon->tex_id =3D 0; + sdl2_set_scanout_mode(scon, false); +} + void sdl2_gl_scanout_texture(DisplayChangeListener *dcl, uint32_t backing_id, bool backing_y_0_top, @@ -204,11 +215,6 @@ void sdl2_gl_scanout_texture(DisplayChangeListener *dc= l, =20 SDL_GL_MakeCurrent(scon->real_window, scon->winctx); =20 - if (scon->tex_id =3D=3D 0 || scon->w =3D=3D 0 || scon->h =3D=3D 0) { - sdl2_set_scanout_mode(scon, false); - return; - } - sdl2_set_scanout_mode(scon, true); if (!scon->fbo_id) { glGenFramebuffers(1, &scon->fbo_id); diff --git a/ui/sdl2.c b/ui/sdl2.c index febda80..faf9bdf 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -733,6 +733,7 @@ static const DisplayChangeListenerOps dcl_gl_ops =3D { .dpy_gl_ctx_destroy =3D sdl2_gl_destroy_context, .dpy_gl_ctx_make_current =3D sdl2_gl_make_context_current, .dpy_gl_ctx_get_current =3D sdl2_gl_get_current_context, + .dpy_gl_scanout_disable =3D sdl2_gl_scanout_disable, .dpy_gl_scanout_texture =3D sdl2_gl_scanout_texture, .dpy_gl_update =3D sdl2_gl_scanout_flush, }; --=20 1.8.3.1 From nobody Thu Nov 6 18:06:05 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1488212953614170.78202257636576; Mon, 27 Feb 2017 08:29:13 -0800 (PST) Received: from localhost ([::1]:54135 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciOAh-0002fn-Ci for importer@patchew.org; Mon, 27 Feb 2017 11:29:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41575) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciO0i-0002RG-9d for qemu-devel@nongnu.org; Mon, 27 Feb 2017 11:18:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ciO0h-0002mh-5J for qemu-devel@nongnu.org; Mon, 27 Feb 2017 11:18:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51338) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ciO0g-0002mA-WC for qemu-devel@nongnu.org; Mon, 27 Feb 2017 11:18:51 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 369503B716 for ; Mon, 27 Feb 2017 16:18:51 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1RGIovi003649; Mon, 27 Feb 2017 11:18:50 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 53F97808F8; Mon, 27 Feb 2017 17:18:45 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 27 Feb 2017 17:18:40 +0100 Message-Id: <1488212323-26882-7-git-send-email-kraxel@redhat.com> In-Reply-To: <1488212323-26882-1-git-send-email-kraxel@redhat.com> References: <1488212323-26882-1-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 27 Feb 2017 16:18:51 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 6/9] gtk-egl: add scanout_disable support X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-Andr=C3=A9 Lureau Message-id: 1487669841-13668-7-git-send-email-kraxel@redhat.com --- include/ui/gtk.h | 1 + ui/gtk-egl.c | 15 ++++++++++----- ui/gtk.c | 1 + 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/include/ui/gtk.h b/include/ui/gtk.h index 408e21b..ca9a226 100644 --- a/include/ui/gtk.h +++ b/include/ui/gtk.h @@ -103,6 +103,7 @@ void gd_egl_switch(DisplayChangeListener *dcl, DisplaySurface *surface); QEMUGLContext gd_egl_create_context(DisplayChangeListener *dcl, QEMUGLParams *params); +void gd_egl_scanout_disable(DisplayChangeListener *dcl); void gd_egl_scanout_texture(DisplayChangeListener *dcl, uint32_t backing_id, bool backing_y_0_top, diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c index d5541c3..d53288f 100644 --- a/ui/gtk-egl.c +++ b/ui/gtk-egl.c @@ -170,6 +170,16 @@ QEMUGLContext gd_egl_create_context(DisplayChangeListe= ner *dcl, return qemu_egl_create_context(dcl, params); } =20 +void gd_egl_scanout_disable(DisplayChangeListener *dcl) +{ + VirtualConsole *vc =3D container_of(dcl, VirtualConsole, gfx.dcl); + + vc->gfx.w =3D 0; + vc->gfx.h =3D 0; + vc->gfx.tex_id =3D 0; + gtk_egl_set_scanout_mode(vc, false); +} + void gd_egl_scanout_texture(DisplayChangeListener *dcl, uint32_t backing_id, bool backing_y_0_top, uint32_t backing_width, uint32_t backing_heigh= t, @@ -188,11 +198,6 @@ void gd_egl_scanout_texture(DisplayChangeListener *dcl, eglMakeCurrent(qemu_egl_display, vc->gfx.esurface, vc->gfx.esurface, vc->gfx.ectx); =20 - if (vc->gfx.tex_id =3D=3D 0 || vc->gfx.w =3D=3D 0 || vc->gfx.h =3D=3D = 0) { - gtk_egl_set_scanout_mode(vc, false); - return; - } - gtk_egl_set_scanout_mode(vc, true); if (!vc->gfx.fbo_id) { glGenFramebuffers(1, &vc->gfx.fbo_id); diff --git a/ui/gtk.c b/ui/gtk.c index 1dd0b53..640ff84 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -688,6 +688,7 @@ static const DisplayChangeListenerOps dcl_egl_ops =3D { .dpy_gl_ctx_destroy =3D qemu_egl_destroy_context, .dpy_gl_ctx_make_current =3D gd_egl_make_current, .dpy_gl_ctx_get_current =3D qemu_egl_get_current_context, + .dpy_gl_scanout_disable =3D gd_egl_scanout_disable, .dpy_gl_scanout_texture =3D gd_egl_scanout_texture, .dpy_gl_update =3D gd_egl_scanout_flush, }; --=20 1.8.3.1 From nobody Thu Nov 6 18:06:05 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1488213459595789.61804195784; Mon, 27 Feb 2017 08:37:39 -0800 (PST) Received: from localhost ([::1]:54178 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciOIr-0001K4-F2 for importer@patchew.org; Mon, 27 Feb 2017 11:37:38 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41589) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciO0i-0002RW-Ou for qemu-devel@nongnu.org; Mon, 27 Feb 2017 11:18:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ciO0h-0002n6-KE for qemu-devel@nongnu.org; Mon, 27 Feb 2017 11:18:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56614) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ciO0h-0002mR-BY for qemu-devel@nongnu.org; Mon, 27 Feb 2017 11:18:51 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 82DE37FB62 for ; Mon, 27 Feb 2017 16:18:51 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1RGIohv007753; Mon, 27 Feb 2017 11:18:50 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 65A3280481; Mon, 27 Feb 2017 17:18:45 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 27 Feb 2017 17:18:41 +0100 Message-Id: <1488212323-26882-8-git-send-email-kraxel@redhat.com> In-Reply-To: <1488212323-26882-1-git-send-email-kraxel@redhat.com> References: <1488212323-26882-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 27 Feb 2017 16:18:51 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 7/9] ui: Use XkbGetMap and XkbGetNames instead of XkbGetKeyboard X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Daniel P. Berrange" XkbGetKeyboard does not work in XWayland and even on non-Wayland X11 servers its use is discouraged: https://bugs.freedesktop.org/show_bug.cgi?id=3D89240 This resolves a problem whereby QEMU prints "could not lookup keycode name" on startup when running under XWayland. Keymap handling is however still broken after this commit, since Xwayland is reporting a keymap we can't handle "unknown keycodes `(unnamed)', please report to qemu-devel@nongnu.org" NB, native Wayland support (which is the default under GTK3) is not affected - only XWayland (which can be requested with GDK_BACKEND on GTK3, and is the only option for GTK2). Signed-off-by: Daniel P. Berrange Message-id: 20170227132343.30824-1-berrange@redhat.com Signed-off-by: Gerd Hoffmann --- ui/gtk.c | 7 ++++--- ui/sdl.c | 10 ++++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ui/gtk.c b/ui/gtk.c index 640ff84..a86848f 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -2201,11 +2201,12 @@ static void gd_set_keycode_type(GtkDisplayState *s) GdkDisplay *display =3D gtk_widget_get_display(s->window); if (GDK_IS_X11_DISPLAY(display)) { Display *x11_display =3D gdk_x11_display_get_xdisplay(display); - XkbDescPtr desc =3D XkbGetKeyboard(x11_display, XkbGBN_AllComponen= tsMask, - XkbUseCoreKbd); + XkbDescPtr desc =3D XkbGetMap(x11_display, XkbGBN_AllComponentsMas= k, + XkbUseCoreKbd); char *keycodes =3D NULL; =20 - if (desc && desc->names) { + if (desc && + (XkbGetNames(x11_display, XkbKeycodesNameMask, desc) =3D=3D Su= ccess)) { keycodes =3D XGetAtomName(x11_display, desc->names->keycodes); } if (keycodes =3D=3D NULL) { diff --git a/ui/sdl.c b/ui/sdl.c index 19e8a84..37c21a0 100644 --- a/ui/sdl.c +++ b/ui/sdl.c @@ -233,10 +233,12 @@ static int check_for_evdev(void) if (!SDL_GetWMInfo(&info)) { return 0; } - desc =3D XkbGetKeyboard(info.info.x11.display, - XkbGBN_AllComponentsMask, - XkbUseCoreKbd); - if (desc && desc->names) { + desc =3D XkbGetMap(info.info.x11.display, + XkbGBN_AllComponentsMask, + XkbUseCoreKbd); + if (desc && + (XkbGetNames(info.info.x11.display, + XkbKeycodesNameMask, desc) =3D=3D Success)) { keycodes =3D XGetAtomName(info.info.x11.display, desc->names->keyc= odes); if (keycodes =3D=3D NULL) { fprintf(stderr, "could not lookup keycode name\n"); --=20 1.8.3.1 From nobody Thu Nov 6 18:06:05 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1488213267238973.6083496927499; Mon, 27 Feb 2017 08:34:27 -0800 (PST) Received: from localhost ([::1]:54159 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciOFk-0006tW-PL for importer@patchew.org; Mon, 27 Feb 2017 11:34:24 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41581) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciO0i-0002RL-JK for qemu-devel@nongnu.org; Mon, 27 Feb 2017 11:18:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ciO0h-0002n5-K9 for qemu-devel@nongnu.org; Mon, 27 Feb 2017 11:18:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51340) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ciO0h-0002mV-EY for qemu-devel@nongnu.org; Mon, 27 Feb 2017 11:18:51 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A32F23B731 for ; Mon, 27 Feb 2017 16:18:51 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1RGIomQ007755; Mon, 27 Feb 2017 11:18:50 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 7C8E380925; Mon, 27 Feb 2017 17:18:45 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 27 Feb 2017 17:18:42 +0100 Message-Id: <1488212323-26882-9-git-send-email-kraxel@redhat.com> In-Reply-To: <1488212323-26882-1-git-send-email-kraxel@redhat.com> References: <1488212323-26882-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 27 Feb 2017 16:18:51 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 8/9] spice: add display & head options X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This allows to specify display and head to use, simliar to vnc. Signed-off-by: Gerd Hoffmann Message-id: 1487663858-11731-1-git-send-email-kraxel@redhat.com --- ui/spice-core.c | 6 ++++++ ui/spice-display.c | 22 +++++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/ui/spice-core.c b/ui/spice-core.c index 39ccab7..804abc5 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -497,6 +497,12 @@ static QemuOptsList qemu_spice_opts =3D { },{ .name =3D "seamless-migration", .type =3D QEMU_OPT_BOOL, + },{ + .name =3D "display", + .type =3D QEMU_OPT_STRING, + },{ + .name =3D "head", + .type =3D QEMU_OPT_NUMBER, #ifdef HAVE_SPICE_GL },{ .name =3D "gl", diff --git a/ui/spice-display.c b/ui/spice-display.c index 23ccf2a..b353445 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -1035,9 +1035,26 @@ static void qemu_spice_display_init_one(QemuConsole = *con) =20 void qemu_spice_display_init(void) { - QemuConsole *con; + QemuOptsList *olist =3D qemu_find_opts("spice"); + QemuOpts *opts =3D QTAILQ_FIRST(&olist->head); + QemuConsole *spice_con, *con; + const char *str; int i; =20 + str =3D qemu_opt_get(opts, "display"); + if (str) { + int head =3D qemu_opt_get_number(opts, "head", 0); + Error *err =3D NULL; + + spice_con =3D qemu_console_lookup_by_device_name(str, head, &err); + if (err) { + error_report("Failed to lookup display/head"); + exit(1); + } + } else { + spice_con =3D NULL; + } + for (i =3D 0;; i++) { con =3D qemu_console_lookup_by_index(i); if (!con || !qemu_console_is_graphic(con)) { @@ -1046,6 +1063,9 @@ void qemu_spice_display_init(void) if (qemu_spice_have_display_interface(con)) { continue; } + if (spice_con !=3D NULL && spice_con !=3D con) { + continue; + } qemu_spice_display_init_one(con); } } --=20 1.8.3.1 From nobody Thu Nov 6 18:06:05 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1488213731584139.52709167741568; Mon, 27 Feb 2017 08:42:11 -0800 (PST) Received: from localhost ([::1]:54207 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciONG-0005Iz-B1 for importer@patchew.org; Mon, 27 Feb 2017 11:42:10 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41629) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciO0j-0002Sf-N0 for qemu-devel@nongnu.org; Mon, 27 Feb 2017 11:18:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ciO0i-0002nO-3Q for qemu-devel@nongnu.org; Mon, 27 Feb 2017 11:18:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43152) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ciO0h-0002mo-SX for qemu-devel@nongnu.org; Mon, 27 Feb 2017 11:18:51 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 13D2280F8F; Mon, 27 Feb 2017 16:18:52 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1RGIosp027069; Mon, 27 Feb 2017 11:18:50 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 8AF048092A; Mon, 27 Feb 2017 17:18:45 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 27 Feb 2017 17:18:43 +0100 Message-Id: <1488212323-26882-10-git-send-email-kraxel@redhat.com> In-Reply-To: <1488212323-26882-1-git-send-email-kraxel@redhat.com> References: <1488212323-26882-1-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 27 Feb 2017 16:18:52 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 9/9] vnc: fix double free issues X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Gerd Hoffmann , Peter Maydell Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Reported by Coverity: CID 1371242, 1371243, 1371244. Cc: Paolo Bonzini Cc: Peter Maydell Cc: Daniel P. Berrange Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-Andr=C3=A9 Lureau Message-id: 1487682332-29154-1-git-send-email-kraxel@redhat.com --- ui/vnc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/vnc.c b/ui/vnc.c index 62e85ed..51f4b30 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -3181,6 +3181,7 @@ static void vnc_display_close(VncDisplay *vd) g_free(vd->lsock); g_free(vd->lsock_tag); vd->lsock =3D NULL; + vd->lsock_tag =3D NULL; vd->nlsock =3D 0; =20 for (i =3D 0; i < vd->nlwebsock; i++) { @@ -3192,6 +3193,7 @@ static void vnc_display_close(VncDisplay *vd) g_free(vd->lwebsock); g_free(vd->lwebsock_tag); vd->lwebsock =3D NULL; + vd->lwebsock_tag =3D NULL; vd->nlwebsock =3D 0; =20 vd->auth =3D VNC_AUTH_INVALID; @@ -3204,6 +3206,7 @@ static void vnc_display_close(VncDisplay *vd) vd->tlsaclname =3D NULL; if (vd->lock_key_sync) { qemu_remove_led_event_handler(vd->led); + vd->led =3D NULL; } } =20 --=20 1.8.3.1