Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6BBAAEB64DC for ; Fri, 21 Jul 2023 06:54:07 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qMk1D-0004Xo-M9; Fri, 21 Jul 2023 02:53:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qMk1C-0004Xg-BR for qemu-devel@nongnu.org; Fri, 21 Jul 2023 02:53:38 -0400 Received: from mailout10.t-online.de ([194.25.134.21]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qMk1A-0002T6-Ar for qemu-devel@nongnu.org; Fri, 21 Jul 2023 02:53:38 -0400 Received: from fwd85.dcpf.telekom.de (fwd85.aul.t-online.de [10.223.144.111]) by mailout10.t-online.de (Postfix) with SMTP id 12A49430C0; Fri, 21 Jul 2023 08:53:31 +0200 (CEST) Received: from [192.168.211.200] ([79.208.26.246]) by fwd85.t-online.de with (TLSv1.3:TLS_AES_256_GCM_SHA384 encrypted) esmtp id 1qMk14-0i2ZeL0; Fri, 21 Jul 2023 08:53:30 +0200 Message-ID: Date: Fri, 21 Jul 2023 08:53:29 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 From: =?UTF-8?Q?Volker_R=c3=bcmelin?= Subject: Re: [PULL 06/19] ui/gtk: set scanout-mode right before scheduling draw To: Dongwon Kim Cc: qemu-devel@nongnu.org, =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , Vivek Kasireddy , Richard Henderson , Gerd Hoffmann References: <20230717124545.177236-1-marcandre.lureau@redhat.com> <20230717124545.177236-7-marcandre.lureau@redhat.com> Content-Language: en-US In-Reply-To: <20230717124545.177236-7-marcandre.lureau@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-TOI-EXPURGATEID: 150726::1689922410-BEFF6EAB-96F702E7/0/0 CLEAN NORMAL X-TOI-MSGID: 43f35918-433d-4acd-bddb-8896b886a98b Received-SPF: none client-ip=194.25.134.21; envelope-from=vr_qemu@t-online.de; helo=mailout10.t-online.de X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FROM=0.001, NICE_REPLY_A=-0.096, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Am 17.07.23 um 14:45 schrieb marcandre.lureau@redhat.com: > From: Dongwon Kim > > Setting scanout mode is better to be done very last minute > right because the mode can be reset anytime after it is set in > dpy_gl_scanout_texture by any asynchronouse dpy_refresh call, > which eventually cancels drawing of the guest scanout texture. Hi Dongwon, this patch breaks the QEMU guest display on my system. QEMU was started with ./qemu-system-x86_64 -machine q35 -device virtio-vga-gl,xres=1280,yres=768 -display gtk,zoom-to-fit=off,gl=on. I can see the OVMF boot screen and then GRUB. After Linux was started, plymouth normally shows the OVMF boot logo and a rotating spinner. With your patch the guest screen stays black and I see a text cursor in the upper left corner. It seems the guest works without issues. I can use ssh to log in and I can't find any obvious errors in the guest log files. I tested on a host GNOME desktop under X11 and again under Wayland. In both cases the result is a black guest screen. With best regards, Volker > Cc: Gerd Hoffmann > Cc: Marc-André Lureau > Cc: Vivek Kasireddy > Signed-off-by: Dongwon Kim > Acked-by: Marc-André Lureau > Message-ID:<20230706183355.29361-1-dongwon.kim@intel.com> > --- > ui/gtk-egl.c | 2 +- > ui/gtk-gl-area.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c > index eee821d73a..98b3a116bf 100644 > --- a/ui/gtk-egl.c > +++ b/ui/gtk-egl.c > @@ -242,7 +242,6 @@ void gd_egl_scanout_texture(DisplayChangeListener *dcl, > eglMakeCurrent(qemu_egl_display, vc->gfx.esurface, > vc->gfx.esurface, vc->gfx.ectx); > > - gtk_egl_set_scanout_mode(vc, true); > egl_fb_setup_for_tex(&vc->gfx.guest_fb, backing_width, backing_height, > backing_id, false); > } > @@ -353,6 +352,7 @@ void gd_egl_flush(DisplayChangeListener *dcl, > if (vc->gfx.guest_fb.dmabuf && !vc->gfx.guest_fb.dmabuf->draw_submitted) { > graphic_hw_gl_block(vc->gfx.dcl.con, true); > vc->gfx.guest_fb.dmabuf->draw_submitted = true; > + gtk_egl_set_scanout_mode(vc, true); > gtk_widget_queue_draw_area(area, x, y, w, h); > return; > } > diff --git a/ui/gtk-gl-area.c b/ui/gtk-gl-area.c > index 4513d3d059..28d9e49888 100644 > --- a/ui/gtk-gl-area.c > +++ b/ui/gtk-gl-area.c > @@ -264,7 +264,6 @@ void gd_gl_area_scanout_texture(DisplayChangeListener *dcl, > return; > } > > - gtk_gl_area_set_scanout_mode(vc, true); > egl_fb_setup_for_tex(&vc->gfx.guest_fb, backing_width, backing_height, > backing_id, false); > } > @@ -284,6 +283,7 @@ void gd_gl_area_scanout_flush(DisplayChangeListener *dcl, > if (vc->gfx.guest_fb.dmabuf && !vc->gfx.guest_fb.dmabuf->draw_submitted) { > graphic_hw_gl_block(vc->gfx.dcl.con, true); > vc->gfx.guest_fb.dmabuf->draw_submitted = true; > + gtk_gl_area_set_scanout_mode(vc, true); > } > gtk_gl_area_queue_render(GTK_GL_AREA(vc->gfx.drawing_area)); > }