From mboxrd@z Thu Jan 1 00:00:00 1970 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 E1707EB64D7 for ; Wed, 21 Jun 2023 01:05:20 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qBmGH-0007pj-MB; Tue, 20 Jun 2023 21:03:53 -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 1qBmGG-0007p6-9V for qemu-devel@nongnu.org; Tue, 20 Jun 2023 21:03:52 -0400 Received: from mga11.intel.com ([192.55.52.93]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qBmGE-0001Gy-Iv for qemu-devel@nongnu.org; Tue, 20 Jun 2023 21:03:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1687309430; x=1718845430; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dlMd5Y05RlitQ/LDn4QHI3iY/Scnnj1sren1XCBp1Gw=; b=Wb3w+EvlgTBNjKv+xhkG/232K0Wb5rrpEpyErmB3+eKadw/74Ga48fCe AaWORwY3ifNNLkGqMGwDrcWt+SlYHJu9qWTRZY67z7KagJIbTrHjjHFiO mc/5cW6SY/fNhSg9xg5HA5xhOzkIXvVcWwzeNd961iwV43m9IxkNPCV4m Ru/972KzgF6NA4HeSwF2uQbV9hFLJRiZ9AICqk1eFjQ1TcS905TQGtjK5 U0u/kxXyIhBOy582ree+DeSi8p3i/rgFIqnyvyeVBzwX5aP1CrLFJkcF0 n7+pcBvhLPVyFXKI6G3tQm7ku1rxWA066AfRG62PnZt5WA9clZktmsK4u g==; X-IronPort-AV: E=McAfee;i="6600,9927,10747"; a="357522840" X-IronPort-AV: E=Sophos;i="6.00,258,1681196400"; d="scan'208";a="357522840" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jun 2023 18:03:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10747"; a="838429580" X-IronPort-AV: E=Sophos;i="6.00,258,1681196400"; d="scan'208";a="838429580" Received: from dongwonk-z390-aorus-ultra-intel-gfx.fm.intel.com ([10.105.129.122]) by orsmga004.jf.intel.com with ESMTP; 20 Jun 2023 18:03:44 -0700 From: Dongwon Kim To: qemu-devel@nongnu.org Cc: kraxel@redhat.com, berrange@redhat.com, armbru@redhat.com, philmd@linaro.org, marcandre.lureau@redhat.com, vivek.kasireddy@intel.com, Dongwon Kim Subject: [RFC PATCH 8/9] ui/gtk: skip drawing if any of ctx/surface/image don't exist Date: Tue, 20 Jun 2023 17:43:54 -0700 Message-Id: <20230621004355.19920-9-dongwon.kim@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230621004355.19920-1-dongwon.kim@intel.com> References: <20230621004355.19920-1-dongwon.kim@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=192.55.52.93; envelope-from=dongwon.kim@intel.com; helo=mga11.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, SPF_HELO_NONE=0.001, SPF_PASS=-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 Rendering of scanout could be skipped if ctx/surface/image don't exist due to an asynchronous event such as monitors being disconnected. Cc: Gerd Hoffmann Cc: Daniel P. Berrangé Cc: Markus Armbruster Cc: Philippe Mathieu-Daudé Cc: Marc-André Lureau Cc: Vivek Kasireddy Signed-off-by: Dongwon Kim --- ui/gtk-egl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c index aa22ebbd98..8eae2b4b1f 100644 --- a/ui/gtk-egl.c +++ b/ui/gtk-egl.c @@ -106,6 +106,11 @@ void gd_egl_draw(VirtualConsole *vc) if (!vc->gfx.ds) { return; } + + if (!vc->gfx.esurface || !vc->gfx.ectx || !vc->gfx.ds->image) { + return; + } + eglMakeCurrent(qemu_egl_display, vc->gfx.esurface, vc->gfx.esurface, vc->gfx.ectx); -- 2.34.1