drm/amdgpu: fix vega10 graphic hang issue in S3 test
Subsystems (2)
PATCH 1/1 drm/amdgpu: fix vega10 graphic hang issue in S3 test
From: Ken Wang <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 10 ++++++++-- drivers/gpu/drm/amd/amdgpu/soc15d.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +8 -2
@@ -1615,7 +1615,7 @@ static int gfx_v9_0_cp_gfx_start(struct amdgpu_device *adev)struct amdgpu_ring *ring = &adev->gfx.gfx_ring[0 ];const struct cs_section_def *sect =NULL ;const struct cs_extent_def *ext =NULL ; -int r, i; +int r, i, tmp;/* init the CP */ WREG32_SOC15 (GC ,0 , mmCP_MAX_CONTEXT, adev->gfx.config.max_hw_contexts -1 );
@@ -1623,7 +1623,7 @@ static int gfx_v9_0_cp_gfx_start(struct amdgpu_device *adev)gfx_v9_0_cp_gfx_enable (adev, true); - r =amdgpu_ring_alloc (ring,gfx_v9_0_get_csb_size (adev) +4 ); + r =amdgpu_ring_alloc (ring,gfx_v9_0_get_csb_size (adev) +4 +3 );if (r) {DRM_ERROR ("amdgpu: cp failed to lock ring (%d).\n" , r);return r;
@@ -1661,6 +1661,12 @@ static int gfx_v9_0_cp_gfx_start(struct amdgpu_device *adev)amdgpu_ring_write (ring,0x8000 );amdgpu_ring_write (ring,0x8000 ); +amdgpu_ring_write (ring,PACKET3 (PACKET3_SET_UCONFIG_REG ,1 )); + tmp = (PACKET3_SET_UCONFIG_REG_INDEX_TYPE | + (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);return 0 ;
drivers/gpu/drm/amd/amdgpu/soc15d.h +1 -0
@@ -250,6 +250,7 @@#define PACKET3_SET_UCONFIG_REG 0x79#define PACKET3_SET_UCONFIG_REG_START 0x0000c000#define PACKET3_SET_UCONFIG_REG_END 0x0000c400 +#define PACKET3_SET_UCONFIG_REG_INDEX_TYPE (2 << 28)#define PACKET3_SCRATCH_RAM_WRITE 0x7D#define PACKET3_SCRATCH_RAM_READ 0x7E#define PACKET3_LOAD_CONST_RAM 0x80
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1502948583-25827-1-git-send-email-ken.wang-5C7GfCeVMHo@public.gmane.org
Zhang, Hawking
Reviewed-by Hawking ZhangRegards,
Hawking
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of [email protected]
Sent: Thursday, August 17, 2017 13:43
To: [email protected]
Cc: Wang, Ken <[email protected]>
Subject: [PATCH] drm/amdgpu: fix vega10 graphic hang issue in S3 test
From: Ken Wang <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 10 ++++++++-- drivers/gpu/drm/amd/amdgpu/soc15d.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1 -1
@@ -1615,7 +1615,7 @@ static int gfx_v9_0_cp_gfx_start(struct amdgpu_device *adev)struct amdgpu_ring *ring = &adev->gfx.gfx_ring[0 ];const struct cs_section_def *sect =NULL ;const struct cs_extent_def *ext =NULL ; -int r, i; +int r, i, tmp;/* init the CP */ WREG32_SOC15(GC, 0, mmCP_MAX_CONTEXT, adev->gfx.config.max_hw_contexts - 1); @@ -1623,7 +1623,7 @@ static int gfx_v9_0_cp_gfx_start(struct amdgpu_device *adev)
gfx_v9_0_cp_gfx_enable(adev, true);
- r = amdgpu_ring_alloc(ring, gfx_v9_0_get_csb_size(adev) + 4);
+ r = amdgpu_ring_alloc(ring, gfx_v9_0_get_csb_size(adev) + 4 + 3);
if (r) {
DRM_ERROR("amdgpu: cp failed to lock ring (%d).\n", r); return r;
@@ -1661,6 +1661,12 @@ static int gfx_v9_0_cp_gfx_start(struct amdgpu_device *adev)
amdgpu_ring_write(ring, 0x8000);
amdgpu_ring_write(ring, 0x8000);
+ amdgpu_ring_write(ring, PACKET3(PACKET3_SET_UCONFIG_REG,1));
+ tmp = (PACKET3_SET_UCONFIG_REG_INDEX_TYPE |
+ (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);
return 0;
drivers/gpu/drm/amd/amdgpu/soc15d.h +1 -0
@@ -250,6 +250,7 @@#define PACKET3_SET_UCONFIG_REG 0x79#define PACKET3_SET_UCONFIG_REG_START 0x0000c000#define PACKET3_SET_UCONFIG_REG_END 0x0000c400 +#define PACKET3_SET_UCONFIG_REG_INDEX_TYPE (2 << 28)#define PACKET3_SCRATCH_RAM_WRITE 0x7D#define PACKET3_SCRATCH_RAM_READ 0x7E#define PACKET3_LOAD_CONST_RAM 0x80
--
2.7.4
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Deucher, Alexander
Reviewed-by Alex DeucherQuoted 8 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of [email protected]
Sent: Thursday, August 17, 2017 1:43 AM
To: [email protected]
Cc: Wang, Ken
Subject: [PATCH] drm/amdgpu: fix vega10 graphic hang issue in S3 test
Please include a better description. E.g.,mmVGT_INDEX_TYPE has no default value, need to make sure it's initialized when gfx is initialized. With that fixed:
Quoted 70 lines
From: Ken Wang <[email protected]>
Change-Id If01e32baa903c8c35991b1517c6d8bde98f5dae2Signed-off-by Ken Wang <[email protected]>--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 10 ++++++++-- drivers/gpu/drm/amd/amdgpu/soc15d.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1
-1@@ -1615,7 +1615,7 @@ static int gfx_v9_0_cp_gfx_start(struct amdgpu_device *adev)struct amdgpu_ring *ring = &adev->gfx.gfx_ring[0 ];const struct cs_section_def *sect =NULL ;const struct cs_extent_def *ext =NULL ; -int r, i; +int r, i, tmp;/* init the CP */ WREG32_SOC15(GC, 0,
mmCP_MAX_CONTEXT, adev-Quoted 1 line
gfx.config.max_hw_contexts - 1);
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1
-1@@ -1623,7 +1623,7 @@ static int gfx_v9_0_cp_gfx_start(struct amdgpu_device *adev)gfx_v9_0_cp_gfx_enable (adev ,true ); - r =amdgpu_ring_alloc (ring,gfx_v9_0_get_csb_size (adev) +4 ); + r =amdgpu_ring_alloc (ring,gfx_v9_0_get_csb_size (adev) +4 +3 );if (r) {DRM_ERROR ("amdgpu: cp failed to lock ring (%d).\n" , r);drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +6
-0return r;@@ -1661,6 +1661,12 @@ static int gfx_v9_0_cp_gfx_start(struct amdgpu_device *adev) amdgpu_ring_write(ring, 0x8000);amdgpu_ring_write (ring,0x8000 ); +amdgpu_ring_write (ring,PACKET3 (PACKET3_SET_UCONFIG_REG ,1 )); + tmp = (PACKET3_SET_UCONFIG_REG_INDEX_TYPE | + (SOC15_REG_OFFSET (GC ,0 , mmVGT_INDEX_TYPE) -PACKET3_SET_UCONFIG_REG_START )); +amdgpu_ring_write (ring, tmp); +amdgpu_ring_write (ring,0 ); +drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-0amdgpu_ring_commit (ring);return 0 ;drivers/gpu/drm/amd/amdgpu/soc15d.h +1
-0@@ -250,6 +250,7 @@#define PACKET3_SET_UCONFIG_REG 0x79#define PACKET3_SET_UCONFIG_REG_START 0x0000c000#define PACKET3_SET_UCONFIG_REG_END 0x0000c400 +#define PACKET3_SET_UCONFIG_REG_INDEX_TYPE (2 <<28 )#define
PACKET3_SCRATCH_RAM_WRITE0x7D
#definePACKET3_SCRATCH_RAM_READ0x7E
#definePACKET3_LOAD_CONST_RAM0x80
--
2.7.4
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx