From nobody Tue Apr 7 00:01:20 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1773768111; cv=none; d=zohomail.com; s=zohoarc; b=Qou5BaeRC1ApxcKPwDYfXeUqGDoMfhp+BsLsJKZTvFGjNJjXDEyHMzYnQy8BlhLKrhn6gJqGVAVbH1JMVKXy6umV9uq3BbqQLJETSKOC1ge5msKzWXun4dXGhjw9ObjXYapKaIw2BlddJ+3GT7VLGQ2soTtYTzXU67AkOOo0r0c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773768111; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=CsXxg8re8FW5F+2kVJ5NcmGqhrD7GcwxsyzUaPHGSsI=; b=Oh1tliw0ZHkzt4FB7VxHv2DSlK7lxQ6Zy7HJkdztiSW+ukAnID3eNVs0fMvO80mJDDcwMyfev6pxGRB9A+X25u7kQDgdV6+hkwoolf0vd9rWbJh5ZVITf7DuROMnOQP9xsUArsheKTQb8lKjYG5UfF74KvnUqSrszsWTeCncnvo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773768111093147.78094735907166; Tue, 17 Mar 2026 10:21:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w2Y5u-0002E1-1A; Tue, 17 Mar 2026 13:20:42 -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 1w2Y5k-0002Ac-CS for qemu-devel@nongnu.org; Tue, 17 Mar 2026 13:20:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1w2Y5g-0005bO-1O for qemu-devel@nongnu.org; Tue, 17 Mar 2026 13:20:25 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-589-nG3ESCm4M7yA8SUYnQNjIQ-1; Tue, 17 Mar 2026 13:20:18 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C27EC195607B; Tue, 17 Mar 2026 17:20:16 +0000 (UTC) Received: from localhost (unknown [10.44.22.4]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 40123180035F; Tue, 17 Mar 2026 17:20:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1773768023; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CsXxg8re8FW5F+2kVJ5NcmGqhrD7GcwxsyzUaPHGSsI=; b=IXdO6NlWJ7RvfmJgQ2xfheHeYWC/HA4jOZmTtDp8rlnaHsm7Qu40gCDWN7/yiWk8iPzXX7 CJTbVlUcQ6eW2R4io4deYz1nzeo3rS11t53UcCeGEMxHo1NXEDh0OJpyeoLrjjYsz8BHOs McpSRXHIv4dCJsDfanwy/ufndJhLtI4= X-MC-Unique: nG3ESCm4M7yA8SUYnQNjIQ-1 X-Mimecast-MFC-AGG-ID: nG3ESCm4M7yA8SUYnQNjIQ_1773768016 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Dmitry Osipenko , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , "Michael S. Tsirkin" , Christian Schoenebeck , Ani Sinha , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann , Zhao Liu , Marcel Apfelbaum , Yanan Wang , Akihiko Odaki , Dongwon Kim , Vivek Kasireddy Subject: [PULL 08/16] ui/gtk-egl: Ensure EGL surface is available before drawing Date: Tue, 17 Mar 2026 21:19:08 +0400 Message-ID: <20260317171916.438575-9-marcandre.lureau@redhat.com> In-Reply-To: <20260317171916.438575-1-marcandre.lureau@redhat.com> References: <20260317171916.438575-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -3 X-Spam_score: -0.4 X-Spam_bar: / X-Spam_report: (-0.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.819, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.903, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1773768112951154100 From: Dongwon Kim The EGL surface and context are destroyed when a new GTK window is created. We must ensure these are recreated and initialized before any rendering happens in gd_egl_refresh. Currently, the check for a pending draw is performed before the surface initialization block. This can result in an attempt to draw when the EGL surface (vc->gfx.esurface) is not yet available. This patch moves the drawing check after the surface initialization to ensure a valid surface exists before rendering in gd_egl_refresh. Cc: Gerd Hoffmann Cc: Marc-Andr=C3=A9 Lureau Signed-off-by: Vivek Kasireddy Signed-off-by: Dongwon Kim Acked-by: Marc-Andr=C3=A9 Lureau Message-Id: <20260303011151.1925827-1-dongwon.kim@intel.com> --- ui/gtk-egl.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c index 1b5c1d4533c..fa8fe8970c1 100644 --- a/ui/gtk-egl.c +++ b/ui/gtk-egl.c @@ -152,12 +152,6 @@ void gd_egl_refresh(DisplayChangeListener *dcl) gd_update_monitor_refresh_rate( vc, vc->window ? vc->window : vc->gfx.drawing_area); =20 - if (vc->gfx.guest_fb.dmabuf && - qemu_dmabuf_get_draw_submitted(vc->gfx.guest_fb.dmabuf)) { - gd_egl_draw(vc); - return; - } - if (!vc->gfx.esurface) { gd_egl_init(vc); if (!vc->gfx.esurface) { @@ -176,6 +170,12 @@ void gd_egl_refresh(DisplayChangeListener *dcl) #endif } =20 + if (vc->gfx.guest_fb.dmabuf && + qemu_dmabuf_get_draw_submitted(vc->gfx.guest_fb.dmabuf)) { + gd_egl_draw(vc); + return; + } + graphic_hw_update(dcl->con); =20 if (vc->gfx.glupdates) { --=20 2.53.0