mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-18 06:33:43 -04:00
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. Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com> Signed-off-by: Lizhi Hou <lizhi.hou@amd.com> Link: https://lore.kernel.org/r/20250716164414.112091-1-lizhi.hou@amd.com
This commit is contained in:
@@ -153,6 +153,31 @@ enum amdxdna_bo_type {
|
||||
AMDXDNA_BO_CMD,
|
||||
};
|
||||
|
||||
/**
|
||||
* struct amdxdna_drm_va_entry
|
||||
* @vaddr: Virtual address.
|
||||
* @len: Size of entry.
|
||||
*/
|
||||
struct amdxdna_drm_va_entry {
|
||||
__u64 vaddr;
|
||||
__u64 len;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct amdxdna_drm_va_tbl
|
||||
* @dmabuf_fd: The fd of dmabuf.
|
||||
* @num_entries: Number of va entries.
|
||||
* @va_entries: Array of va entries.
|
||||
*
|
||||
* The input can be either a dmabuf fd or a virtual address entry table.
|
||||
* When dmabuf_fd is used, num_entries must be zero.
|
||||
*/
|
||||
struct amdxdna_drm_va_tbl {
|
||||
__s32 dmabuf_fd;
|
||||
__u32 num_entries;
|
||||
struct amdxdna_drm_va_entry va_entries[];
|
||||
};
|
||||
|
||||
/**
|
||||
* struct amdxdna_drm_create_bo - Create a buffer object.
|
||||
* @flags: Buffer flags. MBZ.
|
||||
|
||||
Reference in New Issue
Block a user