aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
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_cs.c
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_cs.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index 40e85bfcdf91..fe81b46266d9 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -1009,7 +1009,16 @@ amdgpu_cs_find_mapping(struct amdgpu_cs_parser *parser,
1009 if (!reloc->bo_va) 1009 if (!reloc->bo_va)
1010 continue; 1010 continue;
1011 1011
1012 list_for_each_entry(mapping, &reloc->bo_va->mappings, list) { 1012 list_for_each_entry(mapping, &reloc->bo_va->valids, list) {
1013 if (mapping->it.start > addr ||
1014 addr > mapping->it.last)
1015 continue;
1016
1017 *bo = reloc->bo_va->bo;
1018 return mapping;
1019 }
1020
1021 list_for_each_entry(mapping, &reloc->bo_va->invalids, list) {
1013 if (mapping->it.start > addr || 1022 if (mapping->it.start > addr ||
1014 addr > mapping->it.last) 1023 addr > mapping->it.last)
1015 continue; 1024 continue;