drm/amdgpu: manually map the shadow BOs again
authorChristian König <christian.koenig@amd.com>
Wed, 29 Aug 2018 12:52:50 +0000 (14:52 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 11 Sep 2018 03:41:46 +0000 (22:41 -0500)
Otherwise we won't be able to use the AGP aperture.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

index 0cbf651a88a6a97cc095ec0825ab7b56a49229ae..de990bdcdd6cb1a865374725d3041217e5033c3a 100644 (file)
@@ -163,10 +163,7 @@ void amdgpu_bo_placement_from_domain(struct amdgpu_bo *abo, u32 domain)
 
        if (domain & AMDGPU_GEM_DOMAIN_GTT) {
                places[c].fpfn = 0;
-               if (flags & AMDGPU_GEM_CREATE_SHADOW)
-                       places[c].lpfn = adev->gmc.gart_size >> PAGE_SHIFT;
-               else
-                       places[c].lpfn = 0;
+               places[c].lpfn = 0;
                places[c].flags = TTM_PL_FLAG_TT;
                if (flags & AMDGPU_GEM_CREATE_CPU_GTT_USWC)
                        places[c].flags |= TTM_PL_FLAG_WC |
index 3163351508cf2201fb41aaeafabfcc781b26ab1e..ea5e277ae038cc12d176f2895bc5492fe7fdabc3 100644 (file)
@@ -438,6 +438,11 @@ int amdgpu_vm_validate_pt_bos(struct amdgpu_device *adev, struct amdgpu_vm *vm,
                                r = amdgpu_ttm_alloc_gart(&bo->tbo);
                        if (r)
                                break;
+                       if (bo->shadow) {
+                               r = amdgpu_ttm_alloc_gart(&bo->shadow->tbo);
+                               if (r)
+                                       break;
+                       }
                        amdgpu_vm_bo_relocated(bo_base);
                }
        }