aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu.h
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2015-07-30 05:53:42 -0400
committerAlex Deucher <alexander.deucher@amd.com>2015-08-17 16:50:49 -0400
commit7fc11959018f8ba2d92025679a72339da18a74ad (patch)
treef9c4f07e2bcd901175d2fb3c7538f02d7138f82f /drivers/gpu/drm/amd/amdgpu/amdgpu.h
parent7f06c236b964db3d8d086c5a0087b2eb4de3bf7a (diff)
drm/amdgpu: stop using addr to check for BO move v3
It is theoretically possible that a swapped out BO gets the same GTT address, but different backing pages while being swapped in. Instead just use another VA state to note updated areas. Ported from not upstream yet radeon commit with the same name. v2: fix some bugs in the original implementation found in the radeon code. v3: squash in VCE/UVD fix Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu.h')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 98b47601b30a..5b8e1aeae13b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -539,14 +539,16 @@ struct amdgpu_bo_va_mapping {
539struct amdgpu_bo_va { 539struct amdgpu_bo_va {
540 /* protected by bo being reserved */ 540 /* protected by bo being reserved */
541 struct list_head bo_list; 541 struct list_head bo_list;
542 uint64_t addr;
543 struct amdgpu_fence *last_pt_update; 542 struct amdgpu_fence *last_pt_update;
544 unsigned ref_count; 543 unsigned ref_count;
545 544
546 /* protected by vm mutex */ 545 /* protected by vm mutex and spinlock */
547 struct list_head mappings;
548 struct list_head vm_status; 546 struct list_head vm_status;
549 547
548 /* mappings for this bo_va */
549 struct list_head invalids;
550 struct list_head valids;
551
550 /* constant after initialization */ 552 /* constant after initialization */
551 struct amdgpu_vm *vm; 553 struct amdgpu_vm *vm;
552 struct amdgpu_bo *bo; 554 struct amdgpu_bo *bo;
@@ -964,13 +966,16 @@ struct amdgpu_vm {
964 966
965 struct rb_root va; 967 struct rb_root va;
966 968
967 /* protecting invalidated and freed */ 969 /* protecting invalidated */
968 spinlock_t status_lock; 970 spinlock_t status_lock;
969 971
970 /* BOs moved, but not yet updated in the PT */ 972 /* BOs moved, but not yet updated in the PT */
971 struct list_head invalidated; 973 struct list_head invalidated;
972 974
973 /* BOs freed, but not yet updated in the PT */ 975 /* BOs cleared in the PT because of a move */
976 struct list_head cleared;
977
978 /* BO mappings freed, but not yet updated in the PT */
974 struct list_head freed; 979 struct list_head freed;
975 980
976 /* contains the page directory */ 981 /* contains the page directory */