[PATCH] drm/amdgpu: stop/resume fb access when gpu reset V2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



V2: add wait_for_mc_idle after stopping fb access

Change-Id: I86b5c2b8c78a17ef43ade2a97ef8a33853650be0
Signed-off-by: Chunming Zhou <David1.Zhou at amd.com>
Reviewed-by: Christian König <christian.koenig at amd.com> (V1)
---
 drivers/gpu/drm/amd/amdgpu/cik.c | 12 +++++++++++-
 drivers/gpu/drm/amd/amdgpu/vi.c  | 10 +++++++++-
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/cik.c b/drivers/gpu/drm/amd/amdgpu/cik.c
index 40f4fda..7f2e3db 100644
--- a/drivers/gpu/drm/amd/amdgpu/cik.c
+++ b/drivers/gpu/drm/amd/amdgpu/cik.c
@@ -1213,10 +1213,20 @@ static void cik_set_bios_scratch_engine_hung(struct amdgpu_device *adev, bool hu
 static int cik_asic_reset(struct amdgpu_device *adev)
 {
 	int r;
-	cik_set_bios_scratch_engine_hung(adev, true);
+	struct amdgpu_mode_mc_save save;
 
+	cik_set_bios_scratch_engine_hung(adev, true);
+	/* Disable fb access */
+	if (adev->mode_info.num_crtc) {
+		amdgpu_display_stop_mc_access(adev, &save);
+		amdgpu_asic_wait_for_mc_idle(adev);
+	}
 	r = cik_gpu_pci_config_reset(adev);
 
+	/* resume fb access */
+	if (adev->mode_info.num_crtc)
+		amdgpu_display_resume_mc_access(adev, &save);
+
 	cik_set_bios_scratch_engine_hung(adev, false);
 
 	return r;
diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c
index 1ac0c91..5337c4f 100644
--- a/drivers/gpu/drm/amd/amdgpu/vi.c
+++ b/drivers/gpu/drm/amd/amdgpu/vi.c
@@ -633,10 +633,18 @@ static void vi_set_bios_scratch_engine_hung(struct amdgpu_device *adev, bool hun
 static int vi_asic_reset(struct amdgpu_device *adev)
 {
 	int r;
+	struct amdgpu_mode_mc_save save;
 
 	vi_set_bios_scratch_engine_hung(adev, true);
-
+	/* Disable fb access */
+	if (adev->mode_info.num_crtc) {
+		amdgpu_display_stop_mc_access(adev, &save);
+		amdgpu_asic_wait_for_mc_idle(adev);
+	}
 	r = vi_gpu_pci_config_reset(adev);
+	/* resume fb access */
+	if (adev->mode_info.num_crtc)
+		amdgpu_display_resume_mc_access(adev, &save);
 
 	vi_set_bios_scratch_engine_hung(adev, false);
 
-- 
1.9.1



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux