From nobody Fri Mar 29 09:37:13 2024 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 1487670364900216.77006338877084; Tue, 21 Feb 2017 01:46:04 -0800 (PST) Received: from localhost ([::1]:43284 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cg71H-0007ss-KZ for importer@patchew.org; Tue, 21 Feb 2017 04:46:03 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33481) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cg6sz-0000ra-23 for qemu-devel@nongnu.org; Tue, 21 Feb 2017 04:37:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cg6sw-0006AH-L1 for qemu-devel@nongnu.org; Tue, 21 Feb 2017 04:37:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47124) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cg6sw-00069c-Cw for qemu-devel@nongnu.org; Tue, 21 Feb 2017 04:37:26 -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 8DB421555C for ; Tue, 21 Feb 2017 09:37:26 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-47.ams2.redhat.com [10.36.116.47]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1L9bOlx008189; Tue, 21 Feb 2017 04:37:25 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id F3B9C81832; Tue, 21 Feb 2017 10:37:22 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 21 Feb 2017 10:37:16 +0100 Message-Id: <1487669841-13668-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1487669841-13668-1-git-send-email-kraxel@redhat.com> References: <1487669841-13668-1-git-send-email-kraxel@redhat.com> 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.29]); Tue, 21 Feb 2017 09:37:26 +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] [PATCH 1/6] 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-Transfer-Encoding: quoted-printable MIME-Version: 1.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 --- 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 Fri Mar 29 09:37:13 2024 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 1487669945024265.8479562622068; Tue, 21 Feb 2017 01:39:05 -0800 (PST) Received: from localhost ([::1]:43242 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cg6uV-0001i0-E4 for importer@patchew.org; Tue, 21 Feb 2017 04:39:03 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33480) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cg6sz-0000rZ-1D for qemu-devel@nongnu.org; Tue, 21 Feb 2017 04:37:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cg6sv-00069n-UI for qemu-devel@nongnu.org; Tue, 21 Feb 2017 04:37:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59534) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cg6sv-00069E-Ow for qemu-devel@nongnu.org; Tue, 21 Feb 2017 04:37:25 -0500 Received: from smtp.corp.redhat.com (int-mx16.intmail.prod.int.phx2.redhat.com [10.5.11.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CB57B81253 for ; Tue, 21 Feb 2017 09:37:25 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-47.ams2.redhat.com [10.36.116.47]) by smtp.corp.redhat.com (Postfix) with ESMTP id 527211CDD7D; Tue, 21 Feb 2017 09:37:25 +0000 (UTC) Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 136388183D; Tue, 21 Feb 2017 10:37:23 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 21 Feb 2017 10:37:17 +0100 Message-Id: <1487669841-13668-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1487669841-13668-1-git-send-email-kraxel@redhat.com> References: <1487669841-13668-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.74 on 10.5.11.28 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 21 Feb 2017 09:37:25 +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] [PATCH 2/6] 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-Transfer-Encoding: quoted-printable MIME-Version: 1.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 --- 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 Fri Mar 29 09:37:13 2024 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 1487670157444283.7261975713367; Tue, 21 Feb 2017 01:42:37 -0800 (PST) Received: from localhost ([::1]:43261 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cg6xw-0004hw-3Y for importer@patchew.org; Tue, 21 Feb 2017 04:42:36 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33479) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cg6sz-0000rY-0U for qemu-devel@nongnu.org; Tue, 21 Feb 2017 04:37:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cg6sv-00069j-Tr for qemu-devel@nongnu.org; Tue, 21 Feb 2017 04:37:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:16223) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cg6sv-00069J-OE for qemu-devel@nongnu.org; Tue, 21 Feb 2017 04:37:25 -0500 Received: from smtp.corp.redhat.com (int-mx16.intmail.prod.int.phx2.redhat.com [10.5.11.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E14E28047A for ; Tue, 21 Feb 2017 09:37:25 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-47.ams2.redhat.com [10.36.116.47]) by smtp.corp.redhat.com (Postfix) with ESMTP id 566816376C; Tue, 21 Feb 2017 09:37:25 +0000 (UTC) Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 24C388183F; Tue, 21 Feb 2017 10:37:23 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 21 Feb 2017 10:37:18 +0100 Message-Id: <1487669841-13668-4-git-send-email-kraxel@redhat.com> In-Reply-To: <1487669841-13668-1-git-send-email-kraxel@redhat.com> References: <1487669841-13668-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.74 on 10.5.11.28 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 21 Feb 2017 09:37:25 +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] [PATCH 3/6] 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-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-Andr=C3=A9 Lureau --- 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 Fri Mar 29 09:37:13 2024 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 1487669946272586.4926200010076; Tue, 21 Feb 2017 01:39:06 -0800 (PST) Received: from localhost ([::1]:43243 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cg6uX-0001im-14 for importer@patchew.org; Tue, 21 Feb 2017 04:39:05 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33483) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cg6sz-0000rc-1Z for qemu-devel@nongnu.org; Tue, 21 Feb 2017 04:37:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cg6sw-0006A1-0C for qemu-devel@nongnu.org; Tue, 21 Feb 2017 04:37:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45292) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cg6sv-00069H-Oj for qemu-devel@nongnu.org; Tue, 21 Feb 2017 04:37:25 -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 DC109326BB for ; Tue, 21 Feb 2017 09:37:25 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-47.ams2.redhat.com [10.36.116.47]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1L9bObh022796; Tue, 21 Feb 2017 04:37:25 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 3850C81843; Tue, 21 Feb 2017 10:37:23 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 21 Feb 2017 10:37:19 +0100 Message-Id: <1487669841-13668-5-git-send-email-kraxel@redhat.com> In-Reply-To: <1487669841-13668-1-git-send-email-kraxel@redhat.com> References: <1487669841-13668-1-git-send-email-kraxel@redhat.com> 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.26]); Tue, 21 Feb 2017 09:37:25 +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] [PATCH 4/6] 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-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-Andr=C3=A9 Lureau --- 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 Fri Mar 29 09:37:13 2024 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 1487670161001524.9406256914723; Tue, 21 Feb 2017 01:42:41 -0800 (PST) Received: from localhost ([::1]:43264 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cg6xz-0004lP-K7 for importer@patchew.org; Tue, 21 Feb 2017 04:42:39 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33482) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cg6sz-0000rb-1S for qemu-devel@nongnu.org; Tue, 21 Feb 2017 04:37:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cg6sx-0006AY-Bo for qemu-devel@nongnu.org; Tue, 21 Feb 2017 04:37:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57762) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cg6sx-0006AB-6h for qemu-devel@nongnu.org; Tue, 21 Feb 2017 04:37:27 -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 5BADC80485 for ; Tue, 21 Feb 2017 09:37:27 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-47.ams2.redhat.com [10.36.116.47]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1L9bQnA022804; Tue, 21 Feb 2017 04:37:26 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 4F2258093B; Tue, 21 Feb 2017 10:37:23 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 21 Feb 2017 10:37:20 +0100 Message-Id: <1487669841-13668-6-git-send-email-kraxel@redhat.com> In-Reply-To: <1487669841-13668-1-git-send-email-kraxel@redhat.com> References: <1487669841-13668-1-git-send-email-kraxel@redhat.com> 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.28]); Tue, 21 Feb 2017 09:37:27 +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] [PATCH 5/6] 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-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-Andr=C3=A9 Lureau --- 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 Fri Mar 29 09:37:13 2024 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 1487670157644545.7048792372835; Tue, 21 Feb 2017 01:42:37 -0800 (PST) Received: from localhost ([::1]:43262 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cg6xw-0004im-CW for importer@patchew.org; Tue, 21 Feb 2017 04:42:36 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33485) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cg6sz-0000rd-1n for qemu-devel@nongnu.org; Tue, 21 Feb 2017 04:37:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cg6sx-0006AX-CB for qemu-devel@nongnu.org; Tue, 21 Feb 2017 04:37:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45304) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cg6sx-0006AF-6u for qemu-devel@nongnu.org; Tue, 21 Feb 2017 04:37:27 -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 64F6D81F07 for ; Tue, 21 Feb 2017 09:37:27 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-47.ams2.redhat.com [10.36.116.47]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1L9bQe6007753; Tue, 21 Feb 2017 04:37:26 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 6770881849; Tue, 21 Feb 2017 10:37:23 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 21 Feb 2017 10:37:21 +0100 Message-Id: <1487669841-13668-7-git-send-email-kraxel@redhat.com> In-Reply-To: <1487669841-13668-1-git-send-email-kraxel@redhat.com> References: <1487669841-13668-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.26]); Tue, 21 Feb 2017 09:37:27 +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] [PATCH 6/6] 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-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-Andr=C3=A9 Lureau --- 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