diff options
author | Monk Liu <Monk.Liu@amd.com> | 2017-11-21 06:29:14 +0100 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-12-06 18:48:15 +0100 |
commit | ce1b1b66cd5ec60927c575858430c099b8b4bceb (patch) | |
tree | cf3882de00bc4a58d1ad1fc4f2b68653ddb6c981 /drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | |
parent | drm/ttm: roundup the shrink request to prevent skip huge pool (diff) | |
download | linux-ce1b1b66cd5ec60927c575858430c099b8b4bceb.tar.xz linux-ce1b1b66cd5ec60927c575858430c099b8b4bceb.zip |
drm/amdgpu:partially revert 1cfd8e237f0318e330190ac21d63c58ae6a1f66c
found RING0 test fail after S3 resume regression, which is
introduced by 1cfd8e237f0318e330190ac21d63c58ae6a1f66c
Because after suspend VRAM will be cleared, so driver must
unpin the GART table(resident in VRAM) during suspend so it
can be evicted to system ram and must correspondingly pin it
during resume so the GART table could be restored to VRAM.
Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c index 1e7f52f109b5..6098c773711f 100644 --- a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c @@ -478,14 +478,16 @@ static void gmc_v6_0_set_prt(struct amdgpu_device *adev, bool enable) static int gmc_v6_0_gart_enable(struct amdgpu_device *adev) { - int i; + int r, i; u32 field; if (adev->gart.robj == NULL) { dev_err(adev->dev, "No VRAM object for PCIE GART.\n"); return -EINVAL; } - + r = amdgpu_gart_table_vram_pin(adev); + if (r) + return r; /* Setup TLB control */ WREG32(mmMC_VM_MX_L1_TLB_CNTL, (0xA << 7) | @@ -612,6 +614,7 @@ static void gmc_v6_0_gart_disable(struct amdgpu_device *adev) WREG32(mmVM_L2_CNTL3, VM_L2_CNTL3__L2_CACHE_BIGK_ASSOCIATIVITY_MASK | (0UL << VM_L2_CNTL3__L2_CACHE_BIGK_FRAGMENT_SIZE__SHIFT)); + amdgpu_gart_table_vram_unpin(adev); } static void gmc_v6_0_gart_fini(struct amdgpu_device *adev) |