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.
Showing the changes to include/uapi (1 of 5 files). Show all
Unified · Split
| @@ -153,6 +153,31 @@ enum amdxdna_bo_type { · 152 unmodified lines | ||
| 153 | 153 | AMDXDNA_BO_CMD, |
| 154 | 154 | }; |
| 155 | 155 | |
| 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 | + | |
| 156 | 181 | /** |
| 157 | 182 | * struct amdxdna_drm_create_bo - Create a buffer object. |
| 158 | 183 | * @flags: Buffer flags. MBZ. |