From nobody Tue Apr 7 12:56:59 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1773371422; cv=none; d=zohomail.com; s=zohoarc; b=hF9DA4m86QOgiJJ2ygcCNIKBvp/G7YEukSqXQpyRQkNxQHbK/eYydczzgfGEfeCzG1w642set+LroAO/6MHpFh30ctY5UrdfiDbTVeRK6m4SCvJ6dmt+FrQy8Yd3V1Mo8ceWcUP7UzFgSNC33qbdzvh9aGSCaOc1MGpqGU2EGs0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773371422; 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=zAJU8vitxZFqocH8zEKRNLY1Wna7hBU2z5rdHj3hilI=; b=kJbzMBawgpr6MQW2VPZqMrZ+Y4MYeCJTxB47PPwjNt7AXu0Fp/z5RLer457quOXpEM0aYRNltd0hPtrMwMnYl5wTE+i1jb+8ZFEdncwB30rzwluQ9sKchO2QhHSPhEohWcSHd9W21puXFyg8zxYtJS3YVJeury6ziVLgXkGsYDA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773371422549475.26192839098997; Thu, 12 Mar 2026 20:10:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w0su8-0000uc-B3; Thu, 12 Mar 2026 23:09:36 -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 1w0su7-0000uU-Ap for qemu-devel@nongnu.org; Thu, 12 Mar 2026 23:09:35 -0400 Received: from mail-dy1-x1333.google.com ([2607:f8b0:4864:20::1333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1w0su5-00017E-QB for qemu-devel@nongnu.org; Thu, 12 Mar 2026 23:09:35 -0400 Received: by mail-dy1-x1333.google.com with SMTP id 5a478bee46e88-2be8828e632so1670199eec.1 for ; Thu, 12 Mar 2026 20:09:33 -0700 (PDT) Received: from 192.168.0.29 ([2804:14d:4c71:86dd:588a:39d7:d008:37c2]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2beab52702asm902472eec.16.2026.03.12.20.09.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 12 Mar 2026 20:09:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773371372; x=1773976172; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zAJU8vitxZFqocH8zEKRNLY1Wna7hBU2z5rdHj3hilI=; b=msxM8b1BdbabuaTIDrqUJfJuH92KXbN4XphR85J0467dsnhZwbWHahqyLmJXNwaTYw 3+jMfPLnJoEe8XGKP9xu22OGD/CvbwBucXU/Hnyd1B40uiLyR/XtCe1x+lG2h09jGLbY bV63bkkBwlgvq7s+z3Lj6D+boMtfWQ9n1YZpTQcq+hFFOUDwzmRNbKAq7vyq9jg4SCQ9 puczjGHcxjQXqdhto6AOAwfCSaiiNgDUGcGgi5gfVVpbE2UaACwdX65NbsDIPvULVjsU 3c5Rt/ZrpvlMu2G3MtQyyhHH43sohj9OxfPpNXL771GYuwjzmpdI7Y4tLGUcEH2kFu5C 1gJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773371372; x=1773976172; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=zAJU8vitxZFqocH8zEKRNLY1Wna7hBU2z5rdHj3hilI=; b=hby0nY089I9bnL+uxFq1IBU2qLLNV7QriyExld6/r/p+GMx5ql1uXpfbiwWEX1SiBa BTk9Zk/i28XOfiu30isfERgTM8gQSKrdL+BycJVR9BhWpavnCZh+XghrT4Q61JresHTT 9NTOS0mbrsGnW5P3TWhO0Cru4Hg/O6p//oJG/iE37nUTUftPAkOl+6fNTzZC+jMdVwuN nxBe7lWis+IILM8YiU/TpxEAZhgDZLD5MuE/d7UEm4UtWjYppotpLCtih0H8dgOL1jiv QrdpXj4C1acfMfy6J5lnqaHnqKqzwSAJdQm+f1Y0zpd5/sQe7F/8RW7cgd5epA53W9h3 z3JA== X-Gm-Message-State: AOJu0YwCS7EiCG76GTlCVECLpW55IQxUl+HtMyjEwdeSkovrP9Hvs6pA 1NVnq7uzNU3V6dKaMQOpEnzCdtjcQ51CWEgJLIFfmb9HhAJ6Wj7aXjSO8xNKq90P X-Gm-Gg: ATEYQzwE8YcdFP7IC+MD00kQZ2XMsOHokc3RCv6H6L1W37fC+qFEo5fSYVXKVPKqAF9 l0FGX5MVGKdI0n40FmeOr7nE6XBz4r/uYqkqylXo/3IRFBTETQlaH2SSJbPYqfbkekhJzEU5yHw GcROfc3iyiQvrZU1OpwypAdtHw717BeGqbmJ7rL3z6a4tmhkAPW+OS4Jh4noJbacUP+Hhe9Mew7 WMk4LDfKpWAGo2BvrGjbHS+WzKuRbAYANfc3zaTZC9vkuzfMmhPBxrx6E0AcCR2Aqq+M8grUbRE KkHPU0DmV6vIf1NEgNnCkSgpfzPvgJl1ePjbuc/WR54oUgo4HaSXRIyp/XhisTU+BZ33qOAL4lE /3aYESKdHzqnoyB0+DxvTr1+rGpRaTbE/GoP47Uy6ELQ/IBlGNJPLsGOCiGltXogh/NuT9CVh7n PV3PeHFSW4gdW1I8wv6vqMtREd7YDN2LaElUmLbsmOUwZIpLruxTI= X-Received: by 2002:a05:7301:1e84:b0:2be:12ca:b33a with SMTP id 5a478bee46e88-2bea5508dbamr783407eec.13.1773371372098; Thu, 12 Mar 2026 20:09:32 -0700 (PDT) From: Lucas Amaral To: qemu-devel@nongnu.org Cc: alex.bennee@linaro.org, dmitry.osipenko@collabora.com, marcandre.lureau@redhat.com, Lucas Amaral Subject: [PATCH v3 1/3] ui: introduce GRAPHIC_FLAGS_VK for Vulkan scanout Date: Fri, 13 Mar 2026 00:09:22 -0300 Message-ID: <20260313030924.45299-2-lucaaamaral@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260313030924.45299-1-lucaaamaral@gmail.com> References: <20260311022752.64192-1-lucaaamaral@gmail.com> <20260313030924.45299-1-lucaaamaral@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1333; envelope-from=lucaaamaral@gmail.com; helo=mail-dy1-x1333.google.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, FREEMAIL_FROM=0.001, FSL_HELO_BARE_IP_2=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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: qemu development 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 @gmail.com) X-ZM-MESSAGEID: 1773371424235154100 Content-Type: text/plain; charset="utf-8" Define GRAPHIC_FLAGS_VK (bit 2) in the console flags for future Vulkan scanout support. The compatibility check currently returns an error indicating the feature is not yet implemented. This prepares the display framework for direct Vulkan scanout alongside the existing GL and DMABUF paths. Signed-off-by: Lucas Amaral --- include/ui/console.h | 2 ++ ui/console.c | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/include/ui/console.h b/include/ui/console.h index 3677a9d3..19ac06e0 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -361,6 +361,8 @@ enum { GRAPHIC_FLAGS_GL =3D 1 << 0, /* require a console/display with DMABUF import */ GRAPHIC_FLAGS_DMABUF =3D 1 << 1, + /* TODO: require a console/display with Vulkan scanout */ + GRAPHIC_FLAGS_VK =3D 1 << 2, }; =20 typedef struct GraphicHwOps { diff --git a/ui/console.c b/ui/console.c index f445db11..d29733ad 100644 --- a/ui/console.c +++ b/ui/console.c @@ -594,6 +594,14 @@ static bool console_compatible_with(QemuConsole *con, return false; } =20 + if (flags & GRAPHIC_FLAGS_VK) { + /* TODO: check for Vulkan scanout support in display backend */ + error_setg(errp, + "The console requires Vulkan scanout " + "(not yet implemented)."); + return false; + } + return true; } =20 --=20 2.52.0 From nobody Tue Apr 7 12:56:59 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1773371422; cv=none; d=zohomail.com; s=zohoarc; b=CjwB8Ni2ebgeFuUE2Njy7eu+vaW7BRl6Yt7RDjcfH7MPsqF4J3K75yjtHoCLyYARk6M1ozDjp6LsYqXc9PKaRjI4wKhvOe5fK4Tg/G2oRqwa4Ka6KODXKxBXPQn/RwrND3K9xwVVHlrCPMiEHrkEyUtW31Ux7fhWV5nYr4mgbrw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773371422; 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=ZKSlRl0lx/YLN+KVvYwpjhdZ0FCwz6Or6UxEaCvL87w=; b=NCGxH+hxMvDop0P6j40CXDoIirgZVlAUCAyrGAE0Vkd1Zi4UnAh2PKhLg0eh/t3eNowP7zKz/jaDkhFUbmLdKCmYnfzHXbbgyLddNx+OmuavoY1oLEFrOTxVO3lvHFdPsDPPYEcxH3Ca5p0od2qDK0o3hhjMDauGobGYc8E30d0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773371422549177.33442738121914; Thu, 12 Mar 2026 20:10:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w0suB-0000vB-QZ; Thu, 12 Mar 2026 23:09: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 1w0suA-0000uu-EB for qemu-devel@nongnu.org; Thu, 12 Mar 2026 23:09:38 -0400 Received: from mail-dl1-x1234.google.com ([2607:f8b0:4864:20::1234]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1w0su8-00017i-BK for qemu-devel@nongnu.org; Thu, 12 Mar 2026 23:09:38 -0400 Received: by mail-dl1-x1234.google.com with SMTP id a92af1059eb24-12732e6a123so1571407c88.1 for ; Thu, 12 Mar 2026 20:09:35 -0700 (PDT) Received: from 192.168.0.29 ([2804:14d:4c71:86dd:588a:39d7:d008:37c2]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2beab52702asm902472eec.16.2026.03.12.20.09.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 12 Mar 2026 20:09:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773371374; x=1773976174; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZKSlRl0lx/YLN+KVvYwpjhdZ0FCwz6Or6UxEaCvL87w=; b=ZP26BynJVL49JNPFIrVXMq/7MKq7ammLYCfFKrEwHiRkArpDNlfWH2xH5tf+s6HR8i xz6bwNSwFCan+iKUFLCTqXv/EtswocnDW743dgbg1lGdOcagufpVUMcxyltVCqAxYHBV +9fweKAE6qRpyuIihDWilFaeMltBA3EUqQRpgw1mQdiM8KCiM6DOEAA4HCJVRPkpFAtd mOwjHoUHf5uV3Hk0pb7NQqTVV4l0oKg/5pizVZ9J8wa5/541RTLZypMRLUL14Hveo6pi XAExwm0h53+JKO3AbgTF2SifhGTORm25cl+HX3Wvxwmn90iTitcOSLitad1WUdDl/3Dv VipA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773371374; x=1773976174; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ZKSlRl0lx/YLN+KVvYwpjhdZ0FCwz6Or6UxEaCvL87w=; b=On7p95+bf1fLdoPz8DRw4y5PutnMTK6dMMKekAHaZUaUHhyln1jtkBZU0h/KPEU4Gg f/87tNjx3bGxCCX5AxXcPf+ZGe6LAY/CjxxJ7DW9TJH2IYYdWjTBWkPEQvEkW5D8kkaL tvLNfDlsA5rZzYJPsJIf4ZfBLsqDuNlFyOqfJk9XGaxqNv76Sy47QYMSOmcC2S2f0G4K u6lI8v2xfZOG253E6OOhJX3e+vUfOitd0fjaWNVLjnRoomf6iTSdeG4RwWznJOVvN4i+ 5b+YgUZg6/Vp4e5ABj0hCUQNWtF8optBLBCPYL8ELD2cqYth/n8DwerCO50CiR2rmrAm Bzow== X-Gm-Message-State: AOJu0Yzuq82VpfjfPZTCqZAk05db9wxrOFTtB3dZa6MC5cuxBOuo9P9O Hv2a2kJWQKGGCadj34v+72mtENgnXFqqAHlOsSFrQ/4tyW07XVr2vrCSVlz53fD/ X-Gm-Gg: ATEYQzxdlnErmSetzHtDWCTjw8aeZT5FctK5yeNK0oK5qGaadP4GfzoGXJ0Cx2tTF1/ EPxs7tIYWLdMCyGyb2F5t4kmNUtFO6QSEQgDJQAzl8nuRl0u4G4ECt0VxvPNQZn2kB75E85LNWT L6XNs7AqlsxFGn5YRjf2NpYSG02RgyIqZneve+jDFNUe+Onwzgvhat9OPq7HupXhuhUPtyLvhVg J/RTqU20JqE+TYxFwP9T8qo2tG9urGt2zJLU8DnGJdi8y3jNTiXOGA72Oe07CH2IUZbiLFWI4ol o4tIsRc/EMC9f1rtMIDP2R7CEKaQ04D5aMnuG/oZTvahYyjAVns38UTCKqYKDhZiGabOiqgEtbK x5nPmz4zVs5rZjE6g//sTFa+SM/0DsGZs9ZbVO86Ddl58pDyRj5Plz8jZkO9u+9iS+tH8RcdEyu QH8qApvnrYTwwQSWtq79cTeMAyjrx7eSn+7g8hQsGVMGI0mkYYwgM= X-Received: by 2002:a05:7300:2389:b0:2be:617:2dec with SMTP id 5a478bee46e88-2bea54973f3mr949447eec.17.1773371374440; Thu, 12 Mar 2026 20:09:34 -0700 (PDT) From: Lucas Amaral To: qemu-devel@nongnu.org Cc: alex.bennee@linaro.org, dmitry.osipenko@collabora.com, marcandre.lureau@redhat.com, Lucas Amaral Subject: [PATCH v3 2/3] virtio-gpu: decouple Venus from CONFIG_OPENGL Date: Fri, 13 Mar 2026 00:09:23 -0300 Message-ID: <20260313030924.45299-3-lucaaamaral@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260313030924.45299-1-lucaaamaral@gmail.com> References: <20260311022752.64192-1-lucaaamaral@gmail.com> <20260313030924.45299-1-lucaaamaral@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1234; envelope-from=lucaaamaral@gmail.com; helo=mail-dl1-x1234.google.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, FREEMAIL_FROM=0.001, FSL_HELO_BARE_IP_2=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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: qemu development 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 @gmail.com) X-ZM-MESSAGEID: 1773371424356154100 Venus (virtio-gpu Vulkan context) currently requires an OpenGL display backend due to build-time and runtime coupling. On macOS, no OpenGL display backend exists. Remove the opengl.found() build requirement for the virtio-gpu-gl module; virglrenderer provides Venus independently of OpenGL. Gate GL-specific code paths behind CONFIG_OPENGL and display_opengl: - Only advertise VIRGL/VIRGL2 capsets when display_opengl is set - Only pass VIRGL_RENDERER_NO_VIRGL when !display_opengl with Venus - Null out GL context callbacks when no GL display is available - Route 2D display commands to the software renderer (pixman) when Venus runs without GL (venus no-GL mode) - Allow Venus to bypass the OpenGL display check at device realize Signed-off-by: Lucas Amaral --- hw/display/meson.build | 8 ++-- hw/display/virtio-gpu-base.c | 15 ++++++- hw/display/virtio-gpu-gl.c | 6 ++- hw/display/virtio-gpu-virgl.c | 85 ++++++++++++++++++++++++++++++----- 4 files changed, 98 insertions(+), 16 deletions(-) diff --git a/hw/display/meson.build b/hw/display/meson.build index 90e6c041..509479e7 100644 --- a/hw/display/meson.build +++ b/hw/display/meson.build @@ -76,9 +76,9 @@ if config_all_devices.has_key('CONFIG_VIRTIO_GPU') virtio_gpu_ss.add(when: 'CONFIG_VHOST_USER_GPU', if_true: files('vhost-u= ser-gpu.c')) hw_display_modules +=3D {'virtio-gpu': virtio_gpu_ss} =20 - if virgl.found() and opengl.found() + if virgl.found() virtio_gpu_gl_ss =3D ss.source_set() - virtio_gpu_gl_ss.add(when: ['CONFIG_VIRTIO_GPU', virgl, opengl], + virtio_gpu_gl_ss.add(when: ['CONFIG_VIRTIO_GPU', virgl], if_true: [files('virtio-gpu-gl.c', 'virtio-gpu-vi= rgl.c'), pixman, virgl]) hw_display_modules +=3D {'virtio-gpu-gl': virtio_gpu_gl_ss} endif @@ -99,9 +99,9 @@ if config_all_devices.has_key('CONFIG_VIRTIO_PCI') if_true: files('vhost-user-gpu-pci.c')) hw_display_modules +=3D {'virtio-gpu-pci': virtio_gpu_pci_ss} =20 - if virgl.found() and opengl.found() + if virgl.found() virtio_gpu_pci_gl_ss =3D ss.source_set() - virtio_gpu_pci_gl_ss.add(when: ['CONFIG_VIRTIO_GPU', 'CONFIG_VIRTIO_PC= I', virgl, opengl], + virtio_gpu_pci_gl_ss.add(when: ['CONFIG_VIRTIO_GPU', 'CONFIG_VIRTIO_PC= I', virgl], if_true: [files('virtio-gpu-pci-gl.c'), pixma= n]) hw_display_modules +=3D {'virtio-gpu-pci-gl': virtio_gpu_pci_gl_ss} endif diff --git a/hw/display/virtio-gpu-base.c b/hw/display/virtio-gpu-base.c index cb76302e..cc9704cd 100644 --- a/hw/display/virtio-gpu-base.c +++ b/hw/display/virtio-gpu-base.c @@ -18,6 +18,7 @@ #include "qapi/error.h" #include "qemu/error-report.h" #include "hw/display/edid.h" +#include "system/system.h" #include "trace.h" #include "qapi/qapi-types-virtio.h" =20 @@ -157,7 +158,18 @@ virtio_gpu_get_flags(void *opaque) VirtIOGPUBase *g =3D opaque; int flags =3D GRAPHIC_FLAGS_NONE; =20 - if (virtio_gpu_virgl_enabled(g->conf)) { + if (virtio_gpu_venus_enabled(g->conf)) { + /* TODO: set GRAPHIC_FLAGS_VK for direct Vulkan scanout */ + } + + /* + * TODO: virtio_gpu_virgl_enabled() checks VIRTIO_GPU_FLAG_VIRGL_ENABL= ED + * which is set for both OpenGL (VIRGL) and Vulkan (Venus) backends. + * This condition should ideally use a dedicated OpenGL-only flag. For + * now, display_opengl correctly gates GL scanout since Venus leaves it + * at 0. + */ + if (virtio_gpu_virgl_enabled(g->conf) && display_opengl) { flags |=3D GRAPHIC_FLAGS_GL; } =20 @@ -273,6 +285,7 @@ virtio_gpu_base_get_features(VirtIODevice *vdev, uint64= _t features, } if (virtio_gpu_blob_enabled(g->conf)) { features |=3D (1 << VIRTIO_GPU_F_RESOURCE_BLOB); + features |=3D (1 << VIRTIO_GPU_F_BLOB_ALIGNMENT); } if (virtio_gpu_context_init_enabled(g->conf)) { features |=3D (1 << VIRTIO_GPU_F_CONTEXT_INIT); diff --git a/hw/display/virtio-gpu-gl.c b/hw/display/virtio-gpu-gl.c index 2b7a41c4..67d88e32 100644 --- a/hw/display/virtio-gpu-gl.c +++ b/hw/display/virtio-gpu-gl.c @@ -124,7 +124,9 @@ static void virtio_gpu_gl_device_realize(DeviceState *q= dev, Error **errp) return; } =20 - if (!display_opengl) { + if (virtio_gpu_venus_enabled(g->parent_obj.conf)) { + /* Venus renders via Vulkan in the render server */ + } else if (!display_opengl) { error_setg(errp, "The display backend does not have OpenGL support enabl= ed"); error_append_hint(errp, @@ -245,4 +247,6 @@ static void virtio_register_types(void) type_init(virtio_register_types) =20 module_dep("hw-display-virtio-gpu"); +#ifdef CONFIG_OPENGL module_dep("ui-opengl"); +#endif diff --git a/hw/display/virtio-gpu-virgl.c b/hw/display/virtio-gpu-virgl.c index b7a2d160..2f9700e0 100644 --- a/hw/display/virtio-gpu-virgl.c +++ b/hw/display/virtio-gpu-virgl.c @@ -19,8 +19,10 @@ #include "hw/virtio/virtio-gpu.h" #include "hw/virtio/virtio-gpu-bswap.h" #include "hw/virtio/virtio-gpu-pixman.h" - +#include "system/system.h" +#ifdef CONFIG_OPENGL #include "ui/egl-helpers.h" +#endif =20 #include =20 @@ -50,6 +52,16 @@ struct virtio_gpu_virgl_resource { void *map_fixed; }; =20 +/* + * Venus no-GL mode: Venus is enabled but no OpenGL display is available. + * Display commands use software (pixman) rendering; Venus/3D commands + * go through the virglrenderer render server. + */ +static bool virtio_gpu_venus_nogl(VirtIOGPU *g) +{ + return virtio_gpu_venus_enabled(g->parent_obj.conf) && !display_opengl; +} + static struct virtio_gpu_virgl_resource * virtio_gpu_virgl_find_resource(VirtIOGPU *g, uint32_t resource_id) { @@ -63,7 +75,7 @@ virtio_gpu_virgl_find_resource(VirtIOGPU *g, uint32_t res= ource_id) return container_of(res, struct virtio_gpu_virgl_resource, base); } =20 -#if VIRGL_RENDERER_CALLBACKS_VERSION >=3D 4 +#if VIRGL_RENDERER_CALLBACKS_VERSION >=3D 4 && defined(CONFIG_OPENGL) static void * virgl_get_egl_display(G_GNUC_UNUSED void *cookie) { @@ -1032,6 +1044,45 @@ void virtio_gpu_virgl_process_cmd(VirtIOGPU *g, =20 VIRTIO_GPU_FILL_CMD(cmd->cmd_hdr); =20 + /* + * Venus no-GL mode: route 2D display commands to the base software + * renderer (pixman). The guest kernel always uses 2D commands for + * display framebuffers even with VIRGL enabled; Venus/3D commands + * go through the virglrenderer render server as usual. + */ + if (virtio_gpu_venus_nogl(g)) { + switch (cmd->cmd_hdr.type) { + case VIRTIO_GPU_CMD_RESOURCE_CREATE_2D: + case VIRTIO_GPU_CMD_SET_SCANOUT: + case VIRTIO_GPU_CMD_RESOURCE_FLUSH: + case VIRTIO_GPU_CMD_TRANSFER_TO_HOST_2D: + case VIRTIO_GPU_CMD_GET_DISPLAY_INFO: + case VIRTIO_GPU_CMD_GET_EDID: + virtio_gpu_simple_process_cmd(g, cmd); + return; + case VIRTIO_GPU_CMD_RESOURCE_UNREF: + case VIRTIO_GPU_CMD_RESOURCE_ATTACH_BACKING: + case VIRTIO_GPU_CMD_RESOURCE_DETACH_BACKING: { + /* + * Both 2D (simple) and blob (virgl) resources share g->reslis= t. + * Check if virglrenderer owns the resource to pick + * the right handler. + */ + struct virtio_gpu_resource_unref hdr; + struct virgl_renderer_resource_info info; + VIRTIO_GPU_FILL_CMD(hdr); + if (virgl_renderer_resource_get_info(hdr.resource_id, &info)) { + /* Not in virglrenderer =E2=80=94 it's a 2D software resou= rce */ + virtio_gpu_simple_process_cmd(g, cmd); + return; + } + break; /* virglrenderer owns it =E2=80=94 fall through */ + } + default: + break; + } + } + virgl_renderer_force_ctx_0(); switch (cmd->cmd_hdr.type) { case VIRTIO_GPU_CMD_CTX_CREATE: @@ -1433,6 +1484,7 @@ static int virtio_gpu_virgl_init(VirtIOGPU *g) uint32_t flags =3D 0; VirtIOGPUGL *gl =3D VIRTIO_GPU_GL(g); =20 +#ifdef CONFIG_OPENGL #if VIRGL_RENDERER_CALLBACKS_VERSION >=3D 4 if (qemu_egl_display) { virtio_gpu_3d_cbs.version =3D 4; @@ -1450,9 +1502,14 @@ static int virtio_gpu_virgl_init(VirtIOGPU *g) flags |=3D VIRGL_RENDERER_D3D11_SHARE_TEXTURE; } #endif +#endif /* CONFIG_OPENGL */ #if VIRGL_VERSION_MAJOR >=3D 1 if (virtio_gpu_venus_enabled(g->parent_obj.conf)) { - flags |=3D VIRGL_RENDERER_VENUS | VIRGL_RENDERER_RENDER_SERVER; + flags |=3D VIRGL_RENDERER_VENUS + | VIRGL_RENDERER_RENDER_SERVER; + if (!display_opengl) { + flags |=3D VIRGL_RENDERER_NO_VIRGL; + } } if (virtio_gpu_drm_enabled(g->parent_obj.conf)) { flags |=3D VIRGL_RENDERER_DRM; @@ -1475,6 +1532,12 @@ static int virtio_gpu_virgl_init(VirtIOGPU *g) } #endif =20 + if (!display_opengl) { + virtio_gpu_3d_cbs.create_gl_context =3D NULL; + virtio_gpu_3d_cbs.destroy_gl_context =3D NULL; + virtio_gpu_3d_cbs.make_current =3D NULL; + } + ret =3D virgl_renderer_init(g, flags, &virtio_gpu_3d_cbs); if (ret !=3D 0) { error_report("virgl could not be initialized: %d", ret); @@ -1546,14 +1609,16 @@ GArray *virtio_gpu_virgl_get_capsets(VirtIOGPU *g) =20 capset_ids =3D g_array_new(false, false, sizeof(uint32_t)); =20 - /* VIRGL is always supported. */ - virtio_gpu_virgl_add_capset(capset_ids, VIRTIO_GPU_CAPSET_VIRGL); + /* OpenGL: VIRGL/VIRGL2 require a GL display backend */ + if (display_opengl) { + virtio_gpu_virgl_add_capset(capset_ids, VIRTIO_GPU_CAPSET_VIRGL); =20 - virgl_renderer_get_cap_set(VIRTIO_GPU_CAPSET_VIRGL2, - &capset_max_ver, - &capset_max_size); - if (capset_max_ver) { - virtio_gpu_virgl_add_capset(capset_ids, VIRTIO_GPU_CAPSET_VIRGL2); + virgl_renderer_get_cap_set(VIRTIO_GPU_CAPSET_VIRGL2, + &capset_max_ver, + &capset_max_size); + if (capset_max_ver) { + virtio_gpu_virgl_add_capset(capset_ids, VIRTIO_GPU_CAPSET_VIRG= L2); + } } =20 if (virtio_gpu_venus_enabled(g->parent_obj.conf)) { --=20 2.52.0 From nobody Tue Apr 7 12:56:59 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1773371422; cv=none; d=zohomail.com; s=zohoarc; b=hU7kg7vHYS7QcWQiXWbkueJeprO9Rsx6xTq7apozcXbUA6jQr/NkDDUg+oYpjA8pljNNe/rhyom+D+xGMuRzAY2RqN0V8adMFz0xKN2hPsVE0nRkz20owFHpEQs+ot1Fci6BW9UKG1FWCk0tN8Swe9FZGoW6LwkvntfzRy4gVE0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773371422; 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=yzfjk3WBN6i3CkQe1TmyF3J36CtVBQdyaJf9bxHnuwE=; b=hEipsFiJXfCyRcLupV6GZ9EoD30dz2IHQpmWADwylBRLTWL98PUU6sHKrPTaOvcL8WwLaLUrrdUHJq+y1Guur5YHIDk/jodKZ92huqcpz+CycksWFd5d61G6u5c7nM/G6EbIW4cl7ISpXrPcdHRSqxce0ZCNd/iIBDfWnf7srvA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773371422364583.3994250822477; Thu, 12 Mar 2026 20:10:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w0suE-0000w1-Vv; Thu, 12 Mar 2026 23:09:43 -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 1w0suC-0000vT-Qd for qemu-devel@nongnu.org; Thu, 12 Mar 2026 23:09:40 -0400 Received: from mail-dy1-x1336.google.com ([2607:f8b0:4864:20::1336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1w0suB-00017u-5J for qemu-devel@nongnu.org; Thu, 12 Mar 2026 23:09:40 -0400 Received: by mail-dy1-x1336.google.com with SMTP id 5a478bee46e88-2bea8a1c040so302013eec.0 for ; Thu, 12 Mar 2026 20:09:38 -0700 (PDT) Received: from 192.168.0.29 ([2804:14d:4c71:86dd:588a:39d7:d008:37c2]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2beab52702asm902472eec.16.2026.03.12.20.09.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 12 Mar 2026 20:09:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773371377; x=1773976177; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yzfjk3WBN6i3CkQe1TmyF3J36CtVBQdyaJf9bxHnuwE=; b=hgR9Zsd7Gss83E3hTeJDdCYF26V8bFI98bh1oRsJ3FnNZEFLOdgrOwdHX3zvFPYs7B YMmltrqSJ34328shCLqUWOriJ8BxBoH3JdZPpveN8xuxkIIxjlJgDT4by5xY11vSEDn9 YQ3dAUAvvJ9fcSwEb7pO4p86s++QluYipW9/ReuS/LRTsKh/X6aAi93OjzaaGuXQ5vk5 Bb/GAZUoeOoNrofExlKLT4xYpU+LBL+0vUsgQTltzEko/L617pGKjeGjp3/tV+MEYU95 GVRZoVlo3DM5QwKs95xgHeam3deI3HrV6Yt7O2TKZwKN1hYXPkyWxVHBX38mGc2DxS7D GIJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773371377; x=1773976177; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=yzfjk3WBN6i3CkQe1TmyF3J36CtVBQdyaJf9bxHnuwE=; b=kYULqZg0hckPZxwo2nfIdpwXjvWtyiHBW1UKGPIpfGeY6kzgjA12WZwCLQ1T760B0L jnJO2kekv8giT6JNzKrd+hi8kXmDWRJMcXkPQ1+30guf0BpXmNHQYCoadWaJG7hDrJoM Z3GNF6aNfPBGnD2ogrJRdhl3BiU8suyfP6lgAKZbHxkJQHR5cJ/F3Q1UA8wltJ4ZPGoz o3iRzph11ttY/DUzy+PSBn0WeB0P9B84K2CA5UTtLJs68qslOenczI1mr/LlQygV6bRK D5RrmTvYA/wwpYRwtf28ITpzerLws6rQkrayhBHvTqKJbjqL2bSXeEwn953eALf2sdRv WusA== X-Gm-Message-State: AOJu0Yzwa0VsEDq4PaWqf0EWSBRWo9jRwxInZPPZ0wqvMWl0V1+Sosin 906yvApVG3Cq1pEIJi7zKtRdmAoB/5igWNgglB2j5L8Vb7tb/5DfkJSrh18JurhL X-Gm-Gg: ATEYQzxqrsqzut0uaqDVtfe0m9PKhsgoRTn59unChCyYYGRwAYGFxQjLYIKcxyBXhE4 aYivz0JlSpHZcmsqObEmlPHTDPoTR4B/d19wrH7uniu0v75xVVj0WSHXcdSYJiYSdyquiqgCWMq BnRbHaZhco1C0LErTnFt2TLjGeIBjipe6hu/OLfToFgFeuJmtu4AhYT+QD9rar9MXohgqfCd3Sl mad8dnyGOZj2Z7N7b79lf+bJBn/vRuQRAUQMt2+7JB4UUFeC2PZY/xHj2IPxGhDXrns/YCEWwVU 8RtJqePx8beN3t/EfMMhtbzqq8YrQHq7LxiiiqS7DY1WJOV/JhfGxMGaUPvUN5IHBEtVFQeir0R sqMQgyYfXwKZqGXNEcAdov/4TI//G7DEI8td47Np7914p2+rMeUfYT8JJowugLKGY0hs0Ip7SVQ YRNQ6ePUnbXMyP31H3c7iZAiahK5R75X4t70TNsdrU8na6o+ORROw= X-Received: by 2002:a05:7301:10c4:b0:2be:9e34:fd24 with SMTP id 5a478bee46e88-2bea5537045mr813515eec.34.1773371377309; Thu, 12 Mar 2026 20:09:37 -0700 (PDT) From: Lucas Amaral To: qemu-devel@nongnu.org Cc: alex.bennee@linaro.org, dmitry.osipenko@collabora.com, marcandre.lureau@redhat.com, Lucas Amaral Subject: [PATCH v3 3/3] virtio-gpu: advertise VIRTIO_GPU_F_BLOB_ALIGNMENT Date: Fri, 13 Mar 2026 00:09:24 -0300 Message-ID: <20260313030924.45299-4-lucaaamaral@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260313030924.45299-1-lucaaamaral@gmail.com> References: <20260311022752.64192-1-lucaaamaral@gmail.com> <20260313030924.45299-1-lucaaamaral@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1336; envelope-from=lucaaamaral@gmail.com; helo=mail-dy1-x1336.google.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, FREEMAIL_FROM=0.001, FSL_HELO_BARE_IP_2=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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: qemu development 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 @gmail.com) X-ZM-MESSAGEID: 1773371424218154100 Content-Type: text/plain; charset="utf-8" Define VIRTIO_GPU_F_BLOB_ALIGNMENT (feature bit 5) per the OASIS virtio specification. This allows the host to communicate its memory alignment requirement to the guest via the blob_alignment field in virtio_gpu_config. Set blob_alignment to the host page size so the guest kernel can align blob BAR offsets accordingly, avoiding alignment mismatches with the VMM's memory mapping API (e.g., hv_vm_map on macOS). Guest-side kernel support (drm_mm alignment) is pending upstream Linux merge. Signed-off-by: Lucas Amaral --- hw/display/virtio-gpu.c | 8 ++++++++ include/standard-headers/linux/virtio_gpu.h | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index de7a86a7..44ae5034 100644 --- a/hw/display/virtio-gpu.c +++ b/hw/display/virtio-gpu.c @@ -1532,6 +1532,14 @@ void virtio_gpu_device_realize(DeviceState *qdev, Er= ror **errp) #endif } =20 + /* + * TODO: guest-side F_BLOB_ALIGNMENT support pending upstream Linux me= rge + * (Sergio Lopez's patches, Nov 2025). Until merged, the guest won't + * negotiate this feature. The host advertises it per OASIS virtio spe= c. + */ + g->parent_obj.virtio_config.blob_alignment =3D + cpu_to_le32(qemu_real_host_page_size()); + if (!virtio_gpu_base_device_realize(qdev, virtio_gpu_handle_ctrl_cb, virtio_gpu_handle_cursor_cb, diff --git a/include/standard-headers/linux/virtio_gpu.h b/include/standard= -headers/linux/virtio_gpu.h index 00cd3f04..252704e7 100644 --- a/include/standard-headers/linux/virtio_gpu.h +++ b/include/standard-headers/linux/virtio_gpu.h @@ -64,6 +64,11 @@ * context_init and multiple timelines */ #define VIRTIO_GPU_F_CONTEXT_INIT 4 +/* + * VIRTIO_GPU_F_BLOB_ALIGNMENT: device advertises blob_alignment + * in virtio_gpu_config (OASIS virtio-spec feature bit 5) + */ +#define VIRTIO_GPU_F_BLOB_ALIGNMENT 5 =20 enum virtio_gpu_ctrl_type { VIRTIO_GPU_UNDEFINED =3D 0, @@ -365,6 +370,7 @@ struct virtio_gpu_config { uint32_t events_clear; uint32_t num_scanouts; uint32_t num_capsets; + uint32_t blob_alignment; }; =20 /* simple formats for fbcon/X use */ --=20 2.52.0