History

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.

Max Zhen committed 7 months ago

Commit d76856b1 parent fbef86710 files · +266 −278Browse files

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

Unified · Split

include/uapi/drm/amdxdna_accel.h+5−4
@@ -156,10 +156,11 @@ struct amdxdna_drm_config_hwctx { · 155 unmodified lines
156 156
157enum amdxdna_bo_type {157enum amdxdna_bo_type {
158 AMDXDNA_BO_INVALID = 0,158 AMDXDNA_BO_INVALID = 0,
159 AMDXDNA_BO_SHMEM,159 AMDXDNA_BO_SHMEM = 1, /* Be compatible with legacy application code. */
160 AMDXDNA_BO_DEV_HEAP,160 AMDXDNA_BO_SHARE = 1,
161 AMDXDNA_BO_DEV,161 AMDXDNA_BO_DEV_HEAP = 2,
162 AMDXDNA_BO_CMD,162 AMDXDNA_BO_DEV = 3,
163 AMDXDNA_BO_CMD = 4,
163};164};
164 165
165/**166/**

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