[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[QEMU PATCH v4 05/13] virtio-gpu: Support context init feature with virglrenderer
- To: Gerd Hoffmann <kraxel@xxxxxxxxxx>, "Michael S . Tsirkin" <mst@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Antonio Caggiano <antonio.caggiano@xxxxxxxxxxxxx>, "Dr . David Alan Gilbert" <dgilbert@xxxxxxxxxx>, Robert Beckett <bob.beckett@xxxxxxxxxxxxx>, "Dmitry Osipenko" <dmitry.osipenko@xxxxxxxxxxxxx>, Alex Bennée <alex.bennee@xxxxxxxxxx>, <qemu-devel@xxxxxxxxxx>
- From: Huang Rui <ray.huang@xxxxxxx>
- Date: Thu, 31 Aug 2023 17:32:44 +0800
- 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
- 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=FRQ1qUyvUZQnKdi9DaXDIHpX3dEnpLy+x0X55ktio60=; b=RLQX8DX7jdtdSi2zAfPU4M282BBEwtMlARueetYyW05EPj73d1yn76cXb7BWKcEq63xLBELaOxW7/phRMSdz5kPvcK9CZ3PuEYm4vLHOHcAQpFv5VUGkyQOVAazn3BFHoL1tHmO1+7204UPhhgi1ydj6gX4cNJApI4Mdx6zGWJ57TzuUc0B2elp+NTyc1Uj1WMEBTfVQFtDIHrfn3Oi/iazaSkwlG61pSaJGBuomIXpRcliKVMswDggxYoV91HmgdQay4crogrcM5rA0CFgNOhXgHBerwZOMW9YGuNUAd/+aClX9ZczAYzOoo4qnQiK8XhkpF3NFDbRkSGCO1g8xvA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lhAMVfFYfWHgnoCmKyczvnTv91FxW8pSSHplnlvFpJt516eIQyyuvGoCTcxqBN+DshBvxOoMi28wkdwCYxMKKaafkOAcbhuu5U7xpGvyRxZKJy64vFPjhjlGuAx2RnWMCnC7Zizv5tAVL10aHBtwqYQ8/053CviGapdC4mhYAPHbnxQmmHGP6tzP3TVNWi3XIC7Ak36cryqREHJvgnLQFKIcblRzfB0t43XoJCoruzs2PQRH6wL4Yvgbo/lD+4HpSPqWTMMSbeLGBSY2ttYrLCCNdz7tVExXl8/qqJqz74eYuTVepGb91GZu9QIeSUMUNxDi5f010Vh5rrvvb5CGNA==
- Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Gurchetan Singh <gurchetansingh@xxxxxxxxxxxx>, <ernunes@xxxxxxxxxx>, Philippe Mathieu-Daudé <philmd@xxxxxxxxxx>, Akihiko Odaki <akihiko.odaki@xxxxxxxxxx>, Alyssa Ross <hi@xxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Alex Deucher <alexander.deucher@xxxxxxx>, Christian König <christian.koenig@xxxxxxx>, Xenia Ragiadakou <xenia.ragiadakou@xxxxxxx>, Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@xxxxxxx>, "Honglei Huang" <honglei1.huang@xxxxxxx>, Julia Zhang <julia.zhang@xxxxxxx>, "Chen Jiqian" <Jiqian.Chen@xxxxxxx>, Huang Rui <ray.huang@xxxxxxx>
- Delivery-date: Thu, 31 Aug 2023 09:34:02 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
Patch "virtio-gpu: CONTEXT_INIT feature" has added the context_init
feature flags.
We would like to enable the feature with virglrenderer, so add to create
virgl renderer context with flags using context_id when valid.
Originally-by: Antonio Caggiano <antonio.caggiano@xxxxxxxxxxxxx>
Signed-off-by: Huang Rui <ray.huang@xxxxxxx>
---
New patch, result of splitting
[RFC QEMU PATCH 04/18] virtio-gpu: CONTEXT_INIT feature
hw/display/virtio-gpu-virgl.c | 13 +++++++++++--
hw/display/virtio-gpu.c | 2 ++
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/hw/display/virtio-gpu-virgl.c b/hw/display/virtio-gpu-virgl.c
index 8bb7a2c21f..312953ec16 100644
--- a/hw/display/virtio-gpu-virgl.c
+++ b/hw/display/virtio-gpu-virgl.c
@@ -106,8 +106,17 @@ static void virgl_cmd_context_create(VirtIOGPU *g,
trace_virtio_gpu_cmd_ctx_create(cc.hdr.ctx_id,
cc.debug_name);
- virgl_renderer_context_create(cc.hdr.ctx_id, cc.nlen,
- cc.debug_name);
+ if (cc.context_init) {
+#ifdef HAVE_VIRGL_CONTEXT_INIT
+ virgl_renderer_context_create_with_flags(cc.hdr.ctx_id,
+ cc.context_init,
+ cc.nlen,
+ cc.debug_name);
+ return;
+#endif
+ }
+
+ virgl_renderer_context_create(cc.hdr.ctx_id, cc.nlen, cc.debug_name);
}
static void virgl_cmd_context_destroy(VirtIOGPU *g,
diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
index 3e658f1fef..a66cbd9930 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -1506,6 +1506,8 @@ static Property virtio_gpu_properties[] = {
DEFINE_PROP_BIT("blob", VirtIOGPU, parent_obj.conf.flags,
VIRTIO_GPU_FLAG_BLOB_ENABLED, false),
DEFINE_PROP_SIZE("hostmem", VirtIOGPU, parent_obj.conf.hostmem, 0),
+ DEFINE_PROP_BIT("context_init", VirtIOGPU, parent_obj.conf.flags,
+ VIRTIO_GPU_FLAG_CONTEXT_INIT_ENABLED, false),
DEFINE_PROP_END_OF_LIST(),
};
--
2.34.1
|