drm/amdgpu: Add mapping info option for GEM_OP ioctl

Add new GEM_OP_IOCTL option GET_MAPPING_INFO, which
returns a list of mappings associated with a given bo, along with
their positions and offsets.

Userspace for this and the previous change can be found at:
https://github.com/checkpoint-restore/criu/pull/2613

Signed-off-by: David Francis <David.Francis@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
David Francis
2025-06-16 09:49:33 -04:00
committed by Alex Deucher
parent f9db1fc52c
commit 4d82724f7f
3 changed files with 101 additions and 15 deletions

View File

@@ -670,4 +670,9 @@ void amdgpu_vm_tlb_fence_create(struct amdgpu_device *adev,
void amdgpu_vm_print_task_info(struct amdgpu_device *adev,
struct amdgpu_task_info *task_info);
#define amdgpu_vm_bo_va_for_each_valid_mapping(bo_va, mapping) \
list_for_each_entry(mapping, &(bo_va)->valids, list)
#define amdgpu_vm_bo_va_for_each_invalid_mapping(bo_va, mapping) \
list_for_each_entry(mapping, &(bo_va)->invalids, list)
#endif