From nobody Thu Oct 30 23:54:56 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=dmitry.osipenko@collabora.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; arc=pass (i=1 dmarc=pass fromdomain=collabora.com); dmarc=pass(p=none dis=none) header.from=collabora.com ARC-Seal: i=2; a=rsa-sha256; t=1761003847; cv=pass; d=zohomail.com; s=zohoarc; b=MjdideER+kBs16jmfDqxsW+LIUech1IduYYdUe6hH2dNbGh9245gHVlIU7N5VSPQX2BOcPZJUjWEMBzryE8uE1UG4wYbnvOAeujo5I9srNkCo1RpyxqqzQBxPi9Q7M9Dpv8n7n+tQanrQZOlRJKR/Nn797K39+29gziVFU1UvUQ= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761003847; 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=on4vlMSvDhEJccSInIPOWHvZ775yjbxzLPtiY6rJOgQ=; b=GiJYoOq4wfh3RCMd6S0FaAYIwgCILYgs7mEAUw584lRVMjMA+6wSya0p7/fawrVmkFBWHhVofyPiCGiDXobUzktgIcMA1nj8j1k3pqzxAsOcfZhKFly4l8N9UPtjULmadX+BsssCumNbwbVH4zZ7HR/Pgdi47/iPmJryNOD1e4Q= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass header.i=dmitry.osipenko@collabora.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; arc=pass (i=1 dmarc=pass fromdomain=collabora.com); 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 1761003847815684.9595030181134; Mon, 20 Oct 2025 16:44:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vAzWR-000326-Gz; Mon, 20 Oct 2025 19:42:39 -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 1vAzWQ-00031j-Em for qemu-devel@nongnu.org; Mon, 20 Oct 2025 19:42:38 -0400 Received: from sender4-op-o15.zoho.com ([136.143.188.15]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vAzWO-0001wB-L1 for qemu-devel@nongnu.org; Mon, 20 Oct 2025 19:42:38 -0400 Received: by mx.zohomail.com with SMTPS id 1761003739594521.5681875222734; Mon, 20 Oct 2025 16:42:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1761003742; cv=none; d=zohomail.com; s=zohoarc; b=YuJNQ5dOQBibFQWWsO4XRk7EiFW7CJTbyit8+w8/Bw65A7NTAVaF5chwi1NaSx8AZ/GQ2Gpl6C52cUuIDY7M+ZEZk7QX7n/wP83qvKsZwKwMcCxc6Qo8H4aei2IsA7S1QnJ3TQ8bMi0XaYoTtI667Zsd2i/E+VrAXBfL1Bf4MX4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761003742; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=on4vlMSvDhEJccSInIPOWHvZ775yjbxzLPtiY6rJOgQ=; b=WmhMcnln6C/n5hJ239+dbcsKqFy+WvNMkQvoC7gPdEdQWgGn8fBwBNxIEBikcV3Sq3rBxGytRn+7ROechULZC+xfR6wOyQmhf5PUAIjpa8/+bxj867UFpokAkXy8SCgnqwUSQReHJ1YZtG4IDtoYWwTiax5gj926YL2bVuIlgjQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=dmitry.osipenko@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1761003742; s=zohomail; d=collabora.com; i=dmitry.osipenko@collabora.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:In-Reply-To:References:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=on4vlMSvDhEJccSInIPOWHvZ775yjbxzLPtiY6rJOgQ=; b=LO7GICT3DAV09P0tVmASFbuEvxKDMWPVszh5oFIboKdP6QRf2bnHStjnYB+Gk8IV Df8wCKDobHQX7jB6/t3q6BvOjzqRz7T1FMcQocYhIVRqhLSGur7dNCI3h5QHoXgfgy4 SMNGZ+cbN9RPTCEjaSZ4wnjkFEvbLxrqKLLozfZM= From: Dmitry Osipenko To: Akihiko Odaki , Huang Rui , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierre-Eric Pelloux-Prayer , "Michael S . Tsirkin" , Paolo Bonzini Cc: Gert Wollny , qemu-devel@nongnu.org, Gurchetan Singh , Alyssa Ross , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Alex Deucher , Stefano Stabellini , =?UTF-8?q?Christian=20K=C3=B6nig?= , Xenia Ragiadakou , Honglei Huang , Julia Zhang , Chen Jiqian , Rob Clark , Yiwei Zhang , Sergio Lopez Pascual Subject: [PATCH v14 01/10] ui/sdl2: Restore original context after new context creation Date: Tue, 21 Oct 2025 02:39:40 +0300 Message-ID: <20251020233949.506088-2-dmitry.osipenko@collabora.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251020233949.506088-1-dmitry.osipenko@collabora.com> References: <20251020233949.506088-1-dmitry.osipenko@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External 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=136.143.188.15; envelope-from=dmitry.osipenko@collabora.com; helo=sender4-op-o15.zoho.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, 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_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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 dmitry.osipenko@collabora.com) X-ZM-MESSAGEID: 1761003851599158500 SDL API changes GL context to a newly created GL context, which differs from other GL providers that don't switch context. Change SDL backend to restore the original GL context. This allows Qemu's virtio-gpu to support new virglrenderer async-fencing feature for Virgl contexts, otherwise virglrenderer's vrend creates a fence-sync context on the Qemu's main-loop thread that erroneously stays in-use by the main-loop after creation, not allowing vrend's fence-sync thread switch to this new context that belongs to it. Reviewed-by: Akihiko Odaki Acked-by: Michael S. Tsirkin Tested-by: Alex Benn=C3=A9e Signed-off-by: Dmitry Osipenko --- ui/sdl2-gl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/sdl2-gl.c b/ui/sdl2-gl.c index 3be17d1079af..ea2301305d3e 100644 --- a/ui/sdl2-gl.c +++ b/ui/sdl2-gl.c @@ -168,6 +168,9 @@ QEMUGLContext sdl2_gl_create_context(DisplayGLCtx *dgc, SDL_GL_CONTEXT_PROFILE_ES); ctx =3D SDL_GL_CreateContext(scon->real_window); } + + SDL_GL_MakeCurrent(scon->real_window, scon->winctx); + return (QEMUGLContext)ctx; } =20 --=20 2.51.0 From nobody Thu Oct 30 23:54:56 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=dmitry.osipenko@collabora.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; arc=pass (i=1 dmarc=pass fromdomain=collabora.com); dmarc=pass(p=none dis=none) header.from=collabora.com ARC-Seal: i=2; a=rsa-sha256; t=1761003841; cv=pass; d=zohomail.com; s=zohoarc; b=FLyf+nbGFnBpTiJqBkrLq36JDwUotPK6W52GNxdz9Y9eJ4zQYqjUsRLH+OhsnUd3wuRSdtZ61XuhbzE16tKrjUpify23vGZXk2pzvDxlwl0/qFX2taFToUQJI2x612VsyzBSxqWCa9I/UA0Ga90uRmiKTRYlw/NnrwjV1Im4tZs= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761003841; 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=wVVMTkt9llR6fCFHgrYP8cd6rLY2hVNy2pGOsbwb43g=; b=NehbaApcdlUitgX5RjT6L3adJLx/s51/PCn511uPhCCv8CeMONDtz6xCM5GumrqylCsQYMJRJjUcLYT2ugrppYwvX7jhMDljCHUQ6GcIKoNMreSSnMxAJ5jtrVmfsQC4t3ip54IQdOYnppwChVlgL4lRFvaLJiuxA5nTg/mB1b4= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass header.i=dmitry.osipenko@collabora.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; arc=pass (i=1 dmarc=pass fromdomain=collabora.com); 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 1761003841450376.0829317879128; Mon, 20 Oct 2025 16:44:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vAzWm-0003MH-EI; Mon, 20 Oct 2025 19:43:02 -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 1vAzWa-00037d-95 for qemu-devel@nongnu.org; Mon, 20 Oct 2025 19:42:49 -0400 Received: from sender4-op-o15.zoho.com ([136.143.188.15]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vAzWW-0001ww-Vo for qemu-devel@nongnu.org; Mon, 20 Oct 2025 19:42:47 -0400 Received: by mx.zohomail.com with SMTPS id 1761003745534687.4443599065435; Mon, 20 Oct 2025 16:42:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1761003748; cv=none; d=zohomail.com; s=zohoarc; b=RwdXCp01Oy+g5EDvsexLJkWMUEu2JT+n0UYUZxNty4G3Y53fY0Ub1fAflA1nAjyPxSnI94d7ab32GHTYI3KtsoNrOzvW/rHTiUpI1sM8hmw9esh/Vj7+rWfMiXp6o4lhIVG1lvrey3hO4eytaW4TLQ49nZihJN8sNfNV0wEGPDQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761003748; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=wVVMTkt9llR6fCFHgrYP8cd6rLY2hVNy2pGOsbwb43g=; b=KujJg5rngSYCy5bCCyVDcNl55ebjwmczz2ALt3odbvwlSZv0gVPOPEK8z+mem193SmiPLDbPjOBUiLwoNvQNLyG/SNOHeckZp0lgm4/zQoxe9Z/de0r/7Nu/uczgslYkNtfC5N/s2QZa/KcC7Qge+qA0xGuVAHONmiI8vV7ILRk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=dmitry.osipenko@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1761003748; s=zohomail; d=collabora.com; i=dmitry.osipenko@collabora.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:In-Reply-To:References:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=wVVMTkt9llR6fCFHgrYP8cd6rLY2hVNy2pGOsbwb43g=; b=GX+hdd/JFEkCgHvlmtbCv1ChaYRHEkrrsLX4qp2HwBOO6/ng+z2DD8Ws8pix+WOE rnSiqVZCAF1ZcFBXQs4JMk9riuvxCW1pdmAKohCtZMPZgi7dFeDkCn9FDXYhJv4QBh8 JP3GqJRlBK12cMBiym/luYi1wUO5a5/bUgG3WnIs= From: Dmitry Osipenko To: Akihiko Odaki , Huang Rui , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierre-Eric Pelloux-Prayer , "Michael S . Tsirkin" , Paolo Bonzini Cc: Gert Wollny , qemu-devel@nongnu.org, Gurchetan Singh , Alyssa Ross , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Alex Deucher , Stefano Stabellini , =?UTF-8?q?Christian=20K=C3=B6nig?= , Xenia Ragiadakou , Honglei Huang , Julia Zhang , Chen Jiqian , Rob Clark , Yiwei Zhang , Sergio Lopez Pascual Subject: [PATCH v14 02/10] ui/sdl2: Implement dpy dmabuf functions Date: Tue, 21 Oct 2025 02:39:41 +0300 Message-ID: <20251020233949.506088-3-dmitry.osipenko@collabora.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251020233949.506088-1-dmitry.osipenko@collabora.com> References: <20251020233949.506088-1-dmitry.osipenko@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External 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=136.143.188.15; envelope-from=dmitry.osipenko@collabora.com; helo=sender4-op-o15.zoho.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, 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_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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 dmitry.osipenko@collabora.com) X-ZM-MESSAGEID: 1761003842691154100 From: Pierre-Eric Pelloux-Prayer If EGL is used, we can rely on dmabuf to import textures without doing copies. To get this working on X11, we use the existing SDL hint: SDL_HINT_VIDEO_X11_FORCE_EGL (because dmabuf can't be used with GLX). Reviewed-by: Akihiko Odaki Acked-by: Michael S. Tsirkin Tested-by: Alex Benn=C3=A9e Signed-off-by: Pierre-Eric Pelloux-Prayer Signed-off-by: Dmitry Osipenko --- include/ui/sdl2.h | 7 +++++ meson.build | 6 ++--- ui/sdl2-gl.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++ ui/sdl2.c | 42 ++++++++++++++++++++++++++++++ 4 files changed, 117 insertions(+), 4 deletions(-) diff --git a/include/ui/sdl2.h b/include/ui/sdl2.h index dbe6e3d9739b..9daf5ecffae7 100644 --- a/include/ui/sdl2.h +++ b/include/ui/sdl2.h @@ -45,6 +45,7 @@ struct sdl2_console { bool gui_keysym; SDL_GLContext winctx; QKbdState *kbd; + bool has_dmabuf; #ifdef CONFIG_OPENGL QemuGLShader *gls; egl_fb guest_fb; @@ -96,5 +97,11 @@ void sdl2_gl_scanout_texture(DisplayChangeListener *dcl, void *d3d_tex2d); void sdl2_gl_scanout_flush(DisplayChangeListener *dcl, uint32_t x, uint32_t y, uint32_t w, uint32_t h); +void sdl2_gl_scanout_dmabuf(DisplayChangeListener *dcl, + QemuDmaBuf *dmabuf); +void sdl2_gl_release_dmabuf(DisplayChangeListener *dcl, + QemuDmaBuf *dmabuf); +bool sdl2_gl_has_dmabuf(DisplayChangeListener *dcl); +void sdl2_gl_console_init(struct sdl2_console *scon); =20 #endif /* SDL2_H */ diff --git a/meson.build b/meson.build index c5710a6a47c2..e96c28da09b6 100644 --- a/meson.build +++ b/meson.build @@ -2019,10 +2019,8 @@ if get_option('gtk') \ endif endif =20 -x11 =3D not_found -if gtkx11.found() - x11 =3D dependency('x11', method: 'pkg-config', required: gtkx11.found()) -endif +x11 =3D dependency('x11', method: 'pkg-config', required: gtkx11.found()) + png =3D not_found if get_option('png').allowed() and have_system png =3D dependency('libpng', version: '>=3D1.6.34', required: get_optio= n('png'), diff --git a/ui/sdl2-gl.c b/ui/sdl2-gl.c index ea2301305d3e..4906f6875046 100644 --- a/ui/sdl2-gl.c +++ b/ui/sdl2-gl.c @@ -26,6 +26,8 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/main-loop.h" +#include "qemu/error-report.h" #include "ui/console.h" #include "ui/input.h" #include "ui/sdl2.h" @@ -249,3 +251,67 @@ void sdl2_gl_scanout_flush(DisplayChangeListener *dcl, =20 SDL_GL_SwapWindow(scon->real_window); } + +void sdl2_gl_scanout_dmabuf(DisplayChangeListener *dcl, + QemuDmaBuf *dmabuf) +{ + struct sdl2_console *scon =3D container_of(dcl, struct sdl2_console, d= cl); + const int *fds; + + assert(scon->opengl); + SDL_GL_MakeCurrent(scon->real_window, scon->winctx); + + egl_dmabuf_import_texture(dmabuf); + if (!qemu_dmabuf_get_texture(dmabuf)) { + fds =3D qemu_dmabuf_get_fds(dmabuf, NULL); + error_report("%s: failed fd=3D%d", __func__, fds ? fds[0] : -1); + return; + } + + sdl2_gl_scanout_texture(dcl, qemu_dmabuf_get_texture(dmabuf), false, + qemu_dmabuf_get_width(dmabuf), + qemu_dmabuf_get_height(dmabuf), + 0, 0, + qemu_dmabuf_get_width(dmabuf), + qemu_dmabuf_get_height(dmabuf), + NULL); + + if (qemu_dmabuf_get_allow_fences(dmabuf)) { + scon->guest_fb.dmabuf =3D dmabuf; + } +} + +void sdl2_gl_release_dmabuf(DisplayChangeListener *dcl, + QemuDmaBuf *dmabuf) +{ + egl_dmabuf_release_texture(dmabuf); +} + +bool sdl2_gl_has_dmabuf(DisplayChangeListener *dcl) +{ + struct sdl2_console *scon =3D container_of(dcl, struct sdl2_console, d= cl); + + return scon->has_dmabuf; +} + +void sdl2_gl_console_init(struct sdl2_console *scon) +{ + bool hidden =3D scon->hidden; + + scon->hidden =3D true; + scon->surface =3D qemu_create_displaysurface(1, 1); + sdl2_window_create(scon); + + /* + * QEMU checks whether console supports dma-buf before switching + * to the console. To break this chicken-egg problem we pre-check + * dma-buf availability beforehand using a dummy SDL window. + */ + scon->has_dmabuf =3D qemu_egl_has_dmabuf(); + + sdl2_window_destroy(scon); + qemu_free_displaysurface(scon->surface); + + scon->surface =3D NULL; + scon->hidden =3D hidden; +} diff --git a/ui/sdl2.c b/ui/sdl2.c index 032dc14bc398..3bb2676f847b 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -35,6 +35,10 @@ #include "qemu/log.h" #include "qemu-main.h" =20 +#ifdef CONFIG_X11 +#include +#endif + static int sdl2_num_outputs; static struct sdl2_console *sdl2_console; =20 @@ -120,6 +124,9 @@ void sdl2_window_create(struct sdl2_console *scon) /* The SDL renderer is only used by sdl2-2D, when OpenGL is disabl= ed */ scon->real_renderer =3D SDL_CreateRenderer(scon->real_window, -1, = 0); } + + qemu_egl_display =3D eglGetCurrentDisplay(); + sdl_update_caption(scon); } =20 @@ -808,6 +815,10 @@ static const DisplayChangeListenerOps dcl_gl_ops =3D { .dpy_gl_scanout_disable =3D sdl2_gl_scanout_disable, .dpy_gl_scanout_texture =3D sdl2_gl_scanout_texture, .dpy_gl_update =3D sdl2_gl_scanout_flush, + + .dpy_gl_scanout_dmabuf =3D sdl2_gl_scanout_dmabuf, + .dpy_gl_release_dmabuf =3D sdl2_gl_release_dmabuf, + .dpy_has_dmabuf =3D sdl2_gl_has_dmabuf, }; =20 static bool @@ -835,6 +846,35 @@ static void sdl2_display_early_init(DisplayOptions *o) } } =20 +static void sdl2_set_hint_x11_force_egl(void) +{ +#if defined(SDL_HINT_VIDEO_X11_FORCE_EGL) && defined(CONFIG_OPENGL) && \ + defined(CONFIG_X11) + Display *x_disp =3D XOpenDisplay(NULL); + EGLDisplay egl_display; + + if (!x_disp) { + return; + } + + /* Prefer EGL over GLX to get dma-buf support. */ + egl_display =3D eglGetDisplay((EGLNativeDisplayType)x_disp); + + if (egl_display !=3D EGL_NO_DISPLAY) { + /* + * Setting X11_FORCE_EGL hint doesn't make SDL to prefer X11 over + * Wayland. SDL will use Wayland driver even if XWayland presents. + * It's always safe to set the hint even if X11 is not used by SDL. + * SDL will work regardless of the hint. + */ + SDL_SetHint(SDL_HINT_VIDEO_X11_FORCE_EGL, "1"); + eglTerminate(egl_display); + } + + XCloseDisplay(x_disp); +#endif +} + static void sdl2_display_init(DisplayState *ds, DisplayOptions *o) { uint8_t data =3D 0; @@ -862,6 +902,7 @@ static void sdl2_display_init(DisplayState *ds, Display= Options *o) SDL_SetHint(SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED, "0"); #endif SDL_SetHint(SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4, "1"); + sdl2_set_hint_x11_force_egl(); SDL_EnableScreenSaver(); memset(&info, 0, sizeof(info)); SDL_VERSION(&info.version); @@ -908,6 +949,7 @@ static void sdl2_display_init(DisplayState *ds, Display= Options *o) sdl2_console[i].kbd =3D qkbd_state_init(con); if (display_opengl) { qemu_console_set_display_gl_ctx(con, &sdl2_console[i].dgc); + sdl2_gl_console_init(&sdl2_console[i]); } register_displaychangelistener(&sdl2_console[i].dcl); =20 --=20 2.51.0 From nobody Thu Oct 30 23:54:56 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=dmitry.osipenko@collabora.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; arc=pass (i=1 dmarc=pass fromdomain=collabora.com); dmarc=pass(p=none dis=none) header.from=collabora.com ARC-Seal: i=2; a=rsa-sha256; t=1761003788; cv=pass; d=zohomail.com; s=zohoarc; b=dZPGijibDbelfJ6Gk/HVJR1UuN4PBtvKDSXt6Ua+sqf0CoRWgxeEPttL0vHMUwUjRdRoXo0Sbbh11mgWaMvuG48HongZpZEV8RWHXXW6FrxYgBcsq3dC6dyowTGYuLbJoK0yUuQEGv4GhRK199ZZuNFGe0Fg10e0R5TSWLbwdz0= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761003788; 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=1vnXoumb5Cu4fx3WBEBaRML7/dsVe7+Sa9Z1XGhzax0=; b=oGsViT4KackPJFuBKK7cgs//itboHRvTLgiTJT/xmIeNKQwhJMEIL6RI66dMYytGsHO1PslCjPJpaH+nsFp2Zn+x6lpGEo2wnJyNVDY1J+U6xAUKNbx7qp4MXwL7w4hHTVLEzyxWdklkrNYQ6GqfHTEZsyY8rJofY4fXWWvtGIw= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass header.i=dmitry.osipenko@collabora.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; arc=pass (i=1 dmarc=pass fromdomain=collabora.com); 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 17610037883691018.5111748107772; Mon, 20 Oct 2025 16:43:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vAzWj-0003JS-Ry; Mon, 20 Oct 2025 19:43:00 -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 1vAzWa-00037f-9d for qemu-devel@nongnu.org; Mon, 20 Oct 2025 19:42:49 -0400 Received: from sender4-op-o15.zoho.com ([136.143.188.15]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vAzWY-0001x0-7f for qemu-devel@nongnu.org; Mon, 20 Oct 2025 19:42:47 -0400 Received: by mx.zohomail.com with SMTPS id 1761003751576308.51367258590744; Mon, 20 Oct 2025 16:42:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1761003754; cv=none; d=zohomail.com; s=zohoarc; b=T77Tv7fE5Y7hN31+IBvr714/NrinmH7uNh+cTbq59Vj1mRyybP+x7pl7YDWSl0Jv4K5fpdUvb+GFo1C1ctSiP6MDDWnddK62j2hqKPhLj3FgmtRhDIa4YnCh+/tYmCT02HJm1NAeUDwkuxnaLGQVHoiS+eZfrJoiqvrgnMCszgQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761003754; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=1vnXoumb5Cu4fx3WBEBaRML7/dsVe7+Sa9Z1XGhzax0=; b=mLa/GMyUqejJ3p3HZbBw0a4gB79L7s6INCmy1hUxJ9FE0pTlFk22KfxV/q+wxtAsfazLHRYQbdN2LpyqP4JaJJ0bO6GFd/l3iUXRFNGi2zkGds5jiTGOHoHWrrAsaHv1M1DWvyYtaVjze8HjtLCUsQSeOUmMZ6Q1MFOF9D9+Wc8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=dmitry.osipenko@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1761003754; s=zohomail; d=collabora.com; i=dmitry.osipenko@collabora.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:In-Reply-To:References:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=1vnXoumb5Cu4fx3WBEBaRML7/dsVe7+Sa9Z1XGhzax0=; b=K9s0qGiHQ/Igoq4w29UDec/HPx4ti7jdIg2NUzD1SlccW/56royaEODmkBB9enCU txrzXU3T/kqf14w8/7UtJypwKT53LHHMQBrGcsnGxeQvSVCyIZlRNyj0LcDqLBaDSUs noPId0zcUtybVtO7Y/3ak2BksMPugtSw3eLmRsW4= From: Dmitry Osipenko To: Akihiko Odaki , Huang Rui , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierre-Eric Pelloux-Prayer , "Michael S . Tsirkin" , Paolo Bonzini Cc: Gert Wollny , qemu-devel@nongnu.org, Gurchetan Singh , Alyssa Ross , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Alex Deucher , Stefano Stabellini , =?UTF-8?q?Christian=20K=C3=B6nig?= , Xenia Ragiadakou , Honglei Huang , Julia Zhang , Chen Jiqian , Rob Clark , Yiwei Zhang , Sergio Lopez Pascual Subject: [PATCH v14 03/10] virtio-gpu: Handle virgl fence creation errors Date: Tue, 21 Oct 2025 02:39:42 +0300 Message-ID: <20251020233949.506088-4-dmitry.osipenko@collabora.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251020233949.506088-1-dmitry.osipenko@collabora.com> References: <20251020233949.506088-1-dmitry.osipenko@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External 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=136.143.188.15; envelope-from=dmitry.osipenko@collabora.com; helo=sender4-op-o15.zoho.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, 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_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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 dmitry.osipenko@collabora.com) X-ZM-MESSAGEID: 1761003788825158500 Print out error messages when virgl fence creation fails to aid debugging of the fence-related bugs. Reviewed-by: Akihiko Odaki Acked-by: Michael S. Tsirkin Tested-by: Alex Benn=C3=A9e Signed-off-by: Dmitry Osipenko --- hw/display/virtio-gpu-virgl.c | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/hw/display/virtio-gpu-virgl.c b/hw/display/virtio-gpu-virgl.c index 94ddc01f91c6..cd8b367f6fa6 100644 --- a/hw/display/virtio-gpu-virgl.c +++ b/hw/display/virtio-gpu-virgl.c @@ -872,6 +872,7 @@ void virtio_gpu_virgl_process_cmd(VirtIOGPU *g, struct virtio_gpu_ctrl_command *cmd) { bool cmd_suspended =3D false; + int ret; =20 VIRTIO_GPU_FILL_CMD(cmd->cmd_hdr); =20 @@ -972,14 +973,30 @@ void virtio_gpu_virgl_process_cmd(VirtIOGPU *g, trace_virtio_gpu_fence_ctrl(cmd->cmd_hdr.fence_id, cmd->cmd_hdr.type); #if VIRGL_VERSION_MAJOR >=3D 1 if (cmd->cmd_hdr.flags & VIRTIO_GPU_FLAG_INFO_RING_IDX) { - virgl_renderer_context_create_fence(cmd->cmd_hdr.ctx_id, - VIRGL_RENDERER_FENCE_FLAG_MERG= EABLE, - cmd->cmd_hdr.ring_idx, - cmd->cmd_hdr.fence_id); + uint32_t flags =3D VIRGL_RENDERER_FENCE_FLAG_MERGEABLE; + + ret =3D virgl_renderer_context_create_fence(cmd->cmd_hdr.ctx_id, f= lags, + cmd->cmd_hdr.ring_idx, + cmd->cmd_hdr.fence_id); + if (ret) { + qemu_log_mask(LOG_GUEST_ERROR, + "%s: virgl_renderer_context_create_fence error: = %s", + __func__, strerror(-ret)); + } return; } #endif - virgl_renderer_create_fence(cmd->cmd_hdr.fence_id, cmd->cmd_hdr.type); + + /* + * Unlike other virglrenderer functions, this one returns a positive + * error code. + */ + ret =3D virgl_renderer_create_fence(cmd->cmd_hdr.fence_id, 0); + if (ret) { + qemu_log_mask(LOG_GUEST_ERROR, + "%s: virgl_renderer_create_fence error: %s", + __func__, strerror(ret)); + } } =20 static void virgl_write_fence(void *opaque, uint32_t fence) --=20 2.51.0 From nobody Thu Oct 30 23:54:56 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=dmitry.osipenko@collabora.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; arc=pass (i=1 dmarc=pass fromdomain=collabora.com); dmarc=pass(p=none dis=none) header.from=collabora.com ARC-Seal: i=2; a=rsa-sha256; t=1761003827; cv=pass; d=zohomail.com; s=zohoarc; b=dXZIeGdwKgnuGEdPVQ3GtrTyk/6gLUdAhOoZlctal00b74iirZFBvQIHnI2SFro1JWuZzFEU8guVpupUzWwCNqo9GDfJH/9Lq+v187/TKwSmhdV4doucka4A98VxnjzKWLu/WBiow8bj3JH7Q9PIUnGB7leT3kgeGNh553EieN8= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761003827; 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=oXh5SD/PBs7zdjL6SEH5uwXnrkEpsC5Tbeu37YgRFAc=; b=EnKMdz7lRZhFTGKz598nvdskvwNRR2yXiLGsBsHTa28YajWoJ65wN1r0ZwwIKcHnn8hvaH92Lbek8AEXGLQM26Si9U3X3jGGuSWdBHe26mKrmnwWdPblJhAkwBkkZTUMbDV3xsuF2+iuCXE4BKwV4Qydz/gOqdjlaY9d1QU+OkE= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass header.i=dmitry.osipenko@collabora.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; arc=pass (i=1 dmarc=pass fromdomain=collabora.com); 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 176100382721377.15971355058593; Mon, 20 Oct 2025 16:43:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vAzWt-0003Ue-Af; Mon, 20 Oct 2025 19:43:07 -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 1vAzWf-0003By-S8 for qemu-devel@nongnu.org; Mon, 20 Oct 2025 19:42:53 -0400 Received: from sender4-op-o15.zoho.com ([136.143.188.15]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vAzWc-0001xR-NG for qemu-devel@nongnu.org; Mon, 20 Oct 2025 19:42:53 -0400 Received: by mx.zohomail.com with SMTPS id 1761003757515171.67532729041807; Mon, 20 Oct 2025 16:42:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1761003760; cv=none; d=zohomail.com; s=zohoarc; b=OjLkzx/ueI7sIj64kKzIEnEHuDtjDhcEvFHUPSS1w/GYbCwrTqUjnMMQJfPqsY7T5dCKFur/H8c86+pfAbncC9rSHSlSUnZiesGLB6o0foeE1ezgbS61HFxM0bJe1AeyVbr3SKO/VXYjx0feI2d36Oz3QzTR15wSxBkNbTvdUjU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761003760; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=oXh5SD/PBs7zdjL6SEH5uwXnrkEpsC5Tbeu37YgRFAc=; b=k1wOUcshdpKpsxNNLxQL8G3BWnCXOOiJQCmrVZtVIS2Rn/32aW2zD7zWzykrJzvZn9pJwWZj0xDSNFEfhKM5J2fOj+M9n3+lxgDFGbMsWXiFKDe21bOS1A8kZnX2g0a0zAsYCCsqeEv2kHnthM3Liypbk9vA6chMRy0lY76tY28= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=dmitry.osipenko@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1761003760; s=zohomail; d=collabora.com; i=dmitry.osipenko@collabora.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:In-Reply-To:References:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=oXh5SD/PBs7zdjL6SEH5uwXnrkEpsC5Tbeu37YgRFAc=; b=ErmaAgfKJG8S6Ck4VCw1y2w+WgARYR4ukArzYsYUP+q6+95neC+yz70o+FZO1oHs oFD3OReBmmUCIm4O/JjS4ytIqvq2R9y/z5XkbhKs1b59mPNwDH1o2IgSBOSYPcd3VM4 pIP7u7anQrWvDVMHesEpOJiMx0CGtEtb8szcgJSA= From: Dmitry Osipenko To: Akihiko Odaki , Huang Rui , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierre-Eric Pelloux-Prayer , "Michael S . Tsirkin" , Paolo Bonzini Cc: Gert Wollny , qemu-devel@nongnu.org, Gurchetan Singh , Alyssa Ross , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Alex Deucher , Stefano Stabellini , =?UTF-8?q?Christian=20K=C3=B6nig?= , Xenia Ragiadakou , Honglei Huang , Julia Zhang , Chen Jiqian , Rob Clark , Yiwei Zhang , Sergio Lopez Pascual Subject: [PATCH v14 04/10] virtio-gpu: Support asynchronous fencing Date: Tue, 21 Oct 2025 02:39:43 +0300 Message-ID: <20251020233949.506088-5-dmitry.osipenko@collabora.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251020233949.506088-1-dmitry.osipenko@collabora.com> References: <20251020233949.506088-1-dmitry.osipenko@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External 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=136.143.188.15; envelope-from=dmitry.osipenko@collabora.com; helo=sender4-op-o15.zoho.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, 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_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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 dmitry.osipenko@collabora.com) X-ZM-MESSAGEID: 1761003828592154100 Support asynchronous fencing feature of virglrenderer. It allows Qemu to handle fence as soon as it's signalled instead of periodically polling the fence status. This feature is required for enabling DRM context support in Qemu because legacy fencing mode isn't supported for DRM contexts in virglrenderer. Reviewed-by: Akihiko Odaki Acked-by: Michael S. Tsirkin Tested-by: Alex Benn=C3=A9e Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Dmitry Osipenko --- hw/display/virtio-gpu-gl.c | 5 ++ hw/display/virtio-gpu-virgl.c | 130 +++++++++++++++++++++++++++++++++ include/hw/virtio/virtio-gpu.h | 11 +++ meson.build | 2 + 4 files changed, 148 insertions(+) diff --git a/hw/display/virtio-gpu-gl.c b/hw/display/virtio-gpu-gl.c index c06a078fb36a..1468c6ed1467 100644 --- a/hw/display/virtio-gpu-gl.c +++ b/hw/display/virtio-gpu-gl.c @@ -169,6 +169,11 @@ static void virtio_gpu_gl_device_unrealize(DeviceState= *qdev) if (gl->renderer_state >=3D RS_INITED) { #if VIRGL_VERSION_MAJOR >=3D 1 qemu_bh_delete(gl->cmdq_resume_bh); + + if (gl->async_fence_bh) { + virtio_gpu_virgl_reset_async_fences(g); + qemu_bh_delete(gl->async_fence_bh); + } #endif if (virtio_gpu_stats_enabled(g->parent_obj.conf)) { timer_free(gl->print_stats); diff --git a/hw/display/virtio-gpu-virgl.c b/hw/display/virtio-gpu-virgl.c index cd8b367f6fa6..0320d6deca76 100644 --- a/hw/display/virtio-gpu-virgl.c +++ b/hw/display/virtio-gpu-virgl.c @@ -24,6 +24,23 @@ =20 #include =20 +/* + * VIRGL_CHECK_VERSION available since libvirglrenderer 1.0.1 and was fixed + * in 1.1.0. Undefine bugged version of the macro and provide our own. + */ +#if defined(VIRGL_CHECK_VERSION) && \ + VIRGL_VERSION_MAJOR =3D=3D 1 && VIRGL_VERSION_MINOR < 1 +#undef VIRGL_CHECK_VERSION +#endif + +#ifndef VIRGL_CHECK_VERSION +#define VIRGL_CHECK_VERSION(major, minor, micro) \ + (VIRGL_VERSION_MAJOR > (major) || \ + VIRGL_VERSION_MAJOR =3D=3D (major) && VIRGL_VERSION_MINOR > (minor) |= | \ + VIRGL_VERSION_MAJOR =3D=3D (major) && VIRGL_VERSION_MINOR =3D=3D (min= or) && \ + VIRGL_VERSION_MICRO >=3D (micro)) +#endif + struct virtio_gpu_virgl_resource { struct virtio_gpu_simple_resource base; MemoryRegion *mr; @@ -1051,6 +1068,106 @@ static void virgl_write_context_fence(void *opaque,= uint32_t ctx_id, } #endif =20 +void virtio_gpu_virgl_reset_async_fences(VirtIOGPU *g) +{ + struct virtio_gpu_virgl_context_fence *f; + VirtIOGPUGL *gl =3D VIRTIO_GPU_GL(g); + + while (!QSLIST_EMPTY(&gl->async_fenceq)) { + f =3D QSLIST_FIRST(&gl->async_fenceq); + + QSLIST_REMOVE_HEAD(&gl->async_fenceq, next); + + g_free(f); + } +} + +#if VIRGL_CHECK_VERSION(1, 1, 2) +static void virtio_gpu_virgl_async_fence_bh(void *opaque) +{ + QSLIST_HEAD(, virtio_gpu_virgl_context_fence) async_fenceq; + struct virtio_gpu_ctrl_command *cmd, *tmp; + struct virtio_gpu_virgl_context_fence *f; + VirtIOGPU *g =3D opaque; + VirtIOGPUGL *gl =3D VIRTIO_GPU_GL(g); + + if (gl->renderer_state !=3D RS_INITED) { + return; + } + + QSLIST_MOVE_ATOMIC(&async_fenceq, &gl->async_fenceq); + + while (!QSLIST_EMPTY(&async_fenceq)) { + f =3D QSLIST_FIRST(&async_fenceq); + + QSLIST_REMOVE_HEAD(&async_fenceq, next); + + QTAILQ_FOREACH_SAFE(cmd, &g->fenceq, next, tmp) { + /* + * the guest can end up emitting fences out of order + * so we should check all fenced cmds not just the first one. + */ + if (cmd->cmd_hdr.fence_id > f->fence_id) { + continue; + } + if (cmd->cmd_hdr.flags & VIRTIO_GPU_FLAG_INFO_RING_IDX) { + if (cmd->cmd_hdr.ring_idx !=3D f->ring_idx) { + continue; + } + if (cmd->cmd_hdr.ctx_id !=3D f->ctx_id) { + continue; + } + } else if (f->ring_idx >=3D 0) { + /* ctx0 GL-query fences don't have ring info */ + continue; + } + virtio_gpu_ctrl_response_nodata(g, cmd, VIRTIO_GPU_RESP_OK_NOD= ATA); + QTAILQ_REMOVE(&g->fenceq, cmd, next); + g_free(cmd); + } + + trace_virtio_gpu_fence_resp(f->fence_id); + g_free(f); + g->inflight--; + if (virtio_gpu_stats_enabled(g->parent_obj.conf)) { + trace_virtio_gpu_dec_inflight_fences(g->inflight); + } + } +} + +static void +virtio_gpu_virgl_push_async_fence(VirtIOGPU *g, uint32_t ctx_id, + int64_t ring_idx, uint64_t fence_id) +{ + struct virtio_gpu_virgl_context_fence *f; + VirtIOGPUGL *gl =3D VIRTIO_GPU_GL(g); + + f =3D g_new(struct virtio_gpu_virgl_context_fence, 1); + f->ctx_id =3D ctx_id; + f->ring_idx =3D ring_idx; + f->fence_id =3D fence_id; + + QSLIST_INSERT_HEAD_ATOMIC(&gl->async_fenceq, f, next); + + qemu_bh_schedule(gl->async_fence_bh); +} + +static void virgl_write_async_fence(void *opaque, uint32_t fence) +{ + VirtIOGPU *g =3D opaque; + + virtio_gpu_virgl_push_async_fence(g, 0, -1, fence); +} + +static void virgl_write_async_context_fence(void *opaque, uint32_t ctx_id, + uint32_t ring_idx, uint64_t fe= nce) +{ + VirtIOGPU *g =3D opaque; + + virtio_gpu_virgl_push_async_fence(g, ctx_id, ring_idx, fence); +} +#endif + static virgl_renderer_gl_context virgl_create_context(void *opaque, int scanout_idx, struct virgl_renderer_gl_ctx_param *params) @@ -1150,6 +1267,8 @@ void virtio_gpu_virgl_reset_scanout(VirtIOGPU *g) void virtio_gpu_virgl_reset(VirtIOGPU *g) { virgl_renderer_reset(); + + virtio_gpu_virgl_reset_async_fences(g); } =20 int virtio_gpu_virgl_init(VirtIOGPU *g) @@ -1162,6 +1281,12 @@ int virtio_gpu_virgl_init(VirtIOGPU *g) if (qemu_egl_display) { virtio_gpu_3d_cbs.version =3D 4; virtio_gpu_3d_cbs.get_egl_display =3D virgl_get_egl_display; +#if VIRGL_CHECK_VERSION(1, 1, 2) + virtio_gpu_3d_cbs.write_fence =3D virgl_write_async_fence; + virtio_gpu_3d_cbs.write_context_fence =3D virgl_write_async_contex= t_fence; + flags |=3D VIRGL_RENDERER_ASYNC_FENCE_CB; + flags |=3D VIRGL_RENDERER_THREAD_SYNC; +#endif } #endif #ifdef VIRGL_RENDERER_D3D11_SHARE_TEXTURE @@ -1195,6 +1320,11 @@ int virtio_gpu_virgl_init(VirtIOGPU *g) gl->cmdq_resume_bh =3D aio_bh_new(qemu_get_aio_context(), virtio_gpu_virgl_resume_cmdq_bh, g); +#if VIRGL_CHECK_VERSION(1, 1, 2) + gl->async_fence_bh =3D aio_bh_new(qemu_get_aio_context(), + virtio_gpu_virgl_async_fence_bh, + g); +#endif #endif =20 return 0; diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h index 9f16f89a36d2..e15c16aa5945 100644 --- a/include/hw/virtio/virtio-gpu.h +++ b/include/hw/virtio/virtio-gpu.h @@ -233,6 +233,13 @@ struct VirtIOGPUClass { Error **errp); }; =20 +struct virtio_gpu_virgl_context_fence { + uint32_t ctx_id; + int64_t ring_idx; + uint64_t fence_id; + QSLIST_ENTRY(virtio_gpu_virgl_context_fence) next; +}; + /* VirtIOGPUGL renderer states */ typedef enum { RS_START, /* starting state */ @@ -250,6 +257,9 @@ struct VirtIOGPUGL { QEMUTimer *print_stats; =20 QEMUBH *cmdq_resume_bh; + + QEMUBH *async_fence_bh; + QSLIST_HEAD(, virtio_gpu_virgl_context_fence) async_fenceq; }; =20 struct VhostUserGPU { @@ -379,5 +389,6 @@ void virtio_gpu_virgl_reset_scanout(VirtIOGPU *g); void virtio_gpu_virgl_reset(VirtIOGPU *g); int virtio_gpu_virgl_init(VirtIOGPU *g); GArray *virtio_gpu_virgl_get_capsets(VirtIOGPU *g); +void virtio_gpu_virgl_reset_async_fences(VirtIOGPU *g); =20 #endif diff --git a/meson.build b/meson.build index e96c28da09b6..e3d48150483e 100644 --- a/meson.build +++ b/meson.build @@ -2597,6 +2597,8 @@ config_host_data.set('CONFIG_VNC_JPEG', jpeg.found()) config_host_data.set('CONFIG_VNC_SASL', sasl.found()) if virgl.found() config_host_data.set('VIRGL_VERSION_MAJOR', virgl.version().split('.')[0= ]) + config_host_data.set('VIRGL_VERSION_MINOR', virgl.version().split('.')[1= ]) + config_host_data.set('VIRGL_VERSION_MICRO', virgl.version().split('.')[2= ]) endif config_host_data.set('CONFIG_VIRTFS', have_virtfs) config_host_data.set('CONFIG_VTE', vte.found()) --=20 2.51.0 From nobody Thu Oct 30 23:54:56 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=dmitry.osipenko@collabora.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; arc=pass (i=1 dmarc=pass fromdomain=collabora.com); dmarc=pass(p=none dis=none) header.from=collabora.com ARC-Seal: i=2; a=rsa-sha256; t=1761003891; cv=pass; d=zohomail.com; s=zohoarc; b=VI+OaQBUIH4NhRS+H14PVFnC3FwBUK/hgrduSkbtJpkjM4vxuX60mH60K0n3KY40jBwst6NZXicTT7yS56qnFWzjr8IoQ1u0xmA6QLuBDpLJxG4VQ1XU1reNiIhsoCfM6yqzMrhJ+L9VC4k0REBjVyK8mQRvZZP9OUO9KkKkIfI= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761003891; 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=9JEn6mkdytwpkTxnw0MODVLvcJX4dYTNuSoRBVsrKSI=; b=kEvJwSbeBPH5w+LS4CMtr2nKZ4Gm/7Q0watYKCy7qELI3TGPbgLkbS27Ub2r+58hwRet9CMlJhplz/T9IXrzU9/03j3AVDbE9vtRPQxtbFfaDuPc97uSYtXEERxcHzdfXbAQDHSOZsajQsWrlgjNUQdJ0TB/zWFtCSSo+ilQpg8= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass header.i=dmitry.osipenko@collabora.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; arc=pass (i=1 dmarc=pass fromdomain=collabora.com); 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 1761003891223836.4573504832368; Mon, 20 Oct 2025 16:44:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vAzWu-0003Z2-PI; Mon, 20 Oct 2025 19:43:09 -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 1vAzWs-0003TP-TO for qemu-devel@nongnu.org; Mon, 20 Oct 2025 19:43:06 -0400 Received: from sender4-op-o15.zoho.com ([136.143.188.15]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vAzWj-0001xv-5A for qemu-devel@nongnu.org; Mon, 20 Oct 2025 19:42:58 -0400 Received: by mx.zohomail.com with SMTPS id 1761003763557634.7111082259975; Mon, 20 Oct 2025 16:42:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1761003766; cv=none; d=zohomail.com; s=zohoarc; b=bMU8/Zz7q6dGYrXDUiNVWOFK6sfc+XfudRL8DVPv2mgM+muZCKCksRk7+mU/+l3TOPSrX+Gzjy6Vx5YI20JSh9UaAoiLj2oSqts0qXLPSn4l06gOSodw8s14w1zbhU9YE/eim4nIg9mbNWUuSE/pAwTKFhEoF1NLO/ynOPm/64E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761003766; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=9JEn6mkdytwpkTxnw0MODVLvcJX4dYTNuSoRBVsrKSI=; b=THl7RwMfVecVy2N4VOuRYou9oWRrfc8pT5D11fkDJJ29UzQN3mUC7PtTj9TMapEKoYBOpmOuaPOHCJUfYHN3P4M1q49vxV3Q57HcXfrtT3Q+ytxZrzx5yv/GOMAFrWxLHDMeAyd6U3UiTuO7LCg70NmVfA5AfbwgTxQOAfuPgCw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=dmitry.osipenko@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1761003766; s=zohomail; d=collabora.com; i=dmitry.osipenko@collabora.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:In-Reply-To:References:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=9JEn6mkdytwpkTxnw0MODVLvcJX4dYTNuSoRBVsrKSI=; b=hxIgUc1OwHgQQyhVb9OoPhoC+vmgvOPCG46A0/SlS4yQFnlUumP3VnvdK3F+k4aD uwEvgUwqlFCLkDKRmtKP4yweSOiZPXz73JBd2KqMXf0oUqYtnED8Dtuy45U2FB29S9e 7psce2WElqwFmYWVnu7T0hiFYqMNX+O8rl1wTVYU= From: Dmitry Osipenko To: Akihiko Odaki , Huang Rui , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierre-Eric Pelloux-Prayer , "Michael S . Tsirkin" , Paolo Bonzini Cc: Gert Wollny , qemu-devel@nongnu.org, Gurchetan Singh , Alyssa Ross , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Alex Deucher , Stefano Stabellini , =?UTF-8?q?Christian=20K=C3=B6nig?= , Xenia Ragiadakou , Honglei Huang , Julia Zhang , Chen Jiqian , Rob Clark , Yiwei Zhang , Sergio Lopez Pascual Subject: [PATCH v14 05/10] virtio-gpu: Support DRM native context Date: Tue, 21 Oct 2025 02:39:44 +0300 Message-ID: <20251020233949.506088-6-dmitry.osipenko@collabora.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251020233949.506088-1-dmitry.osipenko@collabora.com> References: <20251020233949.506088-1-dmitry.osipenko@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External 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=136.143.188.15; envelope-from=dmitry.osipenko@collabora.com; helo=sender4-op-o15.zoho.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, 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_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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 dmitry.osipenko@collabora.com) X-ZM-MESSAGEID: 1761003894092158500 Add support for DRM native contexts to VirtIO-GPU. DRM context is enabled using a new virtio-gpu-gl device option "drm_native_context=3Don". Unlike Virgl and Venus contexts that operate on application API level, DRM native contexts work on a kernel UAPI level. This lower level results in a lightweight context implementations that yield better performance. Reviewed-by: Akihiko Odaki Acked-by: Michael S. Tsirkin Tested-by: Alex Benn=C3=A9e Signed-off-by: Dmitry Osipenko --- docs/system/devices/virtio-gpu.rst | 11 +++++++++++ hw/display/virtio-gpu-gl.c | 2 ++ hw/display/virtio-gpu-virgl.c | 28 ++++++++++++++++++++++++++++ hw/display/virtio-gpu.c | 15 +++++++++++++++ include/hw/virtio/virtio-gpu.h | 3 +++ 5 files changed, 59 insertions(+) diff --git a/docs/system/devices/virtio-gpu.rst b/docs/system/devices/virti= o-gpu.rst index b7eb0fc0e727..f20c60016376 100644 --- a/docs/system/devices/virtio-gpu.rst +++ b/docs/system/devices/virtio-gpu.rst @@ -82,6 +82,17 @@ of virtio-gpu host memory window. This is typically betw= een 256M and 8G. =20 .. _venus: https://gitlab.freedesktop.org/virgl/venus-protocol/ =20 +DRM native context is supported since release of `virglrenderer`_ v1.0.0 +using `drm`_ protocol. ``DRM`` virtio-gpu capability set ("capset") requi= res +host blob support (``hostmem`` and ``blob`` fields) and should be enabled +using ``drm_native_context`` field. The ``hostmem`` field specifies the s= ize +of virtio-gpu host memory window. This is typically between 256M and 8G. + +.. parsed-literal:: + -device virtio-gpu-gl,hostmem=3D8G,blob=3Don,drm_native_context=3Don + +.. _drm: https://gitlab.freedesktop.org/virgl/virglrenderer/-/tree/main/sr= c/drm + virtio-gpu rutabaga ------------------- =20 diff --git a/hw/display/virtio-gpu-gl.c b/hw/display/virtio-gpu-gl.c index 1468c6ed1467..b640900fc6f1 100644 --- a/hw/display/virtio-gpu-gl.c +++ b/hw/display/virtio-gpu-gl.c @@ -159,6 +159,8 @@ static const Property virtio_gpu_gl_properties[] =3D { VIRTIO_GPU_FLAG_STATS_ENABLED, false), DEFINE_PROP_BIT("venus", VirtIOGPU, parent_obj.conf.flags, VIRTIO_GPU_FLAG_VENUS_ENABLED, false), + DEFINE_PROP_BIT("drm_native_context", VirtIOGPU, parent_obj.conf.flags, + VIRTIO_GPU_FLAG_DRM_ENABLED, false), }; =20 static void virtio_gpu_gl_device_unrealize(DeviceState *qdev) diff --git a/hw/display/virtio-gpu-virgl.c b/hw/display/virtio-gpu-virgl.c index 0320d6deca76..ccba1d8ee4f4 100644 --- a/hw/display/virtio-gpu-virgl.c +++ b/hw/display/virtio-gpu-virgl.c @@ -1298,6 +1298,25 @@ int virtio_gpu_virgl_init(VirtIOGPU *g) if (virtio_gpu_venus_enabled(g->parent_obj.conf)) { flags |=3D VIRGL_RENDERER_VENUS | VIRGL_RENDERER_RENDER_SERVER; } + if (virtio_gpu_drm_enabled(g->parent_obj.conf)) { + flags |=3D VIRGL_RENDERER_DRM; + + if (!(flags & VIRGL_RENDERER_ASYNC_FENCE_CB)) { + /* + * Virglrenderer skips enabling DRM context support without + * enabled async-fence feature. VirtIO-GPU will initialize + * successfully, but DRM context won't be available in guest. + * + * For vrend async-fencing can be enabled only if EGL display + * is used. Vrend can't be disabled in QEMU, hence DRM implici= tly + * requires EGL too. + * + * Async-fence was bugged in virglrenderer versions <=3D 1.1.1. + */ + error_report("drm requires egl display and virglrenderer >=3D = 1.2.0"); + return -EINVAL; + } + } #endif =20 ret =3D virgl_renderer_init(g, flags, &virtio_gpu_3d_cbs); @@ -1361,5 +1380,14 @@ GArray *virtio_gpu_virgl_get_capsets(VirtIOGPU *g) } } =20 + if (virtio_gpu_drm_enabled(g->parent_obj.conf)) { + virgl_renderer_get_cap_set(VIRTIO_GPU_CAPSET_DRM, + &capset_max_ver, + &capset_max_size); + if (capset_max_size) { + virtio_gpu_virgl_add_capset(capset_ids, VIRTIO_GPU_CAPSET_DRM); + } + } + return capset_ids; } diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index 3a555125be60..ad36ea6ee319 100644 --- a/hw/display/virtio-gpu.c +++ b/hw/display/virtio-gpu.c @@ -1510,6 +1510,21 @@ void virtio_gpu_device_realize(DeviceState *qdev, Er= ror **errp) #endif } =20 + if (virtio_gpu_drm_enabled(g->parent_obj.conf)) { +#ifdef VIRGL_VERSION_MAJOR + #if VIRGL_VERSION_MAJOR >=3D 1 + if (!virtio_gpu_blob_enabled(g->parent_obj.conf) || + !virtio_gpu_hostmem_enabled(g->parent_obj.conf)) { + error_setg(errp, "drm requires enabled blob and hostmem option= s"); + return; + } + #else + error_setg(errp, "old virglrenderer, drm unsupported"); + return; + #endif +#endif + } + if (!virtio_gpu_base_device_realize(qdev, virtio_gpu_handle_ctrl_cb, virtio_gpu_handle_cursor_cb, diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h index e15c16aa5945..a4963508a469 100644 --- a/include/hw/virtio/virtio-gpu.h +++ b/include/hw/virtio/virtio-gpu.h @@ -100,6 +100,7 @@ enum virtio_gpu_base_conf_flags { VIRTIO_GPU_FLAG_RUTABAGA_ENABLED, VIRTIO_GPU_FLAG_VENUS_ENABLED, VIRTIO_GPU_FLAG_RESOURCE_UUID_ENABLED, + VIRTIO_GPU_FLAG_DRM_ENABLED, }; =20 #define virtio_gpu_virgl_enabled(_cfg) \ @@ -122,6 +123,8 @@ enum virtio_gpu_base_conf_flags { (_cfg.hostmem > 0) #define virtio_gpu_venus_enabled(_cfg) \ (_cfg.flags & (1 << VIRTIO_GPU_FLAG_VENUS_ENABLED)) +#define virtio_gpu_drm_enabled(_cfg) \ + (_cfg.flags & (1 << VIRTIO_GPU_FLAG_DRM_ENABLED)) =20 struct virtio_gpu_base_conf { uint32_t max_outputs; --=20 2.51.0 From nobody Thu Oct 30 23:54:56 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=dmitry.osipenko@collabora.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; arc=pass (i=1 dmarc=pass fromdomain=collabora.com); dmarc=pass(p=none dis=none) header.from=collabora.com ARC-Seal: i=2; a=rsa-sha256; t=1761003831; cv=pass; d=zohomail.com; s=zohoarc; b=PU4exa0eo5IT0eUqUYpUhuy/btLCTjZaGpb8elZ98GLy56ecekbUcRGvQsuk2LjpUys3+9dOdKN/GdgMniciqvlxIeyQ2EWkg8mTjT125rOf7RMC4kyUpMfX6TTMQvbyQUQ4UinLT2I0yEhjqyQHtD/9TKpCaSBLDuOsZFnCNpI= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761003831; 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=g90xP6QiDeGwUlqROIMqcgq6yFksqEhMptPUQcZik20=; b=AOFQooJswJdnL9H7X/KtXlYBPubnfF4kmRqbBJOsqQpZp7SAi9wYIQu01Vnwg4+iNtdI5vEFxcDssspGuyDFXuQ5BXbm3mA9qwNpTvFH0q1pW2ppoGPXJeZWRTPdupJFrqPKaPvg4DR0Jpvj63NKJ5y29tK1iQw4331V4OrB1Ig= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass header.i=dmitry.osipenko@collabora.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; arc=pass (i=1 dmarc=pass fromdomain=collabora.com); 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 1761003831665202.12639048985056; Mon, 20 Oct 2025 16:43:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vAzWw-0003bf-9G; Mon, 20 Oct 2025 19:43:10 -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 1vAzWu-0003Y1-9x for qemu-devel@nongnu.org; Mon, 20 Oct 2025 19:43:08 -0400 Received: from sender4-op-o15.zoho.com ([136.143.188.15]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vAzWs-0001y3-Fz for qemu-devel@nongnu.org; Mon, 20 Oct 2025 19:43:08 -0400 Received: by mx.zohomail.com with SMTPS id 1761003769394570.7749766969237; Mon, 20 Oct 2025 16:42:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1761003772; cv=none; d=zohomail.com; s=zohoarc; b=DMI/No0TYsi2tYyvpNUr+ZSH+aZ98Un70DTTv7C//dOuPq/VXsTzLQp+Mhhjsut+sJxOntXlsWoL6MIxe20YbpYL8QmlaPjiLkjvIxzCKDpVmvUt3Jq9jejP40GosbkXvUdoC+lgBVpN2PlVWhp8CuBSGRHOSYxKE19Z97oyuhA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761003772; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=g90xP6QiDeGwUlqROIMqcgq6yFksqEhMptPUQcZik20=; b=CZ8OKLns7R7zFTWd5ZJ6egq8hgOsbUgClhMI2EA1RKlLvRWBaAuM/kCzyJRLVOGRqgOC+VuirGDKwRDq20CRI9f6X3h5dg8dHRK/9pWAKWYXbHd3SQdf0YQVqQyWF67ppCRv3kpuO7sQOEXnIWQvSFGwZkIwAi9ZDL77HZz/vlI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=dmitry.osipenko@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1761003772; s=zohomail; d=collabora.com; i=dmitry.osipenko@collabora.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:In-Reply-To:References:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=g90xP6QiDeGwUlqROIMqcgq6yFksqEhMptPUQcZik20=; b=Q73vX+c7sBPMBbya2SVmiC4tCkdl8Xkqd1+TNa8Qymhm95iDsP7DbSGXgLTfHbR4 Kgwi05sCVgugs0gu2gVYKCZQtRq5poBjmCumSYS4Fbfm5JQRTJpHxVow6kKpremwmVY sbbb6WI/mlYzFLvUS93aO7nRU7c9yNjZZP0fEhDE= From: Dmitry Osipenko To: Akihiko Odaki , Huang Rui , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierre-Eric Pelloux-Prayer , "Michael S . Tsirkin" , Paolo Bonzini Cc: Gert Wollny , qemu-devel@nongnu.org, Gurchetan Singh , Alyssa Ross , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Alex Deucher , Stefano Stabellini , =?UTF-8?q?Christian=20K=C3=B6nig?= , Xenia Ragiadakou , Honglei Huang , Julia Zhang , Chen Jiqian , Rob Clark , Yiwei Zhang , Sergio Lopez Pascual Subject: [PATCH v14 06/10] ui/sdl2: Don't disable scanout when display is refreshed Date: Tue, 21 Oct 2025 02:39:45 +0300 Message-ID: <20251020233949.506088-7-dmitry.osipenko@collabora.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251020233949.506088-1-dmitry.osipenko@collabora.com> References: <20251020233949.506088-1-dmitry.osipenko@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External 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=136.143.188.15; envelope-from=dmitry.osipenko@collabora.com; helo=sender4-op-o15.zoho.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, 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_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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 dmitry.osipenko@collabora.com) X-ZM-MESSAGEID: 1761003832486154100 Display refreshment is invoked by a timer and it erroneously disables the active scanout if it happens to be invoked after scanout has been enabled. This offending scanout-disable race condition with a timer can be easily hit when Qemu runs with a disabled vsync by using SDL or GTK displays (with vblank_mode=3D0 for GTK). Refreshment of display's content shouldn't disable the active display. Fix it by keeping the scanout's state unchanged when display is redrawn. Reviewed-by: Akihiko Odaki Acked-by: Michael S. Tsirkin Tested-by: Alex Benn=C3=A9e Signed-off-by: Dmitry Osipenko --- ui/sdl2-gl.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ui/sdl2-gl.c b/ui/sdl2-gl.c index 4906f6875046..d8e5e0a3642c 100644 --- a/ui/sdl2-gl.c +++ b/ui/sdl2-gl.c @@ -53,7 +53,6 @@ static void sdl2_gl_render_surface(struct sdl2_console *s= con) int ww, wh; =20 SDL_GL_MakeCurrent(scon->real_window, scon->winctx); - sdl2_set_scanout_mode(scon, false); =20 SDL_GetWindowSize(scon->real_window, &ww, &wh); surface_gl_setup_viewport(scon->gls, scon->surface, ww, wh); --=20 2.51.0 From nobody Thu Oct 30 23:54:56 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=dmitry.osipenko@collabora.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; arc=pass (i=1 dmarc=pass fromdomain=collabora.com); dmarc=pass(p=none dis=none) header.from=collabora.com ARC-Seal: i=2; a=rsa-sha256; t=1761003802; cv=pass; d=zohomail.com; s=zohoarc; b=UTkN7Rdi8A0trTlmosCAcIIYKluOjk7C9Jhumm7lM+uEBCJKW/bVgtC0x48o7bh2Y0PhwCi8udxP+3Om6CDcFZsTMpy2qHTnylkRh03SFVTo0gq60akyz7KaMhyMNduPh5dntXXBplau/lsrQcRguFgjrFeiwoOF+KverPh3Zig= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761003802; 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=xoNYZD9pDu+P2E5/JLiwc710z+NNAcl0Hckzln/LmX4=; b=ihDTRE1VeH9OQbDaZgkG6JpZG7dbFuQuQ5qVpQ5tliQ/IX/Jb0+zjamVLZuvgEF9NyVDQCPvt5SF+4UJsjHIfDKlCsN1HXtGv5PZTJPeMdnpG8OAD5MacFMlh398NmcUcMBEaTb9Q8hUm9RvgUN81HBc8sBuVGdh5nyg8gT1g20= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass header.i=dmitry.osipenko@collabora.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; arc=pass (i=1 dmarc=pass fromdomain=collabora.com); 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 1761003802661286.53007677852827; Mon, 20 Oct 2025 16:43:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vAzWx-0003dm-Uz; Mon, 20 Oct 2025 19:43:11 -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 1vAzWv-0003bP-Lo for qemu-devel@nongnu.org; Mon, 20 Oct 2025 19:43:09 -0400 Received: from sender4-op-o15.zoho.com ([136.143.188.15]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vAzWt-0001yI-U9 for qemu-devel@nongnu.org; Mon, 20 Oct 2025 19:43:09 -0400 Received: by mx.zohomail.com with SMTPS id 1761003775334300.48194411016993; Mon, 20 Oct 2025 16:42:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1761003776; cv=none; d=zohomail.com; s=zohoarc; b=bnSDKhKbYxJoZMNbjFR5ho4i6WkLko682Z0xom/nX9y4mbpBkqFjNtH6xbA5DHBJcaGgcT+hHl2OVdJ50MAd1DMSV8qYEd8ZsbRh+SACuvzwd/FmiG5a2Huh5DYAJKiWjk00r+5cIL0MJ7dkofekGNLHl4UqZ0pGjUN4vlAcIjY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761003776; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=xoNYZD9pDu+P2E5/JLiwc710z+NNAcl0Hckzln/LmX4=; b=AUif5b14EC+z/4gSXtHSFsxRzUsooJIGWr07KJG4m4fYzaunypXZl42uNnH3fyp9A0VKFBGl+dSWbLmbdhMaMUlkuz/kOXc8onCc8eVQS32OZkqM9UhAqww+ryXIV8tgc+JumN9vEpsbzCTCAh8+JHqH7gphEKXhlJwJupC9Ts4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=dmitry.osipenko@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1761003776; s=zohomail; d=collabora.com; i=dmitry.osipenko@collabora.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:In-Reply-To:References:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=xoNYZD9pDu+P2E5/JLiwc710z+NNAcl0Hckzln/LmX4=; b=RqC/l5bRc9mwUofHHNHMoSI56o+KEQ/TQM6jlgDTKZX/hjOITDFCFmsYE6OztW2w OU+ImxKmRaLLoyJW/qu4pcu7rxlhwzx+ybZ8bxZumVnqc7KJmPdbelcoYxeMAbRkgdf e6NLgPFINA5cw/y2jj/X06OwoZnTUaS+4FJt/DQw= From: Dmitry Osipenko To: Akihiko Odaki , Huang Rui , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierre-Eric Pelloux-Prayer , "Michael S . Tsirkin" , Paolo Bonzini Cc: Gert Wollny , qemu-devel@nongnu.org, Gurchetan Singh , Alyssa Ross , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Alex Deucher , Stefano Stabellini , =?UTF-8?q?Christian=20K=C3=B6nig?= , Xenia Ragiadakou , Honglei Huang , Julia Zhang , Chen Jiqian , Rob Clark , Yiwei Zhang , Sergio Lopez Pascual Subject: [PATCH v14 07/10] ui/gtk: Don't disable scanout when display is refreshed Date: Tue, 21 Oct 2025 02:39:46 +0300 Message-ID: <20251020233949.506088-8-dmitry.osipenko@collabora.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251020233949.506088-1-dmitry.osipenko@collabora.com> References: <20251020233949.506088-1-dmitry.osipenko@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External 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=136.143.188.15; envelope-from=dmitry.osipenko@collabora.com; helo=sender4-op-o15.zoho.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, 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_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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 dmitry.osipenko@collabora.com) X-ZM-MESSAGEID: 1761003805218158500 Display refreshment is invoked by a timer and it erroneously disables the active scanout if it happens to be invoked after scanout has been enabled. This offending scanout-disable race condition with a timer can be easily hit when Qemu runs with a disabled vsync by using SDL or GTK displays (with vblank_mode=3D0 for GTK). Refreshment of display's content shouldn't disable the active display. Fix it by keeping the scanout's state unchanged when display is redrawn. Reviewed-by: Akihiko Odaki Acked-by: Michael S. Tsirkin Tested-by: Alex Benn=C3=A9e Signed-off-by: Dmitry Osipenko --- ui/gtk-egl.c | 1 - ui/gtk-gl-area.c | 1 - 2 files changed, 2 deletions(-) diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c index ae9239999cdb..0dbb429958e5 100644 --- a/ui/gtk-egl.c +++ b/ui/gtk-egl.c @@ -180,7 +180,6 @@ void gd_egl_refresh(DisplayChangeListener *dcl) =20 if (vc->gfx.glupdates) { vc->gfx.glupdates =3D 0; - gtk_egl_set_scanout_mode(vc, false); gd_egl_draw(vc); } } diff --git a/ui/gtk-gl-area.c b/ui/gtk-gl-area.c index 05fc38096eca..88496c3dbfc6 100644 --- a/ui/gtk-gl-area.c +++ b/ui/gtk-gl-area.c @@ -184,7 +184,6 @@ void gd_gl_area_refresh(DisplayChangeListener *dcl) =20 if (vc->gfx.glupdates) { vc->gfx.glupdates =3D 0; - gtk_gl_area_set_scanout_mode(vc, false); gtk_gl_area_queue_render(GTK_GL_AREA(vc->gfx.drawing_area)); } } --=20 2.51.0 From nobody Thu Oct 30 23:54:56 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=dmitry.osipenko@collabora.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; arc=pass (i=1 dmarc=pass fromdomain=collabora.com); dmarc=pass(p=none dis=none) header.from=collabora.com ARC-Seal: i=2; a=rsa-sha256; t=1761003894; cv=pass; d=zohomail.com; s=zohoarc; b=NDQoUy5///92es9kmS5d/6Tiyv868nT0ze7yz+pzEfvlBBaTFIsha5HREM/Kle5sOsa8NnW2vlugZH7YhA7JuFM6L+LHkWjsqoB1wnbcAe7KFGj7xwj3igKihMWnb/6QDSMBmSYAXsnkyxFhGfzZmhOf+6JNEZlTNA7DYmbFNmc= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761003894; h=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=WyaUbzmjTqzdbiFmgMK5hsMSRr5s8FUwYYq3w/lhhoQ=; b=jHbhB/q2Bl+lZ2csbhwLB6G9N8XsJueQsZF1SvXAMXBO/Ru/rfuqBrdD3/q6Ppt7KAfQhsN2zlZZTBIqV2A+klj6gQDhnuf1jnMFXC20p+u+eodKLaD8oL51ZJkR98b4C6wDsCnS8uKLJud+Zp565t0/DwVKWfOOq4KRYsCG3w0= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass header.i=dmitry.osipenko@collabora.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; arc=pass (i=1 dmarc=pass fromdomain=collabora.com); 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 1761003894197251.84615966397405; Mon, 20 Oct 2025 16:44:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vAzXi-0004af-Hw; Mon, 20 Oct 2025 19:43:58 -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 1vAzXE-0004Ow-Kx for qemu-devel@nongnu.org; Mon, 20 Oct 2025 19:43:34 -0400 Received: from sender4-op-o15.zoho.com ([136.143.188.15]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vAzX1-0001yk-Ld for qemu-devel@nongnu.org; Mon, 20 Oct 2025 19:43:25 -0400 Received: by mx.zohomail.com with SMTPS id 1761003781475556.9748569386284; Mon, 20 Oct 2025 16:43:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1761003782; cv=none; d=zohomail.com; s=zohoarc; b=UbEV6rbpEuSUFiD6LtWQH9BPqz05lznwohCNR/poG64KgGLa2IOlktactUp18yVle0pKYTrC88D3HmwBVNGrzZI4qggAz/XF9kWEMsv+newCJU3VniKRJsDvpR0rPYjjd+ZaG8TRNWn5IWuwUnZ7RA4Ei3zTRc6olCl/aHFwTVQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761003782; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=WyaUbzmjTqzdbiFmgMK5hsMSRr5s8FUwYYq3w/lhhoQ=; b=FZm7mTaLYOqwqRAmWjra29MrsDxya8h67cKSRzdLQ6RT/DQvKz0nXOV/ZbJZdLJx/iyMzmJ3q7ChGReESPXN5dYALvA11eM+xuQHtLvup6BYdrhPMx58XVWZt80qMzBu8rtOHtSIPu7AnLYoG6pUwUyeKJFwb5nPNXvJyiDGmWQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=dmitry.osipenko@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1761003782; s=zohomail; d=collabora.com; i=dmitry.osipenko@collabora.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Message-Id:Reply-To; bh=WyaUbzmjTqzdbiFmgMK5hsMSRr5s8FUwYYq3w/lhhoQ=; b=Q4bERzupEMCt068nP3qpoWpnuZSuRWS6Df3RWBGxts/dyjoENlWFrvAJQEjo/RcD n4+9lpMAWWWcy3OUJW9KFYGW+ezi3qPMObPpJd5g9c83PVCMyUebRIlaAphz+xFh24x KyxhTf2xnO4yCDM2KBZyYsdiZSKgJ4YEg/dBQdR4= From: Dmitry Osipenko To: Akihiko Odaki , Huang Rui , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierre-Eric Pelloux-Prayer , "Michael S . Tsirkin" , Paolo Bonzini Cc: Gert Wollny , qemu-devel@nongnu.org, Gurchetan Singh , Alyssa Ross , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Alex Deucher , Stefano Stabellini , =?UTF-8?q?Christian=20K=C3=B6nig?= , Xenia Ragiadakou , Honglei Huang , Julia Zhang , Chen Jiqian , Rob Clark , Yiwei Zhang , Sergio Lopez Pascual Subject: [PATCH v14 08/10] docs/system: virtio-gpu: Add link to Mesa VirGL doc Date: Tue, 21 Oct 2025 02:39:47 +0300 Message-ID: <20251020233949.506088-9-dmitry.osipenko@collabora.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251020233949.506088-1-dmitry.osipenko@collabora.com> References: <20251020233949.506088-1-dmitry.osipenko@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External 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=136.143.188.15; envelope-from=dmitry.osipenko@collabora.com; helo=sender4-op-o15.zoho.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, 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_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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 dmitry.osipenko@collabora.com) X-ZM-MESSAGEID: 1761003898132158500 Content-Type: text/plain; charset="utf-8" Extend virtio-gpu documentation with a link to the Mesa VirGL documentation. Suggested-by: Akihiko Odaki Reviewed-by: Akihiko Odaki Signed-off-by: Dmitry Osipenko --- docs/system/devices/virtio-gpu.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/system/devices/virtio-gpu.rst b/docs/system/devices/virti= o-gpu.rst index f20c60016376..f8963c1f13cf 100644 --- a/docs/system/devices/virtio-gpu.rst +++ b/docs/system/devices/virtio-gpu.rst @@ -59,7 +59,7 @@ on typical modern Linux distributions. virtio-gpu virglrenderer ------------------------ =20 -When using virgl accelerated graphics mode in the guest, OpenGL API calls +When using `virgl`_ accelerated graphics mode in the guest, OpenGL API cal= ls are translated into an intermediate representation (see `Gallium3D`_). The intermediate representation is communicated to the host and the `virglrenderer`_ library on the host translates the intermediate @@ -68,6 +68,7 @@ representation back to OpenGL API calls. .. parsed-literal:: -device virtio-gpu-gl =20 +.. _virgl: https://docs.mesa3d.org/drivers/virgl.html .. _Gallium3D: https://www.freedesktop.org/wiki/Software/gallium/ .. _virglrenderer: https://gitlab.freedesktop.org/virgl/virglrenderer/ =20 --=20 2.51.0 From nobody Thu Oct 30 23:54:56 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=dmitry.osipenko@collabora.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; arc=pass (i=1 dmarc=pass fromdomain=collabora.com); dmarc=pass(p=none dis=none) header.from=collabora.com ARC-Seal: i=2; a=rsa-sha256; t=1761003877; cv=pass; d=zohomail.com; s=zohoarc; b=e9KEaytv9fMBr0Oue2r/L8BdYMoJoihtMTyzKLT5Xkvv/TdL8ssBlv9t8SbDJfgM/J6StXy7r9NpjDkpyh2UDni6RLl9nsa8lsGMZA9+l/j7BMnXFs3lsDkEX/6Mm+p7JUulAFcqnNIyR+VrndRan6ASI2SzqqACwn3fkLz//Pk= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761003877; h=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=j7gCeHMDNWu9XLW+z4lzZ9nBmfi2rCbGVT8f0GuH5Yo=; b=Qz3UKol5U9MujeloB5xBSTRh/jxl+8pdCaTlIgz7vcLR+YdAOX3YVSUh2E8NkmaXkq9f3lgBqqw5fJny5LyYjJHq7ncSgj0qlEC3koGPQkSfHAP8DueIyzXjO69vm1B1sPuh1XrZ8Ctx0inGkICodppgheXXnbsMPpGluuU5jPw= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass header.i=dmitry.osipenko@collabora.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; arc=pass (i=1 dmarc=pass fromdomain=collabora.com); 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 1761003877598392.25390057248603; Mon, 20 Oct 2025 16:44:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vAzY9-00050v-HG; Mon, 20 Oct 2025 19:44:28 -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 1vAzXI-0004PA-N0 for qemu-devel@nongnu.org; Mon, 20 Oct 2025 19:43:39 -0400 Received: from sender4-op-o15.zoho.com ([136.143.188.15]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vAzXE-0001zM-Ef for qemu-devel@nongnu.org; Mon, 20 Oct 2025 19:43:32 -0400 Received: by mx.zohomail.com with SMTPS id 1761003787519427.0340246621955; Mon, 20 Oct 2025 16:43:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1761003788; cv=none; d=zohomail.com; s=zohoarc; b=DzEjXmUtKb7rVJMzOHXGLdGgRKWbbB/qSYn2MpM3cLt3dmvHsTjCRKhy6YUpsBPwhoqhlF2mDNu3IEiqDXTS/Ld2iK081gYAsB3CkmPuLdS7jbHYT6eBdrMv/kS/q1/79z359tyjUfJyWGuXWmf0mpw6BRQZEZ3fkvxc8eZQo7o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761003788; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=j7gCeHMDNWu9XLW+z4lzZ9nBmfi2rCbGVT8f0GuH5Yo=; b=JeG1UpljqktgYbcje6nYCckWGg128tpcv5wf66FUGNCbX3hNKq45u2q+4ZaZwXu6Cjz6gFvXjj9+3uCb4IFxTCWVWSA4Cg5l/xVT2cCA5L8Vau9tY8BwEwfKHOWt7PtczAK7uOgb/qaHx09LjY8rDBqicoHq6HLY2SGf6idOOHY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=dmitry.osipenko@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1761003788; s=zohomail; d=collabora.com; i=dmitry.osipenko@collabora.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Message-Id:Reply-To; bh=j7gCeHMDNWu9XLW+z4lzZ9nBmfi2rCbGVT8f0GuH5Yo=; b=b5DLx8z7wbIXGCROEefPz7QyCS4auhxseq3qzyStSQvXNFK+iCsWbEXZdX+FSvzK IPktcWwV2mmAIoxG+pNJUrEWJIfyFlAjGSKqewQlfOcSi6+eVcbj9ci5doBtSwFfviS F6sLuLyFqc0SggmjtAx9yFcaGXOLkuR70G8w4P50= From: Dmitry Osipenko To: Akihiko Odaki , Huang Rui , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierre-Eric Pelloux-Prayer , "Michael S . Tsirkin" , Paolo Bonzini Cc: Gert Wollny , qemu-devel@nongnu.org, Gurchetan Singh , Alyssa Ross , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Alex Deucher , Stefano Stabellini , =?UTF-8?q?Christian=20K=C3=B6nig?= , Xenia Ragiadakou , Honglei Huang , Julia Zhang , Chen Jiqian , Rob Clark , Yiwei Zhang , Sergio Lopez Pascual Subject: [PATCH v14 09/10] docs/system: virtio-gpu: Update Venus link Date: Tue, 21 Oct 2025 02:39:48 +0300 Message-ID: <20251020233949.506088-10-dmitry.osipenko@collabora.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251020233949.506088-1-dmitry.osipenko@collabora.com> References: <20251020233949.506088-1-dmitry.osipenko@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External 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=136.143.188.15; envelope-from=dmitry.osipenko@collabora.com; helo=sender4-op-o15.zoho.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, 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_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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 dmitry.osipenko@collabora.com) X-ZM-MESSAGEID: 1761003877884158500 Content-Type: text/plain; charset="utf-8" Change virtio-gpu Venus link, pointing it at the Mesa Venus documentation instead of the protocol. The Mesa doc provides more information and also has a link to the protocol. Suggested-by: Akihiko Odaki Reviewed-by: Akihiko Odaki Signed-off-by: Dmitry Osipenko --- docs/system/devices/virtio-gpu.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/system/devices/virtio-gpu.rst b/docs/system/devices/virti= o-gpu.rst index f8963c1f13cf..ea3eb052df3c 100644 --- a/docs/system/devices/virtio-gpu.rst +++ b/docs/system/devices/virtio-gpu.rst @@ -81,7 +81,7 @@ of virtio-gpu host memory window. This is typically betwe= en 256M and 8G. .. parsed-literal:: -device virtio-gpu-gl,hostmem=3D8G,blob=3Dtrue,venus=3Dtrue =20 -.. _venus: https://gitlab.freedesktop.org/virgl/venus-protocol/ +.. _venus: https://docs.mesa3d.org/drivers/venus.html =20 DRM native context is supported since release of `virglrenderer`_ v1.0.0 using `drm`_ protocol. ``DRM`` virtio-gpu capability set ("capset") requi= res --=20 2.51.0 From nobody Thu Oct 30 23:54:56 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=dmitry.osipenko@collabora.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; arc=pass (i=1 dmarc=pass fromdomain=collabora.com); dmarc=pass(p=none dis=none) header.from=collabora.com ARC-Seal: i=2; a=rsa-sha256; t=1761003855; cv=pass; d=zohomail.com; s=zohoarc; b=O31xX6ijYG9iaW/AqMB8ei4vNuFwi9xhq5F6ybP98W7Ip/E9YvJPiY0FRgmSfK2Gmc5Ch8wFaTQ87dvcQLAPVgTvoWHjoMKGPV5eUNaQgytWR1iaHROPvFPE30j0pULHofEgB2E25bjbl3wEXgbLdqQGwkYJdqv56Kp0u0sS0oM= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761003855; 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=HBBm1hfQWfE4kgzPiwxGlhNDXJ22qEkrmWuOYoZ+tlg=; b=YV9fn1jUZekSoW/fA3wW4rWiKTgI/xKAD+FO8RAycTQe1gT6S/1f5pL+tlcxr4AGej6EizseCj7X8PZ5e1CFnmYkMmCWBzDXeGN7TENMcbUEnil+/53+lgtj2lj/NQLxNFACBZSQRMxCI+WVC6dJdmiZYjArd2Dj1Av1eG4SbY0= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass header.i=dmitry.osipenko@collabora.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; arc=pass (i=1 dmarc=pass fromdomain=collabora.com); 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 1761003855815156.50752653870757; Mon, 20 Oct 2025 16:44:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vAzXk-0004dI-7W; Mon, 20 Oct 2025 19:44:02 -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 1vAzXJ-0004Pf-4c for qemu-devel@nongnu.org; Mon, 20 Oct 2025 19:43:40 -0400 Received: from sender4-op-o15.zoho.com ([136.143.188.15]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vAzXE-0001zW-G9 for qemu-devel@nongnu.org; Mon, 20 Oct 2025 19:43:32 -0400 Received: by mx.zohomail.com with SMTPS id 1761003793560288.65292081111215; Mon, 20 Oct 2025 16:43:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1761003794; cv=none; d=zohomail.com; s=zohoarc; b=TP4e7rfDZPk+mZc15uiaOt07sozPU1sL3xT2TfhoUfwzytTDIPA1laGIXwdRikK+g+v7zWx3Rv8/iP9tpwpcVpAac1rJahQffesD8UMOgtBH+CrpJH2ejDeIezQr7L4AtMsAeMusfzOrL7dG309tYInDaFbOkgS9g/JluWECr1U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761003794; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=HBBm1hfQWfE4kgzPiwxGlhNDXJ22qEkrmWuOYoZ+tlg=; b=LkoOYfW46D6whWd47lXz3WzXHelwi2RurZKAajgeHvnbcfx2pUdggsLfWdIv5q22hK6pHBuNJOOBBf5Cr0/HgeREf8vQcVaK0k4oIPVv0lK4CtXpaQGOYRrYEsanO6a7Jq7qLZNyVORF6lswYzeF4cPUjI7RZX5TsCthpMJJMqY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=dmitry.osipenko@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1761003794; s=zohomail; d=collabora.com; i=dmitry.osipenko@collabora.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:In-Reply-To:References:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=HBBm1hfQWfE4kgzPiwxGlhNDXJ22qEkrmWuOYoZ+tlg=; b=KBsBDcK64YKwPdGJstJoXOY61UqgKYEemIri0XlvV8sijRr0SfH+UvdSfHOnW5X2 LnoV1Cman1gcwVSwAGLjLpSAepcTzAqFcH0REzhz5y3NfwdVQQOHv+1kRGN4fWnepnA ZjcuJ7d6TrFU2tVWzxmqmyjsWeUZvHj5ns3KL44s= From: Dmitry Osipenko To: Akihiko Odaki , Huang Rui , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierre-Eric Pelloux-Prayer , "Michael S . Tsirkin" , Paolo Bonzini Cc: Gert Wollny , qemu-devel@nongnu.org, Gurchetan Singh , Alyssa Ross , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Alex Deucher , Stefano Stabellini , =?UTF-8?q?Christian=20K=C3=B6nig?= , Xenia Ragiadakou , Honglei Huang , Julia Zhang , Chen Jiqian , Rob Clark , Yiwei Zhang , Sergio Lopez Pascual Subject: [PATCH v14 10/10] docs/system: virtio-gpu: Document host/guest requirements Date: Tue, 21 Oct 2025 02:39:49 +0300 Message-ID: <20251020233949.506088-11-dmitry.osipenko@collabora.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251020233949.506088-1-dmitry.osipenko@collabora.com> References: <20251020233949.506088-1-dmitry.osipenko@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External 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=136.143.188.15; envelope-from=dmitry.osipenko@collabora.com; helo=sender4-op-o15.zoho.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, 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_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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 dmitry.osipenko@collabora.com) X-ZM-MESSAGEID: 1761003859948158500 From: Alex Benn=C3=A9e This attempts to tidy up the VirtIO GPU documentation to make the list of requirements clearer. There are still a lot of moving parts and the distros have some catching up to do before this is all handled automatically. Signed-off-by: Alex Benn=C3=A9e Cc: Sergio Lopez Pascual Reviewed-by: Akihiko Odaki Signed-off-by: Dmitry Osipenko [dmitry.osipenko@collabora.com: Extended and corrected doc] --- docs/system/devices/virtio-gpu.rst | 100 ++++++++++++++++++++++++++++- 1 file changed, 97 insertions(+), 3 deletions(-) diff --git a/docs/system/devices/virtio-gpu.rst b/docs/system/devices/virti= o-gpu.rst index ea3eb052df3c..3324a697013f 100644 --- a/docs/system/devices/virtio-gpu.rst +++ b/docs/system/devices/virtio-gpu.rst @@ -5,14 +5,28 @@ virtio-gpu =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 This document explains the setup and usage of the virtio-gpu device. -The virtio-gpu device paravirtualizes the GPU and display controller. +The virtio-gpu device provides a GPU and display controller +paravirtualized using VirtIO. It supports a number of different modes +from simple 2D displays to fully accelerated 3D graphics. =20 -Linux kernel support --------------------- +Linux guest kernel support +-------------------------- =20 virtio-gpu requires a guest Linux kernel built with the ``CONFIG_DRM_VIRTIO_GPU`` option. =20 +3D acceleration +--------------- + +3D acceleration of a virtualized GPU is still an evolving field. +Depending on the 3D mode you are running you may need to override +distribution supplied libraries with more recent versions or enable +build options. There are a number of requirements the host must meet +to be able to be able to support guests. QEMU must be able to access the +host's GPU and for the best performance be able to reliably share GPU +memory with the guest. Details of 3D acceleration requirements are +described in a further sections. + QEMU virtio-gpu variants ------------------------ =20 @@ -65,8 +79,14 @@ intermediate representation is communicated to the host = and the `virglrenderer`_ library on the host translates the intermediate representation back to OpenGL API calls. =20 +By default OpenGL version on guest is limited to 4.3. In order to enable +OpenGL 4.6 support, virtio-gpu host blobs feature (``hostmem`` and ``blob= `` +fields) should be enabled. The ``hostmem`` field specifies the size of +virtio-gpu host memory window. This is typically between 256M and 8G. + .. parsed-literal:: -device virtio-gpu-gl + -device virtio-gpu-gl,hostmem=3D8G,blob=3Dtrue =20 .. _virgl: https://docs.mesa3d.org/drivers/virgl.html .. _Gallium3D: https://www.freedesktop.org/wiki/Software/gallium/ @@ -94,6 +114,62 @@ of virtio-gpu host memory window. This is typically bet= ween 256M and 8G. =20 .. _drm: https://gitlab.freedesktop.org/virgl/virglrenderer/-/tree/main/sr= c/drm =20 +.. list-table:: Linux Host Requirements + :header-rows: 1 + + * - Capability + - Kernel Version + - Libvirglrenderer Version + * - OpenGL pass-through + - Any Linux version compatible with QEMU if not using host blobs featu= re, + Linux 6.13+ otherwise + - 0.8.2+ + * - Vulkan pass-through + - Linux 6.13+ + - 1.0.0+ + * - AMDGPU DRM native context + - Linux 6.13+ + - 1.1.0+ + * - Freedreno DRM native context + - Linux 6.4+ + - 1.0.0+ + * - Intel i915 DRM native context + - Linux 6.13+ + - `mr1384`_ + * - Asahi DRM native context + - `Downstream version`_ of Asahi Linux kernel + - 1.2.0+ + +.. _mr1384: https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_req= uests/1384 +.. _Downstream version: https://github.com/AsahiLinux/linux + +.. list-table:: Linux Guest Requirements + :header-rows: 1 + + * - Capability + - Kernel Version + - Mesa Version + * - OpenGL pass-through + - Any Linux version supporting virtio-gpu + - 16.0.0+ + * - Vulkan pass-through + - Linux 5.16+ + - 24.2.0+ + * - AMDGPU DRM native context + - Linux 6.14+ + - 25.0.0+ + * - Freedreno DRM native context + - Linux 6.14+ + - 23.1.0+ + * - Intel i915 DRM native context + - Linux 6.14+ + - `mr29870`_ + * - Asahi DRM native context + - Linux 6.14+ + - 24.2.0+ + +.. _mr29870: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/298= 70 + virtio-gpu rutabaga ------------------- =20 @@ -133,3 +209,21 @@ Surfaceless is the default if ``wsi`` is not specified. .. _Wayland display passthrough: https://www.youtube.com/watch?v=3DOZJiHMt= IQ2M .. _gfxstream-enabled rutabaga: https://crosvm.dev/book/appendix/rutabaga_= gfx.html .. _guest Wayland proxy: https://crosvm.dev/book/devices/wayland.html + +.. list-table:: Linux Host Requirements + :header-rows: 1 + + * - Capability + - Kernel Version + * - Vulkan+Wayland pass-through + - Linux 6.13+ + +.. list-table:: Linux Guest Requirements + :header-rows: 1 + + * - Capability + - Kernel Version + - Mesa Version + * - Vulkan+Wayland pass-through + - Linux 5.16+ + - 24.3.0+ --=20 2.51.0