]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
drm/amdgpu: always recover VRAM during GPU recovery
authorChristian König <christian.koenig@amd.com>
Tue, 11 Sep 2018 08:36:16 +0000 (10:36 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 19 Sep 2018 17:38:35 +0000 (12:38 -0500)
It shouldn't add much overhead and we should make sure that critical
VRAM content is always restored.

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

index 354f0557d697da200676aad613341e50bfc0170e..0267fae316d79de49c7529a58857206339435a22 100644 (file)
@@ -2999,7 +2999,7 @@ err:
 }
 
 /**
- * amdgpu_device_handle_vram_lost - Handle the loss of VRAM contents
+ * amdgpu_device_recover_vram - Recover some VRAM contents
  *
  * @adev: amdgpu_device pointer
  *
@@ -3008,7 +3008,7 @@ err:
  * the contents of VRAM might be lost.
  * Returns 0 on success, 1 on failure.
  */
-static int amdgpu_device_handle_vram_lost(struct amdgpu_device *adev)
+static int amdgpu_device_recover_vram(struct amdgpu_device *adev)
 {
        struct amdgpu_ring *ring = adev->mman.buffer_funcs_ring;
        struct amdgpu_bo *bo, *tmp;
@@ -3135,8 +3135,8 @@ out:
                }
        }
 
-       if (!r && ((need_full_reset && !(adev->flags & AMD_IS_APU)) || vram_lost))
-               r = amdgpu_device_handle_vram_lost(adev);
+       if (!r)
+               r = amdgpu_device_recover_vram(adev);
 
        return r;
 }
@@ -3182,7 +3182,7 @@ error:
        amdgpu_virt_release_full_gpu(adev, true);
        if (!r && adev->virt.gim_feature & AMDGIM_FEATURE_GIM_FLR_VRAMLOST) {
                atomic_inc(&adev->vram_lost_counter);
-               r = amdgpu_device_handle_vram_lost(adev);
+               r = amdgpu_device_recover_vram(adev);
        }
 
        return r;