From patchwork Thu Aug 31 09:32:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Huang Rui X-Patchwork-Id: 13371151 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 081FAC83F34 for ; Thu, 31 Aug 2023 09:34:19 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qbe3X-0005Ja-Ux; Thu, 31 Aug 2023 05:33: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 1qbe3W-0005J7-1j for qemu-devel@nongnu.org; Thu, 31 Aug 2023 05:33:38 -0400 Received: from mail-bn8nam04on20628.outbound.protection.outlook.com ([2a01:111:f400:7e8d::628] helo=NAM04-BN8-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qbe3T-0005BW-9L for qemu-devel@nongnu.org; Thu, 31 Aug 2023 05:33:37 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LTf4S2tyeAJ1wv5Ja9xR7ec3dCfywWgvKygmrtdUhjs9lWEkJvSfSWwj/2AMuQwOWEVXtHf1BxbAGuOk7/I/QEZXo1tAkcO5NzTOgvMNs2WnHsb6w5w5nzYsHZyJiJ7VT/DXrNongn/Tjy+8WZ72f1MJZBJos+dxoMcde7rFsJWsuVwMudWbtYwntejOK9t/iv5qoaTxOqtqkUP9u6Q5I6/ip+X5VUx8sB0lkatjqMXikiZhrw+MaFbWorV1iuK0zuz7tjN4y5B1N2z9oIgwpM8DM26ccRpfpx+tjiVahxUunsyQIzJ8p2f8OiYcxx5vKLU71uxdtJpvRNsGSqIvmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OkbJyyl2hKRMbUZDjv2bheTdRoyRBB1f2ttFfpngVoY=; b=SSzdBf7bKl3y4gN3QrJ2wttXi0U5qgHql/tB/32Iu/YjEzeOhKPyn2unjVamRum5KbID7WCuS5Dc7pNFeqRiOwNx5knYJDaZxMz96j8BfTH8MFMYFDZohsARY8iR/COViZBc65e0N35l/Sb/tSb5dW/zKkvy6hJM9yMQ9TjfrRTI0c+2bSGSsoDmmxObPmM3ePDkrL3iQJFBbdNt95K1y3pFtJYSLjT50quMenVvNjqtIWR2333Cwv5e/wWGU9cFTDDMz495pBZK4Ua4Wqwiy0jO7CJrZ0uhY37Pp/L/eNUcN8w94Ehf3fZWpFwBN/TWcd84vSqizXJ3ZCQYH+u/WA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OkbJyyl2hKRMbUZDjv2bheTdRoyRBB1f2ttFfpngVoY=; b=GHWHQ297prRGui7LiTWWSZXw9ZGGy40qsgIui3WZJskBxWNyfK+lvdeAzoQ7uDr7FCwRLkn4FESh2DpiJKvFDB7Tzo8gDwEdjgN131wbGKx1ko13R3bTmPrxYh9w8NxlE0ZBjf8Qd4jj2L0xDL9xv4zCIzhRRzG4kt9AXUpXQ7c= Received: from MW4PR04CA0272.namprd04.prod.outlook.com (2603:10b6:303:89::7) by LV2PR12MB5797.namprd12.prod.outlook.com (2603:10b6:408:17b::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.20; Thu, 31 Aug 2023 09:33:32 +0000 Received: from MWH0EPF000989EA.namprd02.prod.outlook.com (2603:10b6:303:89:cafe::c3) by MW4PR04CA0272.outlook.office365.com (2603:10b6:303:89::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.20 via Frontend Transport; Thu, 31 Aug 2023 09:33:32 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by MWH0EPF000989EA.mail.protection.outlook.com (10.167.241.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6745.17 via Frontend Transport; Thu, 31 Aug 2023 09:33:31 +0000 Received: from hr-amd.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 31 Aug 2023 04:33:24 -0500 From: Huang Rui To: Gerd Hoffmann , "Michael S . Tsirkin" , Stefano Stabellini , Anthony PERARD , Antonio Caggiano , "Dr . David Alan Gilbert" , Robert Beckett , "Dmitry Osipenko" , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , CC: , Gurchetan Singh , , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Akihiko Odaki , Alyssa Ross , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , Xenia Ragiadakou , Pierre-Eric Pelloux-Prayer , "Honglei Huang" , Julia Zhang , "Chen Jiqian" , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Huang Rui Subject: [QEMU PATCH v4 02/13] virtio-gpu: CONTEXT_INIT feature Date: Thu, 31 Aug 2023 17:32:41 +0800 Message-ID: <20230831093252.2461282-3-ray.huang@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230831093252.2461282-1-ray.huang@amd.com> References: <20230831093252.2461282-1-ray.huang@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000989EA:EE_|LV2PR12MB5797:EE_ X-MS-Office365-Filtering-Correlation-Id: 8e76fc58-6ac3-4538-88ec-08dbaa05575e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wiH4UvJx8dN6O7byKREbV7UWWhKCNrvESLRrIxlKzanbDnuu+AByYxnN7rJTvNApNYMIU0tb4wzAvxf9fPDLtcyMwCKEpbQxu+WnPGA1TyvXzwlX8fhex1N2xonFzgusMIgvzU0S5nRyewCg9CeIkt7dMmrq6GBy9g9LNPI5k+oLv+6aUlAoo+lZOrk8nN+XQ2W7XSFNuNbfHgtueLHxqS+MZ8mLSvtRLyppRxJHTmmcrquyxEAuVlHsSR9GYW/w97eTGmydhy48NgKivNjK19s8MDYVfqVdQlFvoy42+V+EIec8RgaEVb6AkRdLy1ygVQvxDFFXlmI15oaoQSYNTKFN8KninnsUSE12AB6VNx0QRSeQUqElPeF88vXcoEGLdRbGRX40NbINOZyNT1uTcGBjdA74PPjqSfFlGqtQrQ+zhVuKWNt07y40EOvrjywwbgZYn1dsCXVVBS6z8GuSIoDmD1aYP9Eut8Zm0XxAYb14/KzN+rwQTyxFhHdZJN9DCa1xuwCdZMRizpw0KpnBjSMu1E3ZSsEfxfvJlSnchQeLO9M/mEi/VUWO5HxrystLEyhzxKft1ucptEXEFzBTmyMRyLSD3VMKo2hpKXnRWdBjy2KN1gBR1edtUmDvptz4AupjVxBjawqQfwFwuPej5hpJ4IYw38Lx+DovzWOxiPObppaKvg3SV0OGQhmRdmHUbdyTuNS6ntlUbnJFyWCeOQCP8s/o+PXzUzOpeVmgIL8UkESrPaDzO8dLfTFpJRszmXTjRIlDN7sulwPHV8jDUkb1EsSJ5pV1SPrzSO8SQUs= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(4636009)(396003)(136003)(376002)(346002)(39860400002)(1800799009)(82310400011)(451199024)(186009)(46966006)(40470700004)(36840700001)(36756003)(7416002)(40460700003)(40480700001)(41300700001)(86362001)(4326008)(7696005)(5660300002)(8936002)(8676002)(26005)(1076003)(16526019)(426003)(6666004)(36860700001)(47076005)(2616005)(336012)(82740400003)(110136005)(81166007)(356005)(478600001)(2906002)(70586007)(54906003)(316002)(70206006)(921005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2023 09:33:31.8866 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8e76fc58-6ac3-4538-88ec-08dbaa05575e X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MWH0EPF000989EA.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5797 Received-SPF: softfail client-ip=2a01:111:f400:7e8d::628; envelope-from=Ray.Huang@amd.com; helo=NAM04-BN8-obe.outbound.protection.outlook.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Antonio Caggiano The feature can be enabled when a backend wants it. Signed-off-by: Antonio Caggiano Signed-off-by: Gurchetan Singh Tested-by: Alyssa Ross Tested-by: Akihiko Odaki Reviewed-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Akihiko Odaki Signed-off-by: Huang Rui --- This patch is already under review as part of the "rutabaga_gfx + gfxstream" series (already in v13) and has been included here because of dependency. hw/display/virtio-gpu-base.c | 3 +++ include/hw/virtio/virtio-gpu.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/hw/display/virtio-gpu-base.c b/hw/display/virtio-gpu-base.c index ca1fb7b16f..4f2b0ba1f3 100644 --- a/hw/display/virtio-gpu-base.c +++ b/hw/display/virtio-gpu-base.c @@ -232,6 +232,9 @@ virtio_gpu_base_get_features(VirtIODevice *vdev, uint64_t features, if (virtio_gpu_blob_enabled(g->conf)) { features |= (1 << VIRTIO_GPU_F_RESOURCE_BLOB); } + if (virtio_gpu_context_init_enabled(g->conf)) { + features |= (1 << VIRTIO_GPU_F_CONTEXT_INIT); + } return features; } diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h index 390c4642b8..8377c365ef 100644 --- a/include/hw/virtio/virtio-gpu.h +++ b/include/hw/virtio/virtio-gpu.h @@ -93,6 +93,7 @@ enum virtio_gpu_base_conf_flags { VIRTIO_GPU_FLAG_EDID_ENABLED, VIRTIO_GPU_FLAG_DMABUF_ENABLED, VIRTIO_GPU_FLAG_BLOB_ENABLED, + VIRTIO_GPU_FLAG_CONTEXT_INIT_ENABLED, }; #define virtio_gpu_virgl_enabled(_cfg) \ @@ -105,6 +106,8 @@ enum virtio_gpu_base_conf_flags { (_cfg.flags & (1 << VIRTIO_GPU_FLAG_DMABUF_ENABLED)) #define virtio_gpu_blob_enabled(_cfg) \ (_cfg.flags & (1 << VIRTIO_GPU_FLAG_BLOB_ENABLED)) +#define virtio_gpu_context_init_enabled(_cfg) \ + (_cfg.flags & (1 << VIRTIO_GPU_FLAG_CONTEXT_INIT_ENABLED)) struct virtio_gpu_base_conf { uint32_t max_outputs;