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

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

 



Change-Id: I86b5c2b8c78a17ef43ade2a97ef8a33853650be0
Signed-off-by: Chunming Zhou <David1.Zhou at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/cik.c | 9 +++++++++
 drivers/gpu/drm/amd/amdgpu/vi.c  | 8 +++++++-
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/cik.c b/drivers/gpu/drm/amd/amdgpu/cik.c
index 40f4fda..716efa8 100644
--- a/drivers/gpu/drm/amd/amdgpu/cik.c
+++ b/drivers/gpu/drm/amd/amdgpu/cik.c
@@ -1213,10 +1213,19 @@ 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;
+	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);
 
 	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..497b817 100644
--- a/drivers/gpu/drm/amd/amdgpu/vi.c
+++ b/drivers/gpu/drm/amd/amdgpu/vi.c
@@ -633,10 +633,16 @@ 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);
 	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