Skip to content

Commit df99f6d

Browse files
ChristianKoenigAMDalexdeucher
authored andcommitted
drm/amdgpu: re-order and document VM code
Re-order fields in the VM structure and try to improve the documentation a bit. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Sunil Khatri <sunil.khatri@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 930595d commit df99f6d

1 file changed

Lines changed: 24 additions & 6 deletions

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -349,12 +349,16 @@ struct amdgpu_vm {
349349
/* Memory statistics for this vm, protected by status_lock */
350350
struct amdgpu_mem_stats stats[__AMDGPU_PL_NUM];
351351

352+
/*
353+
* The following lists contain amdgpu_vm_bo_base objects for either
354+
* PDs, PTs or per VM BOs. The state transits are:
355+
*
356+
* evicted -> relocated (PDs, PTs) or moved (per VM BOs) -> idle
357+
*/
358+
352359
/* Per-VM and PT BOs who needs a validation */
353360
struct list_head evicted;
354361

355-
/* BOs for user mode queues that need a validation */
356-
struct list_head evicted_user;
357-
358362
/* PT BOs which relocated and their parent need an update */
359363
struct list_head relocated;
360364

@@ -364,15 +368,29 @@ struct amdgpu_vm {
364368
/* All BOs of this VM not currently in the state machine */
365369
struct list_head idle;
366370

371+
/*
372+
* The following lists contain amdgpu_vm_bo_base objects for BOs which
373+
* have their own dma_resv object and not depend on the root PD. Their
374+
* state transits are:
375+
*
376+
* evicted_user or invalidated -> done
377+
*/
378+
379+
/* BOs for user mode queues that need a validation */
380+
struct list_head evicted_user;
381+
367382
/* regular invalidated BOs, but not yet updated in the PT */
368383
struct list_head invalidated;
369384

370-
/* BO mappings freed, but not yet updated in the PT */
371-
struct list_head freed;
372-
373385
/* BOs which are invalidated, has been updated in the PTs */
374386
struct list_head done;
375387

388+
/*
389+
* This list contains amdgpu_bo_va_mapping objects which have been freed
390+
* but not updated in the PTs
391+
*/
392+
struct list_head freed;
393+
376394
/* contains the page directory */
377395
struct amdgpu_vm_bo_base root;
378396
struct dma_fence *last_update;

0 commit comments

Comments
 (0)