From nobody Sat Nov 15 09:50:12 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; 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=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1752882191; cv=none; d=zohomail.com; s=zohoarc; b=Yu0z5WdKO878ieA1s4upqaCZYp5o80CS2M+v0FVGCi6+TGmP4SGDzxdR5j1hY+nwoPWQejhIzXo7mkJAMmeE0TaX90pRYQhHMLSqlgCqT/kHSO9OJqKMIN27lIRspjVLmFGkMjFfLQiBN/v33dcPAikIExLjAZNKDZylPnL9ds8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752882191; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Z03X4/C/XmEtck7D9vP8CpAk789vUIrG3+KJoodpI3s=; b=KiYnyheOdQ4VMYiwHDKIDvKqS+WJO4JVO2ttid3qcJHYcjb1mcD79T/vvLILOolz37DWqpf6WgCsFvx/x7W5oSujjmnQJtcWDkaY8vnvXpqSTIEbfPZfE7CtkhmB0KBoagZQ9x0LkWEEupKAJiPCTUQoFd/EdmrmwLvhD+PaCRc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1752882191624233.8579233870082; Fri, 18 Jul 2025 16:43:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ucuia-0006pH-N7; Fri, 18 Jul 2025 19:42:20 -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 1ucuiW-0006ju-JB for qemu-devel@nongnu.org; Fri, 18 Jul 2025 19:42:17 -0400 Received: from mgamail.intel.com ([198.175.65.15]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ucuiT-0003h1-VA for qemu-devel@nongnu.org; Fri, 18 Jul 2025 19:42:16 -0400 Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jul 2025 16:42:08 -0700 Received: from vkasired-desk2.fm.intel.com ([10.105.128.132]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jul 2025 16:42:09 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1752882132; x=1784418132; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=fL6UqhsgnUYt1MefObBWRGNQV2U99Qh0QQqUIr1xdNY=; b=IKL2vFZvYLaLnUMlmQCFyXGZxkCzMVJJlDKwUQ6WBGsX8yeKTX5uruPc YWdJ0j/KDB8/igVJdtY0A2Qh5/aEZAwg31n4igw6nZ+gUl7XaSqusIPjl CKt7R8vRlX6Cm14R2A0VphGuZ+WvjtvdE+H2MKDbRbPbTJH+kpGa4JxvR T5ShpMzJe3oFkhlU6nx+F0qZhGUxAy8FBYvHJGRWUpMyAdZFIH1H8DeVR rKFiz9U1Jl9bAvnRTCWm8E3oesiqzj3z5MIQW+WslgP9hBuT65T7bHJI+ MWmjbZw8Eoxp9S8RmI+AzutB9WYKS9NntZkWmeTSdAWPuD8BCcf0cvA4Y w==; X-CSE-ConnectionGUID: xMX9mbI0TfakGMgNsptRSw== X-CSE-MsgGUID: kSwj16F4SC+BEAipIFAbOA== X-IronPort-AV: E=McAfee;i="6800,10657,11496"; a="58846316" X-IronPort-AV: E=Sophos;i="6.16,323,1744095600"; d="scan'208";a="58846316" X-CSE-ConnectionGUID: Q3ncy0ENSdy2LUhtWQ1hxw== X-CSE-MsgGUID: wzXzpbi6Tli5YdIZC2p6xA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.16,323,1744095600"; d="scan'208";a="162891797" From: Vivek Kasireddy To: qemu-devel@nongnu.org Cc: Vivek Kasireddy , Peter Maydell , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH] ui/spice: Destroy the temporary egl fb after the blit is submitted Date: Fri, 18 Jul 2025 16:40:39 -0700 Message-ID: <20250718234039.2266704-1-vivek.kasireddy@intel.com> X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=198.175.65.15; envelope-from=vivek.kasireddy@intel.com; helo=mgamail.intel.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.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_MED=-2.3, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @intel.com) X-ZM-MESSAGEID: 1752882193030116600 The temporary egl fb scanout_tex_fb is only needed to facilitate the blit to the display surface's texture (ssd->ds->texture). Therefore, destroy it after the blit is submitted. And, also make sure that it is empty initialized before it is actually used. Fixes: f851cd65 ("ui/spice: Blit the scanout texture if its memory layout i= s not linear") Reported-by: Peter Maydell Cc: Marc-Andr=C3=A9 Lureau Signed-off-by: Vivek Kasireddy Reviewed-by: Marc-Andr=C3=A9 Lureau --- v2: - Make scanout_tex_fb local to spice_gl_blit_scanout_texture() since it is not used outside of it (Peter) --- ui/spice-display.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/ui/spice-display.c b/ui/spice-display.c index 9ce622cefc..669832c561 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -1183,20 +1183,20 @@ static void qemu_spice_gl_release_dmabuf(DisplayCha= ngeListener *dcl, egl_dmabuf_release_texture(dmabuf); } =20 -static bool spice_gl_blit_scanout_texture(SimpleSpiceDisplay *ssd, - egl_fb *scanout_tex_fb) +static bool spice_gl_blit_scanout_texture(SimpleSpiceDisplay *ssd) { uint32_t offsets[DMABUF_MAX_PLANES], strides[DMABUF_MAX_PLANES]; int fds[DMABUF_MAX_PLANES], num_planes, fourcc; + egl_fb scanout_tex_fb =3D {}; uint64_t modifier; bool ret; =20 - egl_fb_destroy(scanout_tex_fb); - egl_fb_setup_for_tex(scanout_tex_fb, + egl_fb_setup_for_tex(&scanout_tex_fb, surface_width(ssd->ds), surface_height(ssd->ds), ssd->ds->texture, false); - egl_fb_blit(scanout_tex_fb, &ssd->guest_fb, false); + egl_fb_blit(&scanout_tex_fb, &ssd->guest_fb, false); glFlush(); + egl_fb_destroy(&scanout_tex_fb); =20 if (!ssd->new_scanout_texture) { return true; @@ -1330,9 +1330,7 @@ static void qemu_spice_gl_update(DisplayChangeListene= r *dcl, } =20 if (spice_remote_client && ssd->blit_scanout_texture) { - egl_fb scanout_tex_fb; - - ret =3D spice_gl_blit_scanout_texture(ssd, &scanout_tex_fb); + ret =3D spice_gl_blit_scanout_texture(ssd); if (!ret) { return; } --=20 2.49.0