All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ken Wang <Ken.Wang-5C7GfCeVMHo@public.gmane.org>
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Ken Wang <Ken.Wang-5C7GfCeVMHo@public.gmane.org>
Subject: [PATCH] drm/amdgpu: fix vega10 graphic hang issue in S3 test
Date: Tue, 15 Aug 2017 17:33:25 +0800	[thread overview]
Message-ID: <1502789605-4112-1-git-send-email-Ken.Wang@amd.com> (raw)

Change-Id: If01e32baa903c8c35991b1517c6d8bde98f5dae2
Signed-off-by: Ken Wang <Ken.Wang@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index 68a0d40..f47ee5c 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -230,6 +230,7 @@ static int gfx_v9_0_ring_test_ring(struct amdgpu_ring *ring)
 		r = -EINVAL;
 	}
 	amdgpu_gfx_scratch_free(adev, scratch);
+
 	return r;
 }
 
@@ -1670,6 +1671,7 @@ static int gfx_v9_0_cp_gfx_resume(struct amdgpu_device *adev)
 	u32 tmp;
 	u32 rb_bufsz;
 	u64 rb_addr, rptr_addr, wptr_gpu_addr;
+	int r;
 
 	/* Set the write pointer delay */
 	WREG32_SOC15(GC, 0, mmCP_RB_WPTR_DELAY, 0);
@@ -1729,6 +1731,17 @@ static int gfx_v9_0_cp_gfx_resume(struct amdgpu_device *adev)
 
 	/* start the ring */
 	gfx_v9_0_cp_gfx_start(adev);
+
+	r = amdgpu_ring_alloc(ring, 3);
+	if (r) {
+		return r;
+	}
+	amdgpu_ring_write(ring, PACKET3(PACKET3_SET_UCONFIG_REG, 1));
+	tmp = ((2 << 28) | (SOC15_REG_OFFSET(GC, 0, mmVGT_INDEX_TYPE) - PACKET3_SET_UCONFIG_REG_START));
+	amdgpu_ring_write(ring, tmp);
+	amdgpu_ring_write(ring, 0);
+	amdgpu_ring_commit(ring);
+
 	ring->ready = true;
 
 	return 0;
-- 
2.7.4

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

             reply	other threads:[~2017-08-15  9:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-15  9:33 Ken Wang [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-08-17  5:43 [PATCH] drm/amdgpu: fix vega10 graphic hang issue in S3 test ken.wang-5C7GfCeVMHo
     [not found] ` <1502948583-25827-1-git-send-email-ken.wang-5C7GfCeVMHo@public.gmane.org>
2017-08-17  5:58   ` Zhang, Hawking
2017-08-17 12:41   ` Deucher, Alexander
2017-08-15  9:53 Huang Rui
     [not found] ` <1502790786-14449-1-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org>
2017-08-15 15:02   ` Alex Deucher
2017-08-15  9:38 Ken Wang
2017-08-15  9:19 Ken Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1502789605-4112-1-git-send-email-Ken.Wang@amd.com \
    --to=ken.wang-5c7gfcevmho@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.