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.
Showing the changes to include/uapi (1 of 10 files). Show all
Unified · Split
| @@ -156,10 +156,11 @@ struct amdxdna_drm_config_hwctx { · 155 unmodified lines | ||
| 156 | 156 | |
| 157 | 157 | enum amdxdna_bo_type { |
| 158 | 158 | AMDXDNA_BO_INVALID = 0, |
| 159 | − AMDXDNA_BO_SHMEM, | |
| 160 | − AMDXDNA_BO_DEV_HEAP, | |
| 161 | − AMDXDNA_BO_DEV, | |
| 162 | − AMDXDNA_BO_CMD, | |
| 159 | + AMDXDNA_BO_SHMEM = 1, /* Be compatible with legacy application code. */ | |
| 160 | + AMDXDNA_BO_SHARE = 1, | |
| 161 | + AMDXDNA_BO_DEV_HEAP = 2, | |
| 162 | + AMDXDNA_BO_DEV = 3, | |
| 163 | + AMDXDNA_BO_CMD = 4, | |
| 163 | 164 | }; |
| 164 | 165 | |
| 165 | 166 | /** |