[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241220100409.4007346-2-honglei1.huang@amd.com>
Date: Fri, 20 Dec 2024 18:04:08 +0800
From: Honglei Huang <honglei1.huang@....com>
To: Huang Rui <ray.huang@....com>,
<virtualization@...ts.linux-foundation.org>, <linux-kernel@...r.kernel.org>,
Dmitry Osipenko <dmitry.osipenko@...labora.com>,
<dri-devel@...ts.freedesktop.org>, David Airlie <airlied@...hat.com>, "Gerd
Hoffmann" <kraxel@...hat.com>, Gurchetan Singh <gurchetansingh@...omium.org>,
Chia-I Wu <olvaffe@...il.com>, Daniel Vetter <daniel.vetter@...ll.ch>,
Akihiko Odaki <akihiko.odaki@...nix.com>
CC: Lingshan Zhu <Lingshan.Zhu@....com>, Demi Marie Obenour
<demiobenour@...il.com>, Honglei Huang <Honglei1.Huang@....com>
Subject: [RFC PATCH 2/3] drm/virtgpu api: add blob userptr resource
From: Honglei Huang <Honglei1.Huang@....com>
This makes blob userptr resource available to guest userspace.
- Flag VIRTGPU_BLOB_FLAG_USE_USERPTR for guest userspace blob create,
enable this flag to indicate blob userptr resource create.
- New parameter blob_userptr for bypass userspace memory address to
virtio GPU, like other SVM design, virtio GPU needs a userspace
memory for device access.
- New parameter offset used for the already created blob userptr
resource to get the address offset between the create one.
The blob userptr resource is used for SVM feature, in compute side,
this feature is must needed. like in OpenCL SVM feature also called
userptr feature, it is for let device to access userspace memory,
a very basic and important feature to prevent large memory copy between
UMD and KMD.
Signed-off-by: Honglei Huang <Honglei1.Huang@....com>
---
include/uapi/drm/virtgpu_drm.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/uapi/drm/virtgpu_drm.h b/include/uapi/drm/virtgpu_drm.h
index 2bb2d3a0c7bd..19fced75708c 100644
--- a/include/uapi/drm/virtgpu_drm.h
+++ b/include/uapi/drm/virtgpu_drm.h
@@ -181,6 +181,7 @@ struct drm_virtgpu_resource_create_blob {
#define VIRTGPU_BLOB_FLAG_USE_MAPPABLE 0x0001
#define VIRTGPU_BLOB_FLAG_USE_SHAREABLE 0x0002
#define VIRTGPU_BLOB_FLAG_USE_CROSS_DEVICE 0x0004
+#define VIRTGPU_BLOB_FLAG_USE_USERPTR 0x0008
/* zero is invalid blob_mem */
__u32 blob_mem;
__u32 blob_flags;
@@ -196,6 +197,8 @@ struct drm_virtgpu_resource_create_blob {
__u32 cmd_size;
__u64 cmd;
__u64 blob_id;
+ __u64 blob_userptr;
+ __u64 offset;
};
#define VIRTGPU_CONTEXT_PARAM_CAPSET_ID 0x0001
--
2.34.1
Powered by blists - more mailing lists