All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/10] drm/amdgpu: pin the csb buffer on hw init
@ 2018-07-05  9:09 Evan Quan
       [not found] ` <20180705090935.9638-1-evan.quan-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 35+ messages in thread
From: Evan Quan @ 2018-07-05  9:09 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Evan Quan

Without this pin, the csb buffer will be filled with inconsistent
data after S3 resume. And that will causes gfx hang on gfxoff
exit since this csb will be executed then.

Change-Id: I1ae1f2eed096eaba5f601cf2a3e2650c8e583dc9
Signed-off-by: Evan Quan <evan.quan@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 40 +++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index ac46eabe3bcd..65cc30766658 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -943,6 +943,7 @@ static int gfx_v9_0_rlc_init(struct amdgpu_device *adev)
 		dst_ptr = adev->gfx.rlc.cs_ptr;
 		gfx_v9_0_get_csb_buffer(adev, dst_ptr);
 		amdgpu_bo_kunmap(adev->gfx.rlc.clear_state_obj);
+		amdgpu_bo_unpin(adev->gfx.rlc.clear_state_obj);
 		amdgpu_bo_unreserve(adev->gfx.rlc.clear_state_obj);
 	}
 
@@ -971,6 +972,39 @@ static int gfx_v9_0_rlc_init(struct amdgpu_device *adev)
 	return 0;
 }
 
+static int gfx_v9_0_csb_vram_pin(struct amdgpu_device *adev)
+{
+	uint64_t gpu_addr;
+	int r;
+
+	r = amdgpu_bo_reserve(adev->gfx.rlc.clear_state_obj, false);
+	if (unlikely(r != 0))
+		return r;
+
+	r = amdgpu_bo_pin(adev->gfx.rlc.clear_state_obj,
+			AMDGPU_GEM_DOMAIN_VRAM, &gpu_addr);
+	if (!r)
+		adev->gfx.rlc.clear_state_gpu_addr = gpu_addr;
+
+	amdgpu_bo_unreserve(adev->gfx.rlc.clear_state_obj);
+
+	return r;
+}
+
+static void gfx_v9_0_csb_vram_unpin(struct amdgpu_device *adev)
+{
+	int r;
+
+	if (!adev->gfx.rlc.clear_state_obj)
+		return;
+
+	r = amdgpu_bo_reserve(adev->gfx.rlc.clear_state_obj, true);
+	if (likely(r == 0)) {
+		amdgpu_bo_unpin(adev->gfx.rlc.clear_state_obj);
+		amdgpu_bo_unreserve(adev->gfx.rlc.clear_state_obj);
+	}
+}
+
 static void gfx_v9_0_mec_fini(struct amdgpu_device *adev)
 {
 	amdgpu_bo_free_kernel(&adev->gfx.mec.hpd_eop_obj, NULL, NULL);
@@ -3116,6 +3150,10 @@ static int gfx_v9_0_hw_init(void *handle)
 
 	gfx_v9_0_gpu_init(adev);
 
+	r = gfx_v9_0_csb_vram_pin(adev);
+	if (r)
+		return r;
+
 	r = gfx_v9_0_rlc_resume(adev);
 	if (r)
 		return r;
@@ -3224,6 +3262,8 @@ static int gfx_v9_0_hw_fini(void *handle)
 	gfx_v9_0_cp_enable(adev, false);
 	gfx_v9_0_rlc_stop(adev);
 
+	gfx_v9_0_csb_vram_unpin(adev);
+
 	return 0;
 }
 
-- 
2.18.0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2018-07-11  6:44 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-05  9:09 [PATCH 01/10] drm/amdgpu: pin the csb buffer on hw init Evan Quan
     [not found] ` <20180705090935.9638-1-evan.quan-5C7GfCeVMHo@public.gmane.org>
2018-07-05  9:09   ` [PATCH 02/10] drm/amdgpu: init CSIB regardless of rlc version and pg status Evan Quan
     [not found]     ` <20180705090935.9638-2-evan.quan-5C7GfCeVMHo@public.gmane.org>
2018-07-09  3:56       ` Quan, Evan
     [not found]         ` <SN6PR12MB265670B1B3AAC47773CBA7A9E4440-kxOKjb6HO/FeL/N0e1LXkAdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-07-10 17:17           ` Alex Deucher
2018-07-05  9:09   ` [PATCH 03/10] drm/amdgpu: init rlc save restore as long as the lists exist Evan Quan
     [not found]     ` <20180705090935.9638-3-evan.quan-5C7GfCeVMHo@public.gmane.org>
2018-07-05 15:19       ` Huang Rui
2018-07-06  9:14         ` Quan, Evan
2018-07-06 10:14       ` Huang Rui
2018-07-09  3:46         ` Quan, Evan
2018-07-05  9:09   ` [PATCH 04/10] drm/amdgpu: correct direct reg list length for v2_0 rlc Evan Quan
     [not found]     ` <20180705090935.9638-4-evan.quan-5C7GfCeVMHo@public.gmane.org>
2018-07-05 15:06       ` Huang Rui
2018-07-09  4:00         ` Quan, Evan
2018-07-05  9:09   ` [PATCH 05/10] drm/amdgpu: drop mmRLC_PG_CNTL clear Evan Quan
     [not found]     ` <20180705090935.9638-5-evan.quan-5C7GfCeVMHo@public.gmane.org>
2018-07-05 15:07       ` Huang Rui
2018-07-05 15:33       ` Alex Deucher
     [not found]         ` <CADnq5_Mkjuj9hLahht=s70wwXKNqnRcaFMJNjOjR8HSh_DWpUw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-07-06 10:04           ` Huang Rui
2018-07-05  9:09   ` [PATCH 06/10] drm/amdgpu: no touch for the reserved bit of RLC_CGTT_MGCG_OVERRIDE Evan Quan
     [not found]     ` <20180705090935.9638-6-evan.quan-5C7GfCeVMHo@public.gmane.org>
2018-07-09  4:06       ` Quan, Evan
     [not found]         ` <SN6PR12MB2656F298CDBE1A2607BA5B36E4440-kxOKjb6HO/FeL/N0e1LXkAdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-07-10 17:18           ` Alex Deucher
2018-07-05  9:09   ` [PATCH 07/10] drm/amdgpu: reduce the idle period that RLC has to wait before request CGCG Evan Quan
     [not found]     ` <20180705090935.9638-7-evan.quan-5C7GfCeVMHo@public.gmane.org>
2018-07-09  4:06       ` Quan, Evan
     [not found]         ` <SN6PR12MB2656009EA5F895E6F2B399B5E4440-kxOKjb6HO/FeL/N0e1LXkAdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-07-10 17:19           ` Alex Deucher
     [not found]             ` <CADnq5_NhmSk62EE3VG+V-=9M-pWZo-jJzzrLKL_K0By2_OaQ7g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-07-11  6:44               ` Quan, Evan
2018-07-05  9:09   ` [PATCH 08/10] drm/amdgpu: use the accessible target rlc safe mode Apis directly Evan Quan
     [not found]     ` <20180705090935.9638-8-evan.quan-5C7GfCeVMHo@public.gmane.org>
2018-07-09  4:08       ` Quan, Evan
     [not found]         ` <SN6PR12MB26569BE03C4B86F63E161B94E4440-kxOKjb6HO/FeL/N0e1LXkAdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-07-10 17:23           ` Alex Deucher
     [not found]             ` <CADnq5_OkzpNCaGBNsB5uOCutr9+m6szm6O6QpmkoEvBSh7Ux5A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-07-11  6:44               ` Quan, Evan
2018-07-05  9:09   ` [PATCH 09/10] drm/amd/powerplay: add vega12 SMU gfxoff support Evan Quan
     [not found]     ` <20180705090935.9638-9-evan.quan-5C7GfCeVMHo@public.gmane.org>
2018-07-05 15:21       ` Huang Rui
2018-07-05  9:09   ` [PATCH 10/10] drm/amd/powerplay: no need to mask workable gfxoff feature for vega12 Evan Quan
     [not found]     ` <20180705090935.9638-10-evan.quan-5C7GfCeVMHo@public.gmane.org>
2018-07-09  4:36       ` Quan, Evan
     [not found]         ` <SN6PR12MB2656713C37BA977A41CB04CEE4440-kxOKjb6HO/FeL/N0e1LXkAdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-07-10 17:24           ` Alex Deucher
2018-07-05 15:25   ` [PATCH 01/10] drm/amdgpu: pin the csb buffer on hw init Huang Rui
2018-07-05 15:25     ` Alex Deucher
     [not found]       ` <CADnq5_ObbDpsjt1-gC5oOJLe-89jU2L1VBs4sOr1-4tgq8n=3Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-07-06  9:10         ` Quan, Evan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.