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 X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB89BC12002 for ; Fri, 16 Jul 2021 22:09:39 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 40D0461278 for ; Fri, 16 Jul 2021 22:09:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 40D0461278 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:56092 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m4W1Z-0005VH-4t for qemu-devel@archiver.kernel.org; Fri, 16 Jul 2021 18:09:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49914) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4W0f-0004WQ-V5 for qemu-devel@nongnu.org; Fri, 16 Jul 2021 18:08:41 -0400 Received: from mga09.intel.com ([134.134.136.24]:27573) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4W0d-0000nP-8Z for qemu-devel@nongnu.org; Fri, 16 Jul 2021 18:08:41 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10047"; a="210787238" X-IronPort-AV: E=Sophos;i="5.84,246,1620716400"; d="scan'208";a="210787238" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jul 2021 15:08:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,246,1620716400"; d="scan'208";a="460889412" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by orsmga008.jf.intel.com with ESMTP; 16 Jul 2021 15:08:36 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Fri, 16 Jul 2021 15:08:35 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Fri, 16 Jul 2021 15:08:34 -0700 Received: from orsmsx611.amr.corp.intel.com ([10.22.229.24]) by ORSMSX611.amr.corp.intel.com ([10.22.229.24]) with mapi id 15.01.2242.010; Fri, 16 Jul 2021 15:08:34 -0700 From: "Kasireddy, Vivek" To: "Kim, Dongwon" , "qemu-devel@nongnu.org" Subject: RE: [PATCH 1/3] ui/gtk-egl: un-tab and re-tab should destroy egl surface and context Thread-Topic: [PATCH 1/3] ui/gtk-egl: un-tab and re-tab should destroy egl surface and context Thread-Index: AQHXb6KybM1tJ9RIOUaOAY/EAPLq2KtGPu3A Date: Fri, 16 Jul 2021 22:08:34 +0000 Message-ID: References: <20210703002809.26753-1-dongwon.kim@intel.com> In-Reply-To: <20210703002809.26753-1-dongwon.kim@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.5.1.3 dlp-reaction: no-action x-originating-ip: [10.1.200.100] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Received-SPF: pass client-ip=134.134.136.24; envelope-from=vivek.kasireddy@intel.com; helo=mga09.intel.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Romli, Khairul Anuar" , "Kim, Dongwon" Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Vivek Kasireddy > -----Original Message----- > From: Qemu-devel On > Behalf Of Dongwon Kim > Sent: Friday, July 02, 2021 5:28 PM > To: qemu-devel@nongnu.org > Cc: Romli, Khairul Anuar ; Kim, Dongwon > > Subject: [PATCH 1/3] ui/gtk-egl: un-tab and re-tab should destroy egl sur= face and context >=20 > An old esurface should be destroyed and set to be NULL when doing > un-tab and re-tab so that a new esurface an context can be created > for the window widget that those will be bound to. >=20 > Signed-off-by: Dongwon Kim > Signed-off-by: Khairul Anuar Romli > --- > ui/gtk.c | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) >=20 > diff --git a/ui/gtk.c b/ui/gtk.c > index 98046f577b..bfb95f3b4b 100644 > --- a/ui/gtk.c > +++ b/ui/gtk.c > @@ -1232,6 +1232,14 @@ static gboolean gd_tab_window_close(GtkWidget *wid= get, > GdkEvent *event, > vc->tab_item, vc->label); > gtk_widget_destroy(vc->window); > vc->window =3D NULL; > + if (vc->gfx.esurface) { > + eglDestroySurface(qemu_egl_display, vc->gfx.esurface); > + vc->gfx.esurface =3D NULL; > + } > + if (vc->gfx.ectx) { > + eglDestroyContext(qemu_egl_display, vc->gfx.ectx); > + vc->gfx.ectx =3D NULL; > + } > return TRUE; > } >=20 > @@ -1261,6 +1269,14 @@ static void gd_menu_untabify(GtkMenuItem *item, vo= id > *opaque) > if (!vc->window) { > gtk_widget_set_sensitive(vc->menu_item, false); > vc->window =3D gtk_window_new(GTK_WINDOW_TOPLEVEL); > + if (vc->gfx.esurface) { > + eglDestroySurface(qemu_egl_display, vc->gfx.esurface); > + vc->gfx.esurface =3D NULL; > + } > + if (vc->gfx.esurface) { > + eglDestroyContext(qemu_egl_display, vc->gfx.ectx); > + vc->gfx.ectx =3D NULL; > + } > gd_widget_reparent(s->notebook, vc->window, vc->tab_item); >=20 > g_signal_connect(vc->window, "delete-event", > -- > 2.17.1 >=20