History

accel/amdxdna: Support user space allocated buffer

Enhance DRM_IOCTL_AMDXDNA_CREATE_BO to accept user space allocated buffer pointer. The buffer pages will be pinned in memory. Unless the CAP_IPC_LOCK is enabled for the application process, the total pinned memory can not beyond rlimit_memlock.

Lizhi Hou committed 1 year ago

Commit bd72d4a1 parent 956f82e5 files · +391 −25Browse files

Showing the changes to include/uapi (1 of 5 files). Show all

Unified · Split

include/uapi/drm/amdxdna_accel.h+25−0
@@ -153,6 +153,31 @@ enum amdxdna_bo_type { · 152 unmodified lines
153153 AMDXDNA_BO_CMD,
154154 };
155155
156+/**
157+ * struct amdxdna_drm_va_entry
158+ * @vaddr: Virtual address.
159+ * @len: Size of entry.
160+ */
161+struct amdxdna_drm_va_entry {
162+ __u64 vaddr;
163+ __u64 len;
164+};
165+
166+/**
167+ * struct amdxdna_drm_va_tbl
168+ * @dmabuf_fd: The fd of dmabuf.
169+ * @num_entries: Number of va entries.
170+ * @va_entries: Array of va entries.
171+ *
172+ * The input can be either a dmabuf fd or a virtual address entry table.
173+ * When dmabuf_fd is used, num_entries must be zero.
174+ */
175+struct amdxdna_drm_va_tbl {
176+ __s32 dmabuf_fd;
177+ __u32 num_entries;
178+ struct amdxdna_drm_va_entry va_entries[];
179+};
180+
156181 /**
157182 * struct amdxdna_drm_create_bo - Create a buffer object.
158183 * @flags: Buffer flags. MBZ.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t