From nobody Tue May 21 09:31:29 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.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=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1623109443; cv=none; d=zohomail.com; s=zohoarc; b=ZFt1QgOpul63uSOBeRQkie7GRiCH3cP2+aRTQaKM4lXf9g0VGMAstiWXCYsytH2VXvDEnz/e9uLOk0G0lR9dTPDWXcdfufa9WTR9In7b9GGm7GFPt+ozykqMzXwP6bVZW/0TYn5t3A8GkJk7uKK1++2IBRO4A+W/R80exSCKnSw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623109443; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=MTb27H2qaf4k2o2R5f8MADvcy9qPW8TGVbt8E+d4riU=; b=ipkbnFqeXvhY3qO7uv+2m2zSLGA5xIqK2k7Ni50HURNPyRuLnnQKR4EP2YBgi7r3YpuLhdpKyxMG6/vmRbMFruWVCMb9sMxJKgd7opTCDynl29I/09yxdQKHTj6NabK45z0MGbVRDBLz06IRbdDsq5znFDWxreKISU70kGRfe2M= ARC-Authentication-Results: i=1; mx.zohomail.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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1623109443080550.6829117073391; Mon, 7 Jun 2021 16:44:03 -0700 (PDT) Received: from localhost ([::1]:46122 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lqOuX-00015O-Lr for importer@patchew.org; Mon, 07 Jun 2021 19:44:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39054) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqOp1-0001ge-6d for qemu-devel@nongnu.org; Mon, 07 Jun 2021 19:38:19 -0400 Received: from mga06.intel.com ([134.134.136.31]:2298) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqOox-00076S-S1 for qemu-devel@nongnu.org; Mon, 07 Jun 2021 19:38:18 -0400 Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2021 16:38:02 -0700 Received: from vkasired-desk2.fm.intel.com ([10.105.128.127]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2021 16:38:02 -0700 IronPort-SDR: MinnM8QctrEw7PR6leNqCDnRb96mSQ+z80EUz+vhGb6W+dxZC0/H2WpPtEogh21WDAW5XP/wCp l/c4hDKyT47w== X-IronPort-AV: E=McAfee;i="6200,9189,10008"; a="265889546" X-IronPort-AV: E=Sophos;i="5.83,256,1616482800"; d="scan'208";a="265889546" IronPort-SDR: WpzcFKjSP0nDfz2Tn4MCIYOyIgC7YsyI9YSF1DsjPfbYt+U0P0ytCUUyIUdCWI6yIle43hqmgJ 9SJSpQBBAPTQ== X-IronPort-AV: E=Sophos;i="5.83,256,1616482800"; d="scan'208";a="551403345" From: Vivek Kasireddy To: qemu-devel@nongnu.org Subject: [PATCH v1 1/5] ui/gtk: Create a common release_dmabuf helper Date: Mon, 7 Jun 2021 16:25:26 -0700 Message-Id: <20210607232530.454435-2-vivek.kasireddy@intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210607232530.454435-1-vivek.kasireddy@intel.com> References: <20210607232530.454435-1-vivek.kasireddy@intel.com> MIME-Version: 1.0 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=134.134.136.31; envelope-from=vivek.kasireddy@intel.com; helo=mga06.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, 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: Vivek Kasireddy , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Since the texture release mechanism is same for both gtk-egl and gtk-glarea, move the helper from gtk-egl to common gtk code so that it can be shared by both gtk backends. Cc: Gerd Hoffmann Signed-off-by: Vivek Kasireddy Reviewed-by: Gerd Hoffmann --- include/ui/gtk.h | 2 -- ui/gtk-egl.c | 8 -------- ui/gtk.c | 11 ++++++++++- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/include/ui/gtk.h b/include/ui/gtk.h index 9516670ebc..e6cbf0507c 100644 --- a/include/ui/gtk.h +++ b/include/ui/gtk.h @@ -178,8 +178,6 @@ void gd_egl_cursor_dmabuf(DisplayChangeListener *dcl, uint32_t hot_x, uint32_t hot_y); void gd_egl_cursor_position(DisplayChangeListener *dcl, uint32_t pos_x, uint32_t pos_y); -void gd_egl_release_dmabuf(DisplayChangeListener *dcl, - QemuDmaBuf *dmabuf); void gd_egl_scanout_flush(DisplayChangeListener *dcl, uint32_t x, uint32_t y, uint32_t w, uint32_t h); void gtk_egl_init(DisplayGLMode mode); diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c index 2a2e6d3a17..b671181272 100644 --- a/ui/gtk-egl.c +++ b/ui/gtk-egl.c @@ -249,14 +249,6 @@ void gd_egl_cursor_position(DisplayChangeListener *dcl, vc->gfx.cursor_y =3D pos_y * vc->gfx.scale_y; } =20 -void gd_egl_release_dmabuf(DisplayChangeListener *dcl, - QemuDmaBuf *dmabuf) -{ -#ifdef CONFIG_GBM - egl_dmabuf_release_texture(dmabuf); -#endif -} - void gd_egl_scanout_flush(DisplayChangeListener *dcl, uint32_t x, uint32_t y, uint32_t w, uint32_t h) { diff --git a/ui/gtk.c b/ui/gtk.c index 98046f577b..6132bab52f 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -575,6 +575,14 @@ static bool gd_has_dmabuf(DisplayChangeListener *dcl) return vc->gfx.has_dmabuf; } =20 +static void gd_gl_release_dmabuf(DisplayChangeListener *dcl, + QemuDmaBuf *dmabuf) +{ +#ifdef CONFIG_GBM + egl_dmabuf_release_texture(dmabuf); +#endif +} + /** DisplayState Callbacks (opengl version) **/ =20 static const DisplayChangeListenerOps dcl_gl_area_ops =3D { @@ -593,6 +601,7 @@ static const DisplayChangeListenerOps dcl_gl_area_ops = =3D { .dpy_gl_scanout_disable =3D gd_gl_area_scanout_disable, .dpy_gl_update =3D gd_gl_area_scanout_flush, .dpy_gl_scanout_dmabuf =3D gd_gl_area_scanout_dmabuf, + .dpy_gl_release_dmabuf =3D gd_gl_release_dmabuf, .dpy_has_dmabuf =3D gd_has_dmabuf, }; =20 @@ -615,8 +624,8 @@ static const DisplayChangeListenerOps dcl_egl_ops =3D { .dpy_gl_scanout_dmabuf =3D gd_egl_scanout_dmabuf, .dpy_gl_cursor_dmabuf =3D gd_egl_cursor_dmabuf, .dpy_gl_cursor_position =3D gd_egl_cursor_position, - .dpy_gl_release_dmabuf =3D gd_egl_release_dmabuf, .dpy_gl_update =3D gd_egl_scanout_flush, + .dpy_gl_release_dmabuf =3D gd_gl_release_dmabuf, .dpy_has_dmabuf =3D gd_has_dmabuf, }; =20 --=20 2.30.2 From nobody Tue May 21 09:31:29 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.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=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1623109303; cv=none; d=zohomail.com; s=zohoarc; b=fej9JbVmRImCA14IR9F3HFZYh9rX53YPj3SuANtYSSIQeLFByKfsJHigYxfgNds/RcYjdg+79ZwSTWLQA4934scybujqY4tKaeRilMkajaATOWmf/5LcnZDJcpQrQm/YO7Wfwz1A+d5nJ7dZWiLGFt1hQesCxMMOcTIu3vYUahM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623109303; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=HL+O7/W2FQ1n3WRHx2LLVXvxHAs9r2Jbrp0RzZsulZo=; b=kIEzuEihs7f0iYQMghCPtOoTtJ0D1LY51oiBnWXa1i7LLSVy7WiVxaBxm6/CpPUHR+q6CvBwAuldc3Mp65/3nYixAn6b1Er3ro1LvOwNAjC0bQ1sY21D2FOPt+AA3LDl67oalsIdaTTdHkKYoa5i9MaINmNHgeQeYrTvmo0xs2E= ARC-Authentication-Results: i=1; mx.zohomail.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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 162310930349225.14694111565666; Mon, 7 Jun 2021 16:41:43 -0700 (PDT) Received: from localhost ([::1]:41806 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lqOsI-0006Zu-Hi for importer@patchew.org; Mon, 07 Jun 2021 19:41:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39000) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqOow-0001XQ-Ax for qemu-devel@nongnu.org; Mon, 07 Jun 2021 19:38:14 -0400 Received: from mga06.intel.com ([134.134.136.31]:2273) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqOou-00071e-Ng for qemu-devel@nongnu.org; Mon, 07 Jun 2021 19:38:14 -0400 Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2021 16:38:03 -0700 Received: from vkasired-desk2.fm.intel.com ([10.105.128.127]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2021 16:38:02 -0700 IronPort-SDR: k5hr56ETa+gR8+eX6ZVWDrCXvhyWB4ybf8Mj1uygPO1LOfZBxBtSWlSKvZ5S9OP5jNnS7avxpR jym53MZ5q2cQ== X-IronPort-AV: E=McAfee;i="6200,9189,10008"; a="265889547" X-IronPort-AV: E=Sophos;i="5.83,256,1616482800"; d="scan'208";a="265889547" IronPort-SDR: vygApjwvA54kYmwTmSrRazW+jOYLy7XWVl67oWe119s0txEpYwcwMPc8QVAAdceDr7cN+moaZf yTXbpVtOGQUg== X-IronPort-AV: E=Sophos;i="5.83,256,1616482800"; d="scan'208";a="551403349" From: Vivek Kasireddy To: qemu-devel@nongnu.org Subject: [PATCH v1 2/5] ui: Add a helper to wait on a dmabuf sync object Date: Mon, 7 Jun 2021 16:25:27 -0700 Message-Id: <20210607232530.454435-3-vivek.kasireddy@intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210607232530.454435-1-vivek.kasireddy@intel.com> References: <20210607232530.454435-1-vivek.kasireddy@intel.com> MIME-Version: 1.0 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=134.134.136.31; envelope-from=vivek.kasireddy@intel.com; helo=mga06.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, 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: Vivek Kasireddy , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" This will be called by virtio-gpu in the subsequent patches. Cc: Gerd Hoffmann Signed-off-by: Vivek Kasireddy --- include/ui/console.h | 5 +++++ ui/console.c | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/include/ui/console.h b/include/ui/console.h index b30b63976a..c3dca61c31 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -240,6 +240,9 @@ typedef struct DisplayChangeListenerOps { /* optional */ void (*dpy_gl_release_dmabuf)(DisplayChangeListener *dcl, QemuDmaBuf *dmabuf); + /* optional */ + void (*dpy_gl_wait_dmabuf)(DisplayChangeListener *dcl, + QemuDmaBuf *dmabuf); /* required if GL */ void (*dpy_gl_update)(DisplayChangeListener *dcl, uint32_t x, uint32_t y, uint32_t w, uint32_t h); @@ -312,6 +315,8 @@ void dpy_gl_cursor_position(QemuConsole *con, uint32_t pos_x, uint32_t pos_y); void dpy_gl_release_dmabuf(QemuConsole *con, QemuDmaBuf *dmabuf); +void dpy_gl_wait_dmabuf(QemuConsole *con, + QemuDmaBuf *dmabuf); void dpy_gl_update(QemuConsole *con, uint32_t x, uint32_t y, uint32_t w, uint32_t h); =20 diff --git a/ui/console.c b/ui/console.c index 2de5f4105b..b0abfd2246 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1917,6 +1917,16 @@ void dpy_gl_release_dmabuf(QemuConsole *con, } } =20 +void dpy_gl_wait_dmabuf(QemuConsole *con, + QemuDmaBuf *dmabuf) +{ + assert(con->gl); + + if (con->gl->ops->dpy_gl_wait_dmabuf) { + con->gl->ops->dpy_gl_wait_dmabuf(con->gl, dmabuf); + } +} + void dpy_gl_update(QemuConsole *con, uint32_t x, uint32_t y, uint32_t w, uint32_t h) { --=20 2.30.2 From nobody Tue May 21 09:31:29 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.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=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1623109376; cv=none; d=zohomail.com; s=zohoarc; b=lKStWatgAS0eCNDGCEiahr69vGW+E0UWmlhrOD8N+hq/fcHnZ2Y5iBBd5GijxXyvfw+5SI/PtwpUyTAsBts5aTHIHfTKmUdkmneHyuIgpiGLmJnBL3LOIykIkgDolLj1VpgrP7YaJiitAK1bR/MVmYhiivUditXAZxwebA0i9rA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623109376; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=bs24PoaZTCEgHne+VWXO0yd7aInrQFeOPEzRNt2SFds=; b=nQxGkSbdgBuS6mfEXMJgr343TlTdI81FO0PzvIzCL3jnIiU0R7nOuXxcjwVOm1gGWq2529HTed/RX+HTeul6j/f/ziowstlIpXAVXuZ5QwvO7lq/VQhHH1Zp8E3i7iqQpw5/WaMXZ60pR4wCrZFHMVhXSK6en2/m6bUW2W3LpXc= ARC-Authentication-Results: i=1; mx.zohomail.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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1623109376205953.6182311230258; Mon, 7 Jun 2021 16:42:56 -0700 (PDT) Received: from localhost ([::1]:43942 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lqOtS-00082W-8g for importer@patchew.org; Mon, 07 Jun 2021 19:42:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39030) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqOoy-0001ab-6z for qemu-devel@nongnu.org; Mon, 07 Jun 2021 19:38:16 -0400 Received: from mga06.intel.com ([134.134.136.31]:2292) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqOow-00075e-Bn for qemu-devel@nongnu.org; Mon, 07 Jun 2021 19:38:15 -0400 Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2021 16:38:03 -0700 Received: from vkasired-desk2.fm.intel.com ([10.105.128.127]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2021 16:38:02 -0700 IronPort-SDR: V4OVUNgfnE0sL6pwcv0oNYJYCAb6y2sCwOsdDmSaRhTGzQ21re41cMlbofo3oqDHjhWAwE/2uA sL6fgh5uiGuA== X-IronPort-AV: E=McAfee;i="6200,9189,10008"; a="265889549" X-IronPort-AV: E=Sophos;i="5.83,256,1616482800"; d="scan'208";a="265889549" IronPort-SDR: rZmKqcmORWucPaYKyMe0yxkV78qcjGZTgGB/rYcYSQCWmAbAXNHk4r6xyIvTZ8J/KfApezK0oR QTxHoYYozgfw== X-IronPort-AV: E=Sophos;i="5.83,256,1616482800"; d="scan'208";a="551403355" From: Vivek Kasireddy To: qemu-devel@nongnu.org Subject: [PATCH v1 3/5] ui/egl: Add egl helpers to help with synchronization Date: Mon, 7 Jun 2021 16:25:28 -0700 Message-Id: <20210607232530.454435-4-vivek.kasireddy@intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210607232530.454435-1-vivek.kasireddy@intel.com> References: <20210607232530.454435-1-vivek.kasireddy@intel.com> MIME-Version: 1.0 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=134.134.136.31; envelope-from=vivek.kasireddy@intel.com; helo=mga06.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, 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: Vivek Kasireddy , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" These egl helpers would be used for creating and waiting on a sync object. Cc: Gerd Hoffmann Signed-off-by: Vivek Kasireddy --- include/ui/console.h | 2 ++ include/ui/egl-helpers.h | 3 +++ ui/egl-helpers.c | 44 ++++++++++++++++++++++++++++++++++++++++ ui/gtk.c | 15 ++++++++++++++ 4 files changed, 64 insertions(+) diff --git a/include/ui/console.h b/include/ui/console.h index c3dca61c31..a89f739f10 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -168,6 +168,8 @@ typedef struct QemuDmaBuf { uint64_t modifier; uint32_t texture; bool y0_top; + void *sync; + int fence_fd; } QemuDmaBuf; =20 typedef struct DisplayState DisplayState; diff --git a/include/ui/egl-helpers.h b/include/ui/egl-helpers.h index f1bf8f97fc..5a7575dc13 100644 --- a/include/ui/egl-helpers.h +++ b/include/ui/egl-helpers.h @@ -45,6 +45,9 @@ int egl_get_fd_for_texture(uint32_t tex_id, EGLint *strid= e, EGLint *fourcc, =20 void egl_dmabuf_import_texture(QemuDmaBuf *dmabuf); void egl_dmabuf_release_texture(QemuDmaBuf *dmabuf); +void egl_dmabuf_create_sync(QemuDmaBuf *dmabuf); +void egl_dmabuf_create_fence(QemuDmaBuf *dmabuf); +void egl_dmabuf_wait_sync(QemuDmaBuf *dmabuf); =20 #endif =20 diff --git a/ui/egl-helpers.c b/ui/egl-helpers.c index 6d0cb2b5cb..47220b66e0 100644 --- a/ui/egl-helpers.c +++ b/ui/egl-helpers.c @@ -76,6 +76,50 @@ void egl_fb_setup_for_tex(egl_fb *fb, int width, int hei= ght, GL_TEXTURE_2D, fb->texture, 0); } =20 +void egl_dmabuf_create_sync(QemuDmaBuf *dmabuf) +{ + EGLSyncKHR sync; + + if (epoxy_has_egl_extension(qemu_egl_display, + "EGL_KHR_fence_sync") && + epoxy_has_egl_extension(qemu_egl_display, + "EGL_ANDROID_native_fence_sync")) { + sync =3D eglCreateSyncKHR(qemu_egl_display, + EGL_SYNC_NATIVE_FENCE_ANDROID, NULL); + if (sync !=3D EGL_NO_SYNC_KHR) { + dmabuf->sync =3D sync; + } + } +} + +void egl_dmabuf_create_fence(QemuDmaBuf *dmabuf) +{ + if (dmabuf->sync) { + dmabuf->fence_fd =3D eglDupNativeFenceFDANDROID(qemu_egl_display, + dmabuf->sync); + eglDestroySyncKHR(qemu_egl_display, dmabuf->sync); + dmabuf->sync =3D NULL; + } +} + +void egl_dmabuf_wait_sync(QemuDmaBuf *dmabuf) +{ + EGLSyncKHR sync; + EGLint attrib_list[] =3D { + EGL_SYNC_NATIVE_FENCE_FD_ANDROID, dmabuf->fence_fd, + EGL_NONE, + }; + + sync =3D eglCreateSyncKHR(qemu_egl_display, + EGL_SYNC_NATIVE_FENCE_ANDROID, attrib_list); + if (sync !=3D EGL_NO_SYNC_KHR) { + eglClientWaitSyncKHR(qemu_egl_display, sync, + 0, EGL_FOREVER_KHR); + eglDestroySyncKHR(qemu_egl_display, sync); + dmabuf->fence_fd =3D -1; + } +} + void egl_fb_setup_new_tex(egl_fb *fb, int width, int height) { GLuint texture; diff --git a/ui/gtk.c b/ui/gtk.c index 6132bab52f..cd884ca26c 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -583,6 +583,19 @@ static void gd_gl_release_dmabuf(DisplayChangeListener= *dcl, #endif } =20 +static void gd_gl_wait_dmabuf(DisplayChangeListener *dcl, + QemuDmaBuf *dmabuf) +{ +#ifdef CONFIG_GBM + egl_dmabuf_create_fence(dmabuf); + if (dmabuf->fence_fd <=3D 0) { + return; + } + + egl_dmabuf_wait_sync(dmabuf); +#endif +} + /** DisplayState Callbacks (opengl version) **/ =20 static const DisplayChangeListenerOps dcl_gl_area_ops =3D { @@ -602,6 +615,7 @@ static const DisplayChangeListenerOps dcl_gl_area_ops = =3D { .dpy_gl_update =3D gd_gl_area_scanout_flush, .dpy_gl_scanout_dmabuf =3D gd_gl_area_scanout_dmabuf, .dpy_gl_release_dmabuf =3D gd_gl_release_dmabuf, + .dpy_gl_wait_dmabuf =3D gd_gl_wait_dmabuf, .dpy_has_dmabuf =3D gd_has_dmabuf, }; =20 @@ -626,6 +640,7 @@ static const DisplayChangeListenerOps dcl_egl_ops =3D { .dpy_gl_cursor_position =3D gd_egl_cursor_position, .dpy_gl_update =3D gd_egl_scanout_flush, .dpy_gl_release_dmabuf =3D gd_gl_release_dmabuf, + .dpy_gl_wait_dmabuf =3D gd_gl_wait_dmabuf, .dpy_has_dmabuf =3D gd_has_dmabuf, }; =20 --=20 2.30.2 From nobody Tue May 21 09:31:29 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.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=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1623109194; cv=none; d=zohomail.com; s=zohoarc; b=Gv/AeldvTR1rwUe2lt2IQYxhrAWD5kK9wd5nIuQfBa1192q/vfbRoTAi4Wk4Z9dL1JldMS1Ubf/TV0DIVGuDyr6bXEto+y0P1dfwWhiZbTo76HZlCHUbCS80F4lsAZsaNsPZDTMb+FwHIDMefGAAjriXmyOLZazDvkqghkiMiPM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623109194; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=x6A22EFqtgHd92aU2B5SJe9I6TRKJyfl5yQH7GKQqd4=; b=DuofjXbpQxhEwQ4C2C3HmcrEpxxytAXJhZDjuwo+CKIry7Y1VMIxDdA0/ijDSMJ5AuPpLDSK9kUo6q2E/sHuiS9o5fEH0OWq/9efO82zeSdJ+XSaWglzpHYsY0utd24vNEqhZAuYjJuAtxGlgL/tBSbWZoVaaDmLF22JCah2xc8= ARC-Authentication-Results: i=1; mx.zohomail.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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1623109194139184.53264800345073; Mon, 7 Jun 2021 16:39:54 -0700 (PDT) Received: from localhost ([::1]:37648 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lqOqW-0003if-PD for importer@patchew.org; Mon, 07 Jun 2021 19:39:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39052) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqOp0-0001eo-F2 for qemu-devel@nongnu.org; Mon, 07 Jun 2021 19:38:18 -0400 Received: from mga06.intel.com ([134.134.136.31]:2292) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqOoy-00075e-IB for qemu-devel@nongnu.org; Mon, 07 Jun 2021 19:38:18 -0400 Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2021 16:38:03 -0700 Received: from vkasired-desk2.fm.intel.com ([10.105.128.127]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2021 16:38:02 -0700 IronPort-SDR: My3GQIvBoTWfTTKVhpSNK/+OHvpg2Yffqp9lL2lgX8/LO9pnpvh9/84a5zwJGCQEYxkpr+DhF8 QWrJeOfHD8Eg== X-IronPort-AV: E=McAfee;i="6200,9189,10008"; a="265889550" X-IronPort-AV: E=Sophos;i="5.83,256,1616482800"; d="scan'208";a="265889550" IronPort-SDR: Hw/q880GdlCseJADmHow6U9a5O9C3yKzJK3L+6egRiJaCGV7srqiApG7TwoqrF/lZTw3G6zBv4 cbNyGC+9hufw== X-IronPort-AV: E=Sophos;i="5.83,256,1616482800"; d="scan'208";a="551403359" From: Vivek Kasireddy To: qemu-devel@nongnu.org Subject: [PATCH v1 4/5] ui: Create sync objects only for blobs Date: Mon, 7 Jun 2021 16:25:29 -0700 Message-Id: <20210607232530.454435-5-vivek.kasireddy@intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210607232530.454435-1-vivek.kasireddy@intel.com> References: <20210607232530.454435-1-vivek.kasireddy@intel.com> MIME-Version: 1.0 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=134.134.136.31; envelope-from=vivek.kasireddy@intel.com; helo=mga06.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, 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: Vivek Kasireddy , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" For now, create sync objects only for dmabufs that are blobs. Cc: Gerd Hoffmann Signed-off-by: Vivek Kasireddy --- hw/display/virtio-gpu-udmabuf.c | 2 ++ include/ui/console.h | 1 + include/ui/egl-helpers.h | 1 + ui/gtk-egl.c | 10 ++++++++++ ui/gtk-gl-area.c | 8 ++++++++ 5 files changed, 22 insertions(+) diff --git a/hw/display/virtio-gpu-udmabuf.c b/hw/display/virtio-gpu-udmabu= f.c index 3c01a415e7..33e329e8aa 100644 --- a/hw/display/virtio-gpu-udmabuf.c +++ b/hw/display/virtio-gpu-udmabuf.c @@ -185,6 +185,8 @@ static VGPUDMABuf dmabuf->buf.stride =3D fb->stride; dmabuf->buf.fourcc =3D qemu_pixman_to_drm_format(fb->format); dmabuf->buf.fd =3D res->dmabuf_fd; + dmabuf->buf.blob =3D true; + dmabuf->buf.sync =3D NULL; =20 dmabuf->scanout_id =3D scanout_id; QTAILQ_INSERT_HEAD(&g->dmabuf.bufs, dmabuf, next); diff --git a/include/ui/console.h b/include/ui/console.h index a89f739f10..310d34c67a 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -170,6 +170,7 @@ typedef struct QemuDmaBuf { bool y0_top; void *sync; int fence_fd; + bool blob; } QemuDmaBuf; =20 typedef struct DisplayState DisplayState; diff --git a/include/ui/egl-helpers.h b/include/ui/egl-helpers.h index 5a7575dc13..1bc0e31b03 100644 --- a/include/ui/egl-helpers.h +++ b/include/ui/egl-helpers.h @@ -19,6 +19,7 @@ typedef struct egl_fb { GLuint texture; GLuint framebuffer; bool delete_texture; + QemuDmaBuf *dmabuf; } egl_fb; =20 void egl_fb_destroy(egl_fb *fb); diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c index b671181272..b748f51b0b 100644 --- a/ui/gtk-egl.c +++ b/ui/gtk-egl.c @@ -209,6 +209,8 @@ void gd_egl_scanout_dmabuf(DisplayChangeListener *dcl, QemuDmaBuf *dmabuf) { #ifdef CONFIG_GBM + VirtualConsole *vc =3D container_of(dcl, VirtualConsole, gfx.dcl); + egl_dmabuf_import_texture(dmabuf); if (!dmabuf->texture) { return; @@ -217,6 +219,10 @@ void gd_egl_scanout_dmabuf(DisplayChangeListener *dcl, gd_egl_scanout_texture(dcl, dmabuf->texture, false, dmabuf->width, dmabuf->height, 0, 0, dmabuf->width, dmabuf->height); + + if (dmabuf->blob) { + vc->gfx.guest_fb.dmabuf =3D dmabuf; + } #endif } =20 @@ -281,6 +287,10 @@ void gd_egl_scanout_flush(DisplayChangeListener *dcl, egl_fb_blit(&vc->gfx.win_fb, &vc->gfx.guest_fb, !vc->gfx.y0_top); } =20 + if (vc->gfx.guest_fb.dmabuf) { + egl_dmabuf_create_sync(vc->gfx.guest_fb.dmabuf); + } + eglSwapBuffers(qemu_egl_display, vc->gfx.esurface); } =20 diff --git a/ui/gtk-gl-area.c b/ui/gtk-gl-area.c index dd5783fec7..94f3b87c42 100644 --- a/ui/gtk-gl-area.c +++ b/ui/gtk-gl-area.c @@ -71,6 +71,10 @@ void gd_gl_area_draw(VirtualConsole *vc) surface_gl_render_texture(vc->gfx.gls, vc->gfx.ds); } =20 + if (vc->gfx.guest_fb.dmabuf) { + egl_dmabuf_create_sync(vc->gfx.guest_fb.dmabuf); + } + glFlush(); graphic_hw_gl_flushed(vc->gfx.dcl.con); } @@ -231,6 +235,10 @@ void gd_gl_area_scanout_dmabuf(DisplayChangeListener *= dcl, gd_gl_area_scanout_texture(dcl, dmabuf->texture, false, dmabuf->width, dmabuf->height, 0, 0, dmabuf->width, dmabuf->height); + + if (dmabuf->blob) { + vc->gfx.guest_fb.dmabuf =3D dmabuf; + } #endif } =20 --=20 2.30.2 From nobody Tue May 21 09:31:29 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.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=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1623109191; cv=none; d=zohomail.com; s=zohoarc; b=ILjf1Ias8ksgR/KLdeiVaiJAYlDMUHRdrjf6JRbpv8J0FnSi/rvFCuwJu69AXZG3g+CFv3etsd/kS5PP+0bUIOFtcGY80YEAqwkd1lH/vOVyTvtLB4Md5GZXGNZuXNcgakpHB5USvkz+Av/V7len0TmMoq8SSxldOPm8BvxvIq4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623109191; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=StuWFobsXpW1fr8O4GtTztRomqi0p4FNs6VW0HyIqDI=; b=Jz8HWqh2F9s2FeoGpj8DjUNvZJr3fi3rwIiXBG15zPs3at9IUjobgovDIK1bpe5ZazKt4zUdthStmaCIfmkNH/ipDP21Vo6JQB8SuJNKtAXP0s/kt6q/t70bSitQ/+SH7iogZHHzIlHyJCY5U69B27v5hiuj2SHfLjQvA6WCMIY= ARC-Authentication-Results: i=1; mx.zohomail.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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1623109191333936.8519027180288; Mon, 7 Jun 2021 16:39:51 -0700 (PDT) Received: from localhost ([::1]:37490 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lqOqU-0003cO-AE for importer@patchew.org; Mon, 07 Jun 2021 19:39:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39040) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqOoy-0001bq-Rk for qemu-devel@nongnu.org; Mon, 07 Jun 2021 19:38:16 -0400 Received: from mga06.intel.com ([134.134.136.31]:2273) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqOow-00071e-R1 for qemu-devel@nongnu.org; Mon, 07 Jun 2021 19:38:16 -0400 Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2021 16:38:03 -0700 Received: from vkasired-desk2.fm.intel.com ([10.105.128.127]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2021 16:38:03 -0700 IronPort-SDR: LXuayxLVuqC+5EGJnn5hfGn8zYeH/FmPxOVu7CsMroEe7SMjq2RYPK86j5ApsGKiOBsWODmH6K DtZxMxK8UqSw== X-IronPort-AV: E=McAfee;i="6200,9189,10008"; a="265889552" X-IronPort-AV: E=Sophos;i="5.83,256,1616482800"; d="scan'208";a="265889552" IronPort-SDR: l/zINiWlQKZnIy7XNYBSXINVDPjE0kB8I2pyusHylyqARwZrLVHH3YEsJ65m1KPMsxloBwCoLu bvQWGJzEXxHg== X-IronPort-AV: E=Sophos;i="5.83,256,1616482800"; d="scan'208";a="551403362" From: Vivek Kasireddy To: qemu-devel@nongnu.org Subject: [PATCH v1 5/5] virtio-gpu: Make resource_flush wait on the sync object for blobs Date: Mon, 7 Jun 2021 16:25:30 -0700 Message-Id: <20210607232530.454435-6-vivek.kasireddy@intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210607232530.454435-1-vivek.kasireddy@intel.com> References: <20210607232530.454435-1-vivek.kasireddy@intel.com> MIME-Version: 1.0 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=134.134.136.31; envelope-from=vivek.kasireddy@intel.com; helo=mga06.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, 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: Dongwon Kim , Vivek Kasireddy , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" To make sure that the Guest would not use the backing storage associated with a blob resource before or at the same time when the Host does a blit with it, resource_flush needs to wait on the sync object associated with the blob. Doing this would prevent tearing/flickering or other issues when using blob resources. Cc: Gerd Hoffmann Signed-off-by: Vivek Kasireddy Signed-off-by: Dongwon Kim --- hw/display/virtio-gpu-udmabuf.c | 28 ++++++++++++++++++++++++++++ hw/display/virtio-gpu.c | 1 + include/hw/virtio/virtio-gpu.h | 2 ++ 3 files changed, 31 insertions(+) diff --git a/hw/display/virtio-gpu-udmabuf.c b/hw/display/virtio-gpu-udmabu= f.c index 33e329e8aa..8c1b6f8763 100644 --- a/hw/display/virtio-gpu-udmabuf.c +++ b/hw/display/virtio-gpu-udmabuf.c @@ -167,6 +167,34 @@ static void virtio_gpu_free_dmabuf(VirtIOGPU *g, VGPUD= MABuf *dmabuf) g_free(dmabuf); } =20 +static VGPUDMABuf +*virtio_gpu_find_dmabuf(VirtIOGPU *g, + struct virtio_gpu_simple_resource *res) +{ + VGPUDMABuf *dmabuf, *tmp; + + QTAILQ_FOREACH_SAFE(dmabuf, &g->dmabuf.bufs, next, tmp) { + if (dmabuf->buf.fd =3D=3D res->dmabuf_fd) { + return dmabuf; + } + } + + return NULL; +} + +void virtio_gpu_resource_wait_sync(VirtIOGPU *g, + struct virtio_gpu_simple_resource *res) +{ + struct virtio_gpu_scanout *scanout; + VGPUDMABuf *dmabuf; + + dmabuf =3D virtio_gpu_find_dmabuf(g, res); + if (dmabuf && dmabuf->buf.sync) { + scanout =3D &g->parent_obj.scanout[dmabuf->scanout_id]; + dpy_gl_wait_dmabuf(scanout->con, &dmabuf->buf); + } +} + static VGPUDMABuf *virtio_gpu_create_dmabuf(VirtIOGPU *g, uint32_t scanout_id, diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index 4d549377cb..dd037137e9 100644 --- a/hw/display/virtio-gpu.c +++ b/hw/display/virtio-gpu.c @@ -523,6 +523,7 @@ static void virtio_gpu_resource_flush(VirtIOGPU *g, console_has_gl(scanout->con)) { dpy_gl_update(scanout->con, 0, 0, scanout->width, scanout->height); + virtio_gpu_resource_wait_sync(g, res); return; } } diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h index bcf54d970f..9b9b499d06 100644 --- a/include/hw/virtio/virtio-gpu.h +++ b/include/hw/virtio/virtio-gpu.h @@ -274,6 +274,8 @@ int virtio_gpu_update_dmabuf(VirtIOGPU *g, uint32_t scanout_id, struct virtio_gpu_simple_resource *res, struct virtio_gpu_framebuffer *fb); +void virtio_gpu_resource_wait_sync(VirtIOGPU *g, + struct virtio_gpu_simple_resource *res); =20 /* virtio-gpu-3d.c */ void virtio_gpu_virgl_process_cmd(VirtIOGPU *g, --=20 2.30.2