From nobody Tue Feb 10 02:55:23 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=collabora.com ARC-Seal: i=1; a=rsa-sha256; t=1664203695; cv=none; d=zohomail.com; s=zohoarc; b=HQX1zqVYQ0kWgyz4k/o+IijGMC+JuQix7oaS4qYKL2HuBAwGz8GMnunnypq0Zc/2oIwUvDmtC56blMDhrS0i5+NWzS0LGBUG6jo+Eoq/0PCmfKyTjxJHIt+qs9N/BuZhacdczxhXSuEw6ucqKthqyX/Zw0G0FcbQ/MIe3F5bFR4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664203695; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=hTvH7TC/PPygXQyfzINjZ5YFaY9gsiflpA5ENcZ7epE=; b=PyXwwxSbNlsCiDM+dG3xovd3lyywUaJlGI5PXqD+lOrkmu0j1D2Hx18k5Ak+dfrvan213qhhORhZw7Rl0A8jpgBixTXu5DZtCQ43Z2qXsrU5WpDscOaEGJS3awKn0kWAlXshSHXA4KyiMIj7xHNjkFray0SQ1KDawnlZU7EoS4U= 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 1664203695279925.3865587316117; Mon, 26 Sep 2022 07:48:15 -0700 (PDT) Received: from localhost ([::1]:60468 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ocpP2-0006ni-4H for importer@patchew.org; Mon, 26 Sep 2022 10:48:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34940) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ocp2G-0003qv-8g for qemu-devel@nongnu.org; Mon, 26 Sep 2022 10:24:40 -0400 Received: from madras.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e5ab]:33176) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ocp2D-00044N-FT for qemu-devel@nongnu.org; Mon, 26 Sep 2022 10:24:38 -0400 Received: from dellino.fritz.box (host-79-27-165-192.retail.telecomitalia.it [79.27.165.192]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: fahien) by madras.collabora.co.uk (Postfix) with ESMTPSA id A779D660225F; Mon, 26 Sep 2022 15:24:34 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1664202275; bh=OPQZG7ytG7XOmX1N+cx0sIGXDh4qy3kHaMuKu0ArY9Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OYhH39S5QE+7hgL75V6B0d4WGVFcaZWpMNsWI6WkzEonwtrqIIr75ZNqoU51/ZS3t jViu+SQX2NvWI1jtaQ0A3woZ4KoplOkuuX0k9dVErU1EuTyWFCL7jFg0VxajaDFg2f nKFz6mLn4nH/gcyOy7B7hib5LKh2k9p/tFbNhNBxE65ZVMHO0a8cSkqt6HX7LyQz8r oO6ZlrzDl8ZuTrmPuwn9FQ4Aw5V+obYW4H5U73HfzGu6iNVlYr05hMHTi+nPL1R4tk jUBBxMoL/r8peQEbrMCsOfR1U0M3Qksa/zR7Leo9vcA9tXklxHA8swUtDWxyLRJnx8 j6A1hzWPYSkYA== From: Antonio Caggiano To: qemu-devel@nongnu.org Cc: gert.wollny@collabora.com, dmitry.osipenko@collabora.com, Gerd Hoffmann , "Michael S. Tsirkin" Subject: [PATCH v3 7/9] virtio-gpu: Support Venus capset Date: Mon, 26 Sep 2022 16:24:20 +0200 Message-Id: <20220926142422.22325-8-antonio.caggiano@collabora.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220926142422.22325-1-antonio.caggiano@collabora.com> References: <20220926142422.22325-1-antonio.caggiano@collabora.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=2a00:1098:0:82:1000:25:2eeb:e5ab; envelope-from=antonio.caggiano@collabora.com; helo=madras.collabora.co.uk 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, 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" X-ZohoMail-DKIM: pass (identity @collabora.com) X-ZM-MESSAGEID: 1664203696311100001 Content-Type: text/plain; charset="utf-8" Add support for the Venus capset, which enables Vulkan support through the Venus Vulkan driver for virtio-gpu. Signed-off-by: Antonio Caggiano --- v3: Improve commit message hw/display/virtio-gpu-virgl.c | 21 +++++++++++++++++---- include/standard-headers/linux/virtio_gpu.h | 2 ++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/hw/display/virtio-gpu-virgl.c b/hw/display/virtio-gpu-virgl.c index f9d8ccfdf8..16f600adbb 100644 --- a/hw/display/virtio-gpu-virgl.c +++ b/hw/display/virtio-gpu-virgl.c @@ -388,6 +388,11 @@ static void virgl_cmd_get_capset_info(VirtIOGPU *g, virgl_renderer_get_cap_set(resp.capset_id, &resp.capset_max_version, &resp.capset_max_size); + } else if (info.capset_index =3D=3D 2) { + resp.capset_id =3D VIRTIO_GPU_CAPSET_VENUS; + virgl_renderer_get_cap_set(resp.capset_id, + &resp.capset_max_version, + &resp.capset_max_size); } else { resp.capset_max_version =3D 0; resp.capset_max_size =3D 0; @@ -820,10 +825,18 @@ int virtio_gpu_virgl_init(VirtIOGPU *g) =20 int virtio_gpu_virgl_get_num_capsets(VirtIOGPU *g) { - uint32_t capset2_max_ver, capset2_max_size; + uint32_t capset2_max_ver, capset2_max_size, num_capsets; + num_capsets =3D 1; + virgl_renderer_get_cap_set(VIRTIO_GPU_CAPSET_VIRGL2, - &capset2_max_ver, - &capset2_max_size); + &capset2_max_ver, + &capset2_max_size); + num_capsets +=3D capset2_max_ver ? 1 : 0; + + virgl_renderer_get_cap_set(VIRTIO_GPU_CAPSET_VENUS, + &capset2_max_ver, + &capset2_max_size); + num_capsets +=3D capset2_max_size ? 1 : 0; =20 - return capset2_max_ver ? 2 : 1; + return num_capsets; } diff --git a/include/standard-headers/linux/virtio_gpu.h b/include/standard= -headers/linux/virtio_gpu.h index 2da48d3d4c..2db643ed8f 100644 --- a/include/standard-headers/linux/virtio_gpu.h +++ b/include/standard-headers/linux/virtio_gpu.h @@ -309,6 +309,8 @@ struct virtio_gpu_cmd_submit { =20 #define VIRTIO_GPU_CAPSET_VIRGL 1 #define VIRTIO_GPU_CAPSET_VIRGL2 2 +/* 3 is reserved for gfxstream */ +#define VIRTIO_GPU_CAPSET_VENUS 4 =20 /* VIRTIO_GPU_CMD_GET_CAPSET_INFO */ struct virtio_gpu_get_capset_info { --=20 2.34.1