]> git.ipfire.org Git - thirdparty/linux.git/commit
accel/amdxdna: Refactor GEM BO handling and add helper APIs for address retrieval
authorMax Zhen <max.zhen@amd.com>
Fri, 20 Mar 2026 21:06:14 +0000 (14:06 -0700)
committerLizhi Hou <lizhi.hou@amd.com>
Sat, 21 Mar 2026 05:12:49 +0000 (22:12 -0700)
commitd76856beb4a4a6c42244054cd780c00f2d33de4e
treea5644195ad0ec2b472ef661e4ebac6167dfbb7f4
parentfbef867cf6614178bc6afd15ee15f85cddf19eab
accel/amdxdna: Refactor GEM BO handling and add helper APIs for address retrieval

Refactor amdxdna GEM buffer object (BO) handling to simplify address
management and unify BO type semantics.

Introduce helper APIs to retrieve commonly used BO addresses:
- User virtual address (UVA)
- Kernel virtual address (KVA)
- Device address (IOVA/PA)

These helpers centralize address lookup logic and avoid duplicating
BO-specific handling across submission and execution paths. This also
improves readability and reduces the risk of inconsistent address
handling in future changes.

As part of the refactor:
- Rename SHMEM BO type to SHARE to better reflect its usage.
- Merge CMD BO handling into SHARE, removing special-case logic for
  command buffers.
- Consolidate BO type handling paths to reduce code duplication and
  simplify maintenance.

No functional change is intended. The refactor prepares the driver for
future enhancements by providing a cleaner abstraction for BO address
management.

Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Max Zhen <max.zhen@amd.com>
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Link: https://patch.msgid.link/20260320210615.1973016-1-lizhi.hou@amd.com
drivers/accel/amdxdna/aie2_ctx.c
drivers/accel/amdxdna/aie2_message.c
drivers/accel/amdxdna/amdxdna_ctx.c
drivers/accel/amdxdna/amdxdna_ctx.h
drivers/accel/amdxdna/amdxdna_gem.c
drivers/accel/amdxdna/amdxdna_gem.h
drivers/accel/amdxdna/amdxdna_pci_drv.c
drivers/accel/amdxdna/amdxdna_ubuf.c
drivers/accel/amdxdna/amdxdna_ubuf.h
include/uapi/drm/amdxdna_accel.h