drm/amdgpu: save/restore bios scratch when gpu reset
authorChunming Zhou <David1.Zhou@amd.com>
Tue, 21 Jun 2016 06:52:09 +0000 (14:52 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 7 Jul 2016 19:06:03 +0000 (15:06 -0400)
Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

index a1364778bd3be4fb6c52b4b4d0b8e1896b94c7d7..153d0ca23ea3b19846de0cd9dde9bc68757c4e2f 100644 (file)
@@ -1951,6 +1951,8 @@ int amdgpu_gpu_reset(struct amdgpu_device *adev)
        /* block TTM */
        resched = ttm_bo_lock_delayed_workqueue(&adev->mman.bdev);
 
+       /* save scratch */
+       amdgpu_atombios_scratch_regs_save(adev);
        r = amdgpu_suspend(adev);
 
        for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
@@ -1975,7 +1977,8 @@ retry:
                dev_info(adev->dev, "GPU reset succeeded, trying to resume\n");
                r = amdgpu_resume(adev);
        }
-
+       /* restore scratch */
+       amdgpu_atombios_scratch_regs_restore(adev);
        if (!r) {
                for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
                        struct amdgpu_ring *ring = adev->rings[i];