drm/amdgpu: pin the csb buffer on hw init
Subsystems (2)
PATCH 1/10 drm/amdgpu: pin the csb buffer on hw init
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.
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 40 +++++++++++++++++++++++++++ 1 file changed, 40 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +40 -0
@@ -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 ; }
Signature · 6 lines
2.18.0 _______________________________________________ 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): [email protected]
PATCH 2/10 drm/amdgpu: init CSIB regardless of rlc version and pg status
CSIB init has no relation with rlc version and pg status. It should be needed regardless of them.
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +2 -1
@@ -2182,6 +2182,8 @@ static void gfx_v9_0_enable_gfx_dynamic_mg_power_gating(struct amdgpu_device *adstatic void gfx_v9_0_init_pg (struct amdgpu_device *adev) { +gfx_v9_0_init_csb (adev); +if (!adev->gfx.rlc.is_rlc_v2_1)return ;
@@ -2191,7 +2193,6 @@ static void gfx_v9_0_init_pg(struct amdgpu_device *adev) AMD_PG_SUPPORT_CP | AMD_PG_SUPPORT_GDS | AMD_PG_SUPPORT_RLC_SMU_HS)) { -gfx_v9_0_init_csb (adev);gfx_v9_1_init_rlc_save_restore_list (adev);gfx_v9_0_enable_save_restore_machine (adev);
Signature · 6 lines
2.18.0 _______________________________________________ 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): [email protected]
RE: [PATCH 02/10] drm/amdgpu: init CSIB regardless of rlc version and pg status
Ping..
Quoted 42 lines
-----Original Message-----
From: Evan Quan [mailto:[email protected]]
Sent: Thursday, July 05, 2018 5:09 PM
To: [email protected]
Cc: Quan, Evan <[email protected]>
Subject: [PATCH 02/10] drm/amdgpu: init CSIB regardless of rlc version and pg statusCSIB init has no relation with rlc version and pg status. It should be needed regardless of them.
Change-Id Iccd12e1015f41c7e2bc3fe02472dc979015514d4Signed-off-by Evan Quan <[email protected]>--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-0@@ -2182,6 +2182,8 @@ static voidgfx_v9_0_enable_gfx_dynamic_mg_power_gating(struct
amdgpu_device*adstatic void
gfx_v9_0_init_pg(struct amdgpu_device *adev){drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +2
-2+gfx_v9_0_init_csb (adev); +if (!adev->gfx.rlc.is_rlc_v2_1)return ;@@ -2191,7 +2193,6 @@ static void gfx_v9_0_init_pg(struct amdgpu_device *adev) AMD_PG_SUPPORT_CP | AMD_PG_SUPPORT_GDS | AMD_PG_SUPPORT_RLC_SMU_HS)) { -gfx_v9_0_init_csb (adev);gfx_v9_1_init_rlc_save_restore_list (adev);gfx_v9_0_enable_save_restore_machine (adev); --
Quoted 1 line
2.18.0
_______________________________________________
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): SN6PR12MB265670B1B3AAC47773CBA7A9E4440-kxOKjb6HO/FeL/[email protected]
Alex Deucher
Acked-byRe: [PATCH 02/10] drm/amdgpu: init CSIB regardless of rlc version and pg status
Quoted 15 lines · Evan
Ping..
Quoted 13 lines
-----Original Message-----
From: Evan Quan [mailto:[email protected]]
Sent: Thursday, July 05, 2018 5:09 PM
To: [email protected]
Cc: Quan, Evan <[email protected]>
Subject: [PATCH 02/10] drm/amdgpu: init CSIB regardless of rlc version and pg statusCSIB init has no relation with rlc version and pg status. It should be needed regardless of them.
Change-Id Iccd12e1015f41c7e2bc3fe02472dc979015514d4Signed-off-by Evan Quan <[email protected]>
Quoted 28 lines
Quoted 28 lines
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-0@@ -2182,6 +2182,8 @@ static voidgfx_v9_0_enable_gfx_dynamic_mg_power_gating(struct
amdgpu_device*adstatic void
gfx_v9_0_init_pg(struct amdgpu_device *adev){drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +2
-1+gfx_v9_0_init_csb (adev); +if (!adev->gfx.rlc.is_rlc_v2_1)return ;@@ -2191,7 +2193,6 @@ static void gfx_v9_0_init_pg(struct amdgpu_device *adev) AMD_PG_SUPPORT_CP | AMD_PG_SUPPORT_GDS | AMD_PG_SUPPORT_RLC_SMU_HS)) { -gfx_v9_0_init_csb (adev);gfx_v9_1_init_rlc_save_restore_list (adev);gfx_v9_0_enable_save_restore_machine (adev);
Quoted 7 lines
Quoted 2 lines
--
2.18.0_______________________________________________
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
PATCH 3/10 drm/amdgpu: init rlc save restore as long as the lists exist
In reply to a message not in the archiveIt does not have to be rlc v2_1 and pg enabled. For rlc v2_0, rlc save restore is also needed. And pg support is definitely not a must for rlc save restore.
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +7 -5
@@ -2184,8 +2184,13 @@ static void gfx_v9_0_init_pg(struct amdgpu_device *adev) {gfx_v9_0_init_csb (adev); -if (!adev->gfx.rlc.is_rlc_v2_1) -return ; +/* init rlc save restore as long as the lists exist */ +if (adev->gfx.rlc.reg_list_format_size_bytes && + adev->gfx.rlc.reg_list_size_bytes && + adev->gfx.rlc.reg_restore_list_size) { +gfx_v9_1_init_rlc_save_restore_list (adev); +gfx_v9_0_enable_save_restore_machine (adev); + } if (adev->pg_flags & (AMD_PG_SUPPORT_GFX_PG | AMD_PG_SUPPORT_GFX_SMG |
@@ -2193,9 +2198,6 @@ static void gfx_v9_0_init_pg(struct amdgpu_device *adev) AMD_PG_SUPPORT_CP | AMD_PG_SUPPORT_GDS | AMD_PG_SUPPORT_RLC_SMU_HS)) { -gfx_v9_1_init_rlc_save_restore_list (adev); -gfx_v9_0_enable_save_restore_machine (adev); -WREG32 (mmRLC_JUMP_TABLE_RESTORE, adev->gfx.rlc.cp_table_gpu_addr >>8 );gfx_v9_0_init_gfx_power_gating (adev);
Signature · 6 lines
2.18.0 _______________________________________________ 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): [email protected]
Re: [PATCH 03/10] drm/amdgpu: init rlc save restore as long as the lists exist
Quoted 15 lines · Evan Quan
It does not have to be rlc
v2_1and pg enabled. For rlcv2_0, rlc save restore is also needed. And pg support is definitely not a must for rlc save restore.Change-Id I85c0e3525ca7fb385c3d0b9e5abc13708c91e795Signed-off-by Evan Quan <[email protected]>--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-0
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c static void gfx_v9_0_init_pg(struct amdgpu_device *adev) · line 2187
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1
-2@@ -2184,8 +2184,13 @@ static void gfx_v9_0_init_pg(struct amdgpu_device *adev) {gfx_v9_0_init_csb (adev); -if (!adev->gfx.rlc.is_rlc_v2_1) -return ; +/* init rlc save restore as long as the lists exist */
Is there any case if the save restore list not exist? As far as I know, it should be always existed.
Thanks,
Ray
Quoted 26 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +6
-3+if (adev->gfx.rlc.reg_list_format_size_bytes && + adev->gfx.rlc.reg_list_size_bytes && + adev->gfx.rlc.reg_restore_list_size) { +gfx_v9_1_init_rlc_save_restore_list (adev); +gfx_v9_0_enable_save_restore_machine (adev); + } if (adev->pg_flags & (AMD_PG_SUPPORT_GFX_PG | AMD_PG_SUPPORT_GFX_SMG |@@ -2193,9 +2198,6 @@ static void gfx_v9_0_init_pg(struct amdgpu_device *adev) AMD_PG_SUPPORT_CP | AMD_PG_SUPPORT_GDS | AMD_PG_SUPPORT_RLC_SMU_HS)) { -gfx_v9_1_init_rlc_save_restore_list (adev); -gfx_v9_0_enable_save_restore_machine (adev); -WREG32 (mmRLC_JUMP_TABLE_RESTORE, adev->gfx.rlc.cp_table_gpu_addr >>8 );gfx_v9_0_init_gfx_power_gating (adev);Signature · 6 lines
2.18.0 _______________________________________________ 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
RE: [PATCH 03/10] drm/amdgpu: init rlc save restore as long as the lists exist
For vega10, the rlc save & restore list is still not imported yet.
Regards,
Evan
Quoted 62 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Huang Rui
Sent: Thursday, July 05, 2018 11:19 PM
To: Quan, Evan <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH 03/10] drm/amdgpu: init rlc save restore as long as the lists existQuoted 16 lines · Evan Quan
It does not have to be rlc
v2_1and pg enabled. For rlcv2_0, rlc save restore is also needed. And pg support is definitely not a must for rlc save restore.Change-Id I85c0e3525ca7fb385c3d0b9e5abc13708c91e795Signed-off-by Evan Quan <[email protected]>--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-0drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c static void gfx_v9_0_init_pg(struct · line 2187
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1
-2@@ -2184,8 +2184,13 @@ static void gfx_v9_0_init_pg(struct amdgpu_device *adev) {gfx_v9_0_init_csb (adev); -if (!adev->gfx.rlc.is_rlc_v2_1) -return ; +/* init rlc save restore as long as the lists exist */ Is there any case if the save restore list not exist? As far as I know, it should be always existed.
Thanks,
Raydrivers/gpu/drm/amd/amdgpu/gfx_v9_0.c static void gfx_v9_0_init_pg(struct
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +6
-0+if (adev->gfx.rlc.reg_list_format_size_bytes && + adev->gfx.rlc.reg_list_size_bytes && + adev->gfx.rlc.reg_restore_list_size) { +gfx_v9_1_init_rlc_save_restore_list (adev); +gfx_v9_0_enable_save_restore_machine (adev); + } if (adev->pg_flags & (AMD_PG_SUPPORT_GFX_PG | AMD_PG_SUPPORT_GFX_SMG |@@ -2193,9 +2198,6 @@ static void gfx_v9_0_init_pg(struct
amdgpu_device*adev)Quoted 12 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-4AMD_PG_SUPPORT_CP | AMD_PG_SUPPORT_GDS | AMD_PG_SUPPORT_RLC_SMU_HS)) { -gfx_v9_1_init_rlc_save_restore_list (adev); -gfx_v9_0_enable_save_restore_machine (adev); -WREG32 (mmRLC_JUMP_TABLE_RESTORE, adev->gfx.rlc.cp_table_gpu_addr >>8 );gfx_v9_0_init_gfx_power_gating (adev); --2.18.0
Quoted 8 lines
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
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 03/10] drm/amdgpu: init rlc save restore as long as the lists exist
In reply to a message not in the archiveQuoted 15 lines · Evan Quan
It does not have to be rlc
v2_1and pg enabled. For rlcv2_0, rlc save restore is also needed. And pg support is definitely not a must for rlc save restore.Change-Id I85c0e3525ca7fb385c3d0b9e5abc13708c91e795Signed-off-by Evan Quan <[email protected]>--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-0
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c static void gfx_v9_0_init_pg(struct amdgpu_device *adev) · line 2188
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-2@@ -2184,8 +2184,13 @@ static void gfx_v9_0_init_pg(struct amdgpu_device *adev) {gfx_v9_0_init_csb (adev); -if (!adev->gfx.rlc.is_rlc_v2_1) -return ;
Furthermore, as talked with you, we can continue using "adev->gfx.rlc.is_rlc_v2_1" rlc firmware header version to check if the current asic and ucode supported gfxoff, you know, we have to support legacy ucode even the driver codes are updated.
Thanks,
Ray
Quoted 27 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +7
-3+/* init rlc save restore as long as the lists exist */ +if (adev->gfx.rlc.reg_list_format_size_bytes && + adev->gfx.rlc.reg_list_size_bytes && + adev->gfx.rlc.reg_restore_list_size) { +gfx_v9_1_init_rlc_save_restore_list (adev); +gfx_v9_0_enable_save_restore_machine (adev); + } if (adev->pg_flags & (AMD_PG_SUPPORT_GFX_PG | AMD_PG_SUPPORT_GFX_SMG |@@ -2193,9 +2198,6 @@ static void gfx_v9_0_init_pg(struct amdgpu_device *adev) AMD_PG_SUPPORT_CP | AMD_PG_SUPPORT_GDS | AMD_PG_SUPPORT_RLC_SMU_HS)) { -gfx_v9_1_init_rlc_save_restore_list (adev); -gfx_v9_0_enable_save_restore_machine (adev); -WREG32 (mmRLC_JUMP_TABLE_RESTORE, adev->gfx.rlc.cp_table_gpu_addr >>8 );gfx_v9_0_init_gfx_power_gating (adev);Signature · 6 lines
2.18.0 _______________________________________________ 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
RE: [PATCH 03/10] drm/amdgpu: init rlc save restore as long as the lists exist
Hi Ray,
After reconsideration, I think for the rlc save restore related, there are the following issues:
1. To use adev->gfx.rlc.reg_list_format_direct_reg_list_length or GFX9_RLC_FORMAT_DIRECT_REG_LIST_LENGTH?
-> "reg_list_format_direct_reg_list_length" is new introduced by rlc v2_1.
To back compatible with asics(vega12,vega20 and vega10) with rlc v2_0, i will suggest to use GFX9_RLC_FORMAT_DIRECT_REG_LIST_LENGTH directly.
2. Do we need to consider the gfxoff enable/disable message + old rlc fw case?
Per my observatrion and tests, there will be no harms for such case.
Since gfxoff will actually not take effect if the rlc fw is not ready. So, we do not need to consider back compatibility here.
Conclude all, I do not think we need to update vega12 rlc from v2_0 to v2_1. The below comparations can guard we do not break old vega12 rlc fws.
+ if (adev->gfx.rlc.reg_list_format_size_bytes &&
+ adev->gfx.rlc.reg_list_size_bytes &&
+ adev->gfx.rlc.reg_restore_list_size) {
Regards,
Evan
Quoted 63 lines
-----Original Message-----
From: Huang Rui [mailto:[email protected]]
Sent: Friday, July 06, 2018 6:15 PM
To: Quan, Evan <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH 03/10] drm/amdgpu: init rlc save restore as long as the lists existQuoted 16 lines · Evan Quan
It does not have to be rlc
v2_1and pg enabled. For rlcv2_0, rlc save restore is also needed. And pg support is definitely not a must for rlc save restore.Change-Id I85c0e3525ca7fb385c3d0b9e5abc13708c91e795Signed-off-by Evan Quan <[email protected]>--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-0drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c static void gfx_v9_0_init_pg(struct · line 2188
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-2@@ -2184,8 +2184,13 @@ static void gfx_v9_0_init_pg(struct amdgpu_device *adev) {gfx_v9_0_init_csb (adev); -if (!adev->gfx.rlc.is_rlc_v2_1) -return ;Furthermore, as talked with you, we can continue using "adev-
Quoted 1 line
gfx.rlc.is_rlc_v2_1" rlc firmware header version to check if the current asic
and ucode supported gfxoff, you know, we have to support legacy ucode even the driver codes are updated.
Thanks,
Raydrivers/gpu/drm/amd/amdgpu/gfx_v9_0.c static void gfx_v9_0_init_pg(struct
Quoted 11 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +7
-0+/* init rlc save restore as long as the lists exist */ +if (adev->gfx.rlc.reg_list_format_size_bytes && + adev->gfx.rlc.reg_list_size_bytes && + adev->gfx.rlc.reg_restore_list_size) { +gfx_v9_1_init_rlc_save_restore_list (adev); +gfx_v9_0_enable_save_restore_machine (adev); + } if (adev->pg_flags & (AMD_PG_SUPPORT_GFX_PG | AMD_PG_SUPPORT_GFX_SMG |@@ -2193,9 +2198,6 @@ static void gfx_v9_0_init_pg(struct
amdgpu_device*adev)Quoted 12 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-4AMD_PG_SUPPORT_CP | AMD_PG_SUPPORT_GDS | AMD_PG_SUPPORT_RLC_SMU_HS)) { -gfx_v9_1_init_rlc_save_restore_list (adev); -gfx_v9_0_enable_save_restore_machine (adev); -WREG32 (mmRLC_JUMP_TABLE_RESTORE, adev->gfx.rlc.cp_table_gpu_addr >>8 );gfx_v9_0_init_gfx_power_gating (adev); --2.18.0
Quoted 4 lines
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
PATCH 4/10 drm/amdgpu: correct direct reg list length for v2_0 rlc
In reply to a message not in the archiveFor v2_0 rlc, rlc save restore list also needs to be initialized. However, there is no reg_list_format_direct_reg_list_length member(v2_1 spefic) for it.
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +3 -2
@@ -42,6 +42,7 @@#define GFX9_MEC_HPD_SIZE 2048#define RLCG_UCODE_LOADING_START_ADDRESS 0x00002000L#define RLC_SAVE_RESTORE_ADDR_STARTING_OFFSET 0x00000000L +#define GFX9_RLC_FORMAT_DIRECT_REG_LIST_LENGTH 34#define mmPWR_MISC_CNTL_STATUS 0x0183#define mmPWR_MISC_CNTL_STATUS_BASE_IDX 0
@@ -1927,7 +1928,7 @@ static int gfx_v9_1_init_rlc_save_restore_list(struct amdgpu_device *adev)/* setup unique_indirect_regs array and indirect_start_offsets array */ unique_indirect_reg_count =ARRAY_SIZE (unique_indirect_regs); gfx_v9_1_parse_ind_reg_list(register_list_format, - adev->gfx.rlc.reg_list_format_direct_reg_list_length, + GFX9_RLC_FORMAT_DIRECT_REG_LIST_LENGTH, adev->gfx.rlc.reg_list_format_size_bytes >> 2, unique_indirect_regs, unique_indirect_reg_count,
@@ -1952,7 +1953,7 @@ static int gfx_v9_1_init_rlc_save_restore_list(struct amdgpu_device *adev) adev->gfx.rlc.reg_list_format_start);/* direct register portion */ -for (i =0 ; i < adev->gfx.rlc.reg_list_format_direct_reg_list_length; i++) +for (i =0 ; i <GFX9_RLC_FORMAT_DIRECT_REG_LIST_LENGTH ; i++)WREG32 (SOC15_REG_OFFSET (GC ,0 , mmRLC_GPM_SCRATCH_DATA), register_list_format[i]);
Signature · 6 lines
2.18.0 _______________________________________________ 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): [email protected]
Re: [PATCH 04/10] drm/amdgpu: correct direct reg list length for v2_0 rlc
Quoted 32 lines · Evan Quan
For
v2_0rlc, rlc save restore list also needs to be initialized. However, there is noreg_list_format_direct_reg_list_lengthmember(v2_1 spefic)for it.Change-Id I29bfe441c4f4b4726a7dd61b315347fea057163bSigned-off-by Evan Quan <[email protected]>--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +2
-1@@ -42,6 +42,7 @@#define GFX9_MEC_HPD_SIZE 2048#define RLCG_UCODE_LOADING_START_ADDRESS 0x00002000L#define RLC_SAVE_RESTORE_ADDR_STARTING_OFFSET 0x00000000L +#define GFX9_RLC_FORMAT_DIRECT_REG_LIST_LENGTH 34#define mmPWR_MISC_CNTL_STATUS 0x0183#define mmPWR_MISC_CNTL_STATUS_BASE_IDX 0@@ -1927,7 +1928,7 @@ static int gfx_v9_1_init_rlc_save_restore_list(struct amdgpu_device *adev)/* setup unique_indirect_regs array and indirect_start_offsets array */ unique_indirect_reg_count =ARRAY_SIZE (unique_indirect_regs); gfx_v9_1_parse_ind_reg_list(register_list_format, - adev->gfx.rlc.reg_list_format_direct_reg_list_length, + GFX9_RLC_FORMAT_DIRECT_REG_LIST_LENGTH, adev->gfx.rlc.reg_list_format_size_bytes >> 2, unique_indirect_regs, unique_indirect_reg_count,
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c static int gfx_v9_1_init_rlc_save_restore_list(struct amdgpu_device *adev) · line 1956
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1
-1@@ -1952,7 +1953,7 @@ static int gfx_v9_1_init_rlc_save_restore_list(struct amdgpu_device *adev) adev->gfx.rlc.reg_list_format_start);/* direct register portion */ -for (i =0 ; i < adev->gfx.rlc.reg_list_format_direct_reg_list_length; i++) +for (i =0 ; i <GFX9_RLC_FORMAT_DIRECT_REG_LIST_LENGTH ; i++)
This definition is actually defined on register_list_format.h in the ucode. So we would better to put it in firmware header.
Thanks,
Ray
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-0WREG32 (SOC15_REG_OFFSET (GC ,0 , mmRLC_GPM_SCRATCH_DATA), register_list_format[i]);Signature · 6 lines
2.18.0 _______________________________________________ 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
RE: [PATCH 04/10] drm/amdgpu: correct direct reg list length for v2_0 rlc
As discussed for patch3, reg_list_format_direct_reg_list_length is newly introduced by rlc v2_1. For ASICs(vega10/12/20) with rlc v2_0, it's not a good idea to use reg_list_format_direct_reg_list_length.
Regards,
Evan
Quoted 59 lines
-----Original Message-----
From: Huang Rui [mailto:[email protected]]
Sent: Thursday, July 05, 2018 11:07 PM
To: Quan, Evan <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH 04/10] drm/amdgpu: correct direct reg list length forv2_0rlcQuoted 21 lines · Evan Quan
For
v2_0rlc, rlc save restore list also needs to be initialized. However, there is noreg_list_format_direct_reg_list_lengthmember(v2_1 spefic)for it.Change-Id I29bfe441c4f4b4726a7dd61b315347fea057163bSigned-off-by Evan Quan <[email protected]>--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-0@@ -42,6 +42,7 @@#define GFX9_MEC_HPD_SIZE 2048#define RLCG_UCODE_LOADING_START_ADDRESS 0x00002000L #define
RLC_SAVE_RESTORE_ADDR_STARTING_OFFSET0x00000000L+#defineGFX9_RLC_FORMAT_DIRECT_REG_LIST_LENGTH34Quoted 1 line
#define
mmPWR_MISC_CNTL_STATUS0x0183Quoted 1 line
#define
mmPWR_MISC_CNTL_STATUS_BASE_IDX0drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c static int
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-0@@ -1927,7 +1928,7 @@ static int
gfx_v9_1_init_rlc_save_restore_list(struct amdgpu_device *adev)drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c static int · line 1928
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-0/* setup unique_indirect_regs array and indirect_start_offsets array */
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c static int · line 1932
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1
-1unique_indirect_reg_count =ARRAY_SIZE (unique_indirect_regs); gfx_v9_1_parse_ind_reg_list(register_list_format, - adev- gfx.rlc.reg_list_format_direct_reg_list_length, +
GFX9_RLC_FORMAT_DIRECT_REG_LIST_LENGTH,drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c static int · line 1933
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-0adev->gfx.rlc.reg_list_format_size_bytes >>2,
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c static int
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-0unique_indirect_regs,drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-0unique_indirect_reg_count,@@ -1952,7 +1953,7 @@ static int
gfx_v9_1_init_rlc_save_restore_list(struct amdgpu_device *adev)drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c static int gfx_v9_1_init_rlc_save_restore_list(struct amdgpu_device *adev) · line 1956
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1
-1adev->gfx.rlc.reg_list_format_start);/* direct register portion */ -for (i =0 ; i < adev->gfx.rlc.reg_list_format_direct_reg_list_length; i++) +for (i =0 ; i <GFX9_RLC_FORMAT_DIRECT_REG_LIST_LENGTH ; i++)This definition is actually defined on
register_list_format.hin the ucode. So we would better to put it in firmware header.
Quoted 14 lines
Thanks,
Raydrivers/gpu/drm/amd/amdgpu/gfx_v9_0.c static int · line 1957
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-0WREG32(SOC15_REG_OFFSET(GC, 0,
mmRLC_GPM_SCRATCH_DATA),Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-1register_list_format[i]); --2.18.0
_______________________________________________
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
PATCH 5/10 drm/amdgpu: drop mmRLC_PG_CNTL clear
In reply to a message not in the archiveThis may break gfxoff support since this register will be set by smc fw(for vega12, that's the case).
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 3 --- 1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0 -3
@@ -2290,9 +2290,6 @@ static int gfx_v9_0_rlc_resume(struct amdgpu_device *adev)/* disable CG */ WREG32_SOC15 (GC ,0 , mmRLC_CGCG_CGLS_CTRL,0 ); -/* disable PG */ -WREG32_SOC15 (GC ,0 , mmRLC_PG_CNTL,0 ); -gfx_v9_0_rlc_reset (adev);gfx_v9_0_init_pg (adev);
Signature · 6 lines
2.18.0 _______________________________________________ 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): [email protected]
Huang Rui
Reviewed-byRe: [PATCH 05/10] drm/amdgpu: drop mmRLC_PG_CNTL clear
Quoted 5 lines · Evan Quan
This may break gfxoff support since this register will be set by smc
fw(for vega12, that's the case).Change-Id Id3108c63634a2f941289021bfbd78588c0f6c4d6Signed-off-by Evan Quan <[email protected]>
Quoted 25 lines
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 3 --- 1 file changed, 3 deletions(-)drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-3@@ -2290,9 +2290,6 @@ static int gfx_v9_0_rlc_resume(struct amdgpu_device *adev)/* disable CG */ WREG32_SOC15 (GC ,0 , mmRLC_CGCG_CGLS_CTRL,0 ); -/* disable PG */ -WREG32_SOC15 (GC ,0 , mmRLC_PG_CNTL,0 ); -gfx_v9_0_rlc_reset (adev);gfx_v9_0_init_pg (adev);Signature · 6 lines
2.18.0 _______________________________________________ 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
Alex Deucher
Reviewed-byRe: [PATCH 05/10] drm/amdgpu: drop mmRLC_PG_CNTL clear
In reply to a message not in the archiveQuoted 3 lines · Evan Quan
This may break gfxoff support since this register will be set by smc
fw(for vega12, that's the case).
It took me a second to understand what you meant here. Might be worthwhile to clarify with something like:
SMU owns this register so the driver should not set it to avoid breaking gfxoff.
With that fixed up:
Alex
Quoted 23 lines
Change-Id Id3108c63634a2f941289021bfbd78588c0f6c4d6Signed-off-by Evan Quan <[email protected]>--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 3 --- 1 file changed, 3 deletions(-)drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-4@@ -2290,9 +2290,6 @@ static int gfx_v9_0_rlc_resume(struct amdgpu_device *adev)/* disable CG */ WREG32_SOC15 (GC ,0 , mmRLC_CGCG_CGLS_CTRL,0 ); -/* disable PG */ -WREG32_SOC15 (GC ,0 , mmRLC_PG_CNTL,0 ); -gfx_v9_0_rlc_reset (adev);gfx_v9_0_init_pg (adev); --2.18.0
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
A message that is not in the archive (sent off-list or not yet received): CADnq5_Mkjuj9hLahht=s70wwXKNqnRcaFMJNjOjR8HSh_DWpUw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Re: [PATCH 05/10] drm/amdgpu: drop mmRLC_PG_CNTL clear
Quoted 9 lines · Alex Deucher
Quoted 3 lines · Evan Quan
This may break gfxoff support since this register will be set by smc
fw(for vega12, that's the case).It took me a second to understand what you meant here. Might be worthwhile to clarify with something like:
SMU owns this register so the driver should not set it to avoid breaking gfxoff.
Agree. Actually, it cleared Ultra_Low_Voltage_Enable bit of mmRLC_PG_CNTL, that caused gfxoff break before. We should have explained clearly here. :-)
Thanks,
Ray
Quoted 28 lines
With that fixed up:
Reviewed-by Alex Deucher <[email protected]>Alex
Quoted 23 lines
Change-Id Id3108c63634a2f941289021bfbd78588c0f6c4d6Signed-off-by Evan Quan <[email protected]>--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 3 --- 1 file changed, 3 deletions(-)drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-4@@ -2290,9 +2290,6 @@ static int gfx_v9_0_rlc_resume(struct amdgpu_device *adev)/* disable CG */ WREG32_SOC15 (GC ,0 , mmRLC_CGCG_CGLS_CTRL,0 ); -/* disable PG */ -WREG32_SOC15 (GC ,0 , mmRLC_PG_CNTL,0 ); -gfx_v9_0_rlc_reset (adev);gfx_v9_0_init_pg (adev); --2.18.0
Quoted 8 lines
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
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/10 drm/amdgpu: no touch for the reserved bit of RLC_CGTT_MGCG_OVERRIDE
In reply to a message not in the archiveOn vega12, the bit0 of RLC_CGTT_MGCG_OVERRIDE is reserved.
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +11 -4
@@ -3551,8 +3551,11 @@ static void gfx_v9_0_update_medium_grain_clock_gating(struct amdgpu_device *adevif (enable && (adev->cg_flags &AMD_CG_SUPPORT_GFX_MGCG )) {/* 1 - RLC_CGTT_MGCG_OVERRIDE */ def = data =RREG32_SOC15 (GC ,0 , mmRLC_CGTT_MGCG_OVERRIDE); - data &= ~(RLC_CGTT_MGCG_OVERRIDE__CPF_CGTT_SCLK_OVERRIDE_MASK | -RLC_CGTT_MGCG_OVERRIDE__GRBM_CGTT_SCLK_OVERRIDE_MASK | + +if (adev->asic_type !=CHIP_VEGA12 ) + data &= ~RLC_CGTT_MGCG_OVERRIDE__CPF_CGTT_SCLK_OVERRIDE_MASK ; + + data &= ~(RLC_CGTT_MGCG_OVERRIDE__GRBM_CGTT_SCLK_OVERRIDE_MASK |RLC_CGTT_MGCG_OVERRIDE__GFXIP_MGCG_OVERRIDE_MASK |RLC_CGTT_MGCG_OVERRIDE__GFXIP_MGLS_OVERRIDE_MASK );
@@ -3582,11 +3585,15 @@ static void gfx_v9_0_update_medium_grain_clock_gating(struct amdgpu_device *adev }else {/* 1 - MGCG_OVERRIDE */ def = data =RREG32_SOC15 (GC ,0 , mmRLC_CGTT_MGCG_OVERRIDE); - data |= (RLC_CGTT_MGCG_OVERRIDE__CPF_CGTT_SCLK_OVERRIDE_MASK | -RLC_CGTT_MGCG_OVERRIDE__RLC_CGTT_SCLK_OVERRIDE_MASK | + +if (adev->asic_type !=CHIP_VEGA12 ) + data |=RLC_CGTT_MGCG_OVERRIDE__CPF_CGTT_SCLK_OVERRIDE_MASK ; + + data |= (RLC_CGTT_MGCG_OVERRIDE__RLC_CGTT_SCLK_OVERRIDE_MASK |RLC_CGTT_MGCG_OVERRIDE__GRBM_CGTT_SCLK_OVERRIDE_MASK |RLC_CGTT_MGCG_OVERRIDE__GFXIP_MGCG_OVERRIDE_MASK |RLC_CGTT_MGCG_OVERRIDE__GFXIP_MGLS_OVERRIDE_MASK ); +if (def != data)WREG32_SOC15 (GC ,0 , mmRLC_CGTT_MGCG_OVERRIDE, data);
Signature · 6 lines
2.18.0 _______________________________________________ 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): [email protected]
RE: [PATCH 06/10] drm/amdgpu: no touch for the reserved bit of RLC_CGTT_MGCG_OVERRIDE
Ping..
Quoted 71 lines
-----Original Message-----
From: Evan Quan [mailto:[email protected]]
Sent: Thursday, July 05, 2018 5:10 PM
To: [email protected]
Cc: Quan, Evan <[email protected]>
Subject: [PATCH 06/10] drm/amdgpu: no touch for the reserved bit ofRLC_CGTT_MGCG_OVERRIDEOn vega12, the bit0 of
RLC_CGTT_MGCG_OVERRIDEis reserved.Change-Id I9042a8c89db16f220da5a589264937b51870c187Signed-off-by Evan Quan <[email protected]>--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-0@@ -3551,8 +3551,11 @@ static voidgfx_v9_0_update_medium_grain_clock_gating(struct
amdgpu_device*adevdrivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-0if (enable && (adev->cg_flags &AMD_CG_SUPPORT_GFX_MGCG )) {/* 1 - RLC_CGTT_MGCG_OVERRIDE */ def = data = RREG32_SOC15(GC, 0,
mmRLC_CGTT_MGCG_OVERRIDE);drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-1- data &=~(RLC_CGTT_MGCG_OVERRIDE__CPF_CGTT_SCLK_OVERRIDE_MASK | -
RLC_CGTT_MGCG_OVERRIDE__GRBM_CGTT_SCLK_OVERRIDE_MASK|drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +3
-0+ +if (adev->asic_type !=CHIP_VEGA12 ) + data &=~RLC_CGTT_MGCG_OVERRIDE__CPF_CGTT_SCLK_OVERRIDE_MASK;
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +2
-0+ + data &=~(RLC_CGTT_MGCG_OVERRIDE__GRBM_CGTT_SCLK_OVERRIDE_MASK |
RLC_CGTT_MGCG_OVERRIDE__GFXIP_MGCG_OVERRIDE_MASK|
RLC_CGTT_MGCG_OVERRIDE__GFXIP_MGLS_OVERRIDE_MASK);drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-0@@ -3582,11 +3585,15 @@ static voidgfx_v9_0_update_medium_grain_clock_gating(struct
amdgpu_device*adevdrivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-0}else {/* 1 - MGCG_OVERRIDE */ def = data = RREG32_SOC15(GC, 0,
mmRLC_CGTT_MGCG_OVERRIDE);drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-1- data |=(
RLC_CGTT_MGCG_OVERRIDE__CPF_CGTT_SCLK_OVERRIDE_MASK| -RLC_CGTT_MGCG_OVERRIDE__RLC_CGTT_SCLK_OVERRIDE_MASK|drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +3
-0+ +if (adev->asic_type !=CHIP_VEGA12 ) + data |=
RLC_CGTT_MGCG_OVERRIDE__CPF_CGTT_SCLK_OVERRIDE_MASK;drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +2
-0+ + data |=(
RLC_CGTT_MGCG_OVERRIDE__RLC_CGTT_SCLK_OVERRIDE_MASK|
RLC_CGTT_MGCG_OVERRIDE__GRBM_CGTT_SCLK_OVERRIDE_MASK|
RLC_CGTT_MGCG_OVERRIDE__GFXIP_MGCG_OVERRIDE_MASK|
RLC_CGTT_MGCG_OVERRIDE__GFXIP_MGLS_OVERRIDE_MASK);drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1
-0+if (def != data) WREG32_SOC15(GC, 0,
mmRLC_CGTT_MGCG_OVERRIDE, data);
Quoted 2 lines
--
2.18.0
_______________________________________________
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): SN6PR12MB2656F298CDBE1A2607BA5B36E4440-kxOKjb6HO/FeL/[email protected]
Alex Deucher
Acked-byRe: [PATCH 06/10] drm/amdgpu: no touch for the reserved bit of RLC_CGTT_MGCG_OVERRIDE
Quoted 14 lines · Evan
Ping..
Quoted 12 lines
-----Original Message-----
From: Evan Quan [mailto:[email protected]]
Sent: Thursday, July 05, 2018 5:10 PM
To: [email protected]
Cc: Quan, Evan <[email protected]>
Subject: [PATCH 06/10] drm/amdgpu: no touch for the reserved bit ofRLC_CGTT_MGCG_OVERRIDEOn vega12, the bit0 of
RLC_CGTT_MGCG_OVERRIDEis reserved.Change-Id I9042a8c89db16f220da5a589264937b51870c187Signed-off-by Evan Quan <[email protected]>
Quoted 59 lines
Quoted 59 lines
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-0@@ -3551,8 +3551,11 @@ static voidgfx_v9_0_update_medium_grain_clock_gating(struct
amdgpu_device*adevif (enable && (adev->cg_flags & AMD_CG_SUPPORT_GFX_MGCG)) { /* 1 - RLC_CGTT_MGCG_OVERRIDE */ def = data = RREG32_SOC15(GC, 0,
mmRLC_CGTT_MGCG_OVERRIDE);
- data &=
~(RLC_CGTT_MGCG_OVERRIDE__CPF_CGTT_SCLK_OVERRIDE_MASK | -RLC_CGTT_MGCG_OVERRIDE__GRBM_CGTT_SCLK_OVERRIDE_MASK|drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +3
-0+ +if (adev->asic_type !=CHIP_VEGA12 ) + data &=~RLC_CGTT_MGCG_OVERRIDE__CPF_CGTT_SCLK_OVERRIDE_MASK;
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +2
-0+ + data &=~(RLC_CGTT_MGCG_OVERRIDE__GRBM_CGTT_SCLK_OVERRIDE_MASK |
RLC_CGTT_MGCG_OVERRIDE__GFXIP_MGCG_OVERRIDE_MASK|
RLC_CGTT_MGCG_OVERRIDE__GFXIP_MGLS_OVERRIDE_MASK);drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-0@@ -3582,11 +3585,15 @@ static voidgfx_v9_0_update_medium_grain_clock_gating(struct
amdgpu_device*adev} else { /* 1 - MGCG_OVERRIDE */ def = data = RREG32_SOC15(GC, 0,
mmRLC_CGTT_MGCG_OVERRIDE);
- data |=
(RLC_CGTT_MGCG_OVERRIDE__CPF_CGTT_SCLK_OVERRIDE_MASK| -RLC_CGTT_MGCG_OVERRIDE__RLC_CGTT_SCLK_OVERRIDE_MASK|drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +3
-0+ +if (adev->asic_type !=CHIP_VEGA12 ) + data |=
RLC_CGTT_MGCG_OVERRIDE__CPF_CGTT_SCLK_OVERRIDE_MASK;drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +2
-0+ + data |=(
RLC_CGTT_MGCG_OVERRIDE__RLC_CGTT_SCLK_OVERRIDE_MASK|
RLC_CGTT_MGCG_OVERRIDE__GRBM_CGTT_SCLK_OVERRIDE_MASK|
RLC_CGTT_MGCG_OVERRIDE__GFXIP_MGCG_OVERRIDE_MASK|
RLC_CGTT_MGCG_OVERRIDE__GFXIP_MGLS_OVERRIDE_MASK); +if (def != data) WREG32_SOC15(GC, 0,
mmRLC_CGTT_MGCG_OVERRIDE, data);
Quoted 7 lines
Quoted 2 lines
--
2.18.0_______________________________________________
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
PATCH 7/10 drm/amdgpu: reduce the idle period that RLC has to wait before request CGCG
In reply to a message not in the archiveGfxoff feature may depends on the CGCG(on vega12, that's the case). This change will help to enable gfxoff feature more frequently.
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +7 -4
@@ -3629,9 +3629,11 @@ static void gfx_v9_0_update_3d_clock_gating(struct amdgpu_device *adev,/* update CGCG and CGLS override bits */ if (def != data)WREG32_SOC15 (GC ,0 , mmRLC_CGTT_MGCG_OVERRIDE, data); -/* enable 3Dcgcg FSM(0x0020003f) */ + +/* enable 3Dcgcg FSM(0x0000363f) */ def =RREG32_SOC15 (GC ,0 , mmRLC_CGCG_CGLS_CTRL_3D); - data = (0x2000 <<RLC_CGCG_CGLS_CTRL_3D__CGCG_GFX_IDLE_THRESHOLD__SHIFT ) | + + data = (0x36 <<RLC_CGCG_CGLS_CTRL_3D__CGCG_GFX_IDLE_THRESHOLD__SHIFT ) |RLC_CGCG_CGLS_CTRL_3D__CGCG_EN_MASK ;if (adev->cg_flags &AMD_CG_SUPPORT_GFX_3D_CGLS ) data |= (0x000F << RLC_CGCG_CGLS_CTRL_3D__CGLS_REP_COMPANSAT_DELAY__SHIFT) |
@@ -3678,9 +3680,10 @@ static void gfx_v9_0_update_coarse_grain_clock_gating(struct amdgpu_device *adevif (def != data)WREG32_SOC15 (GC ,0 , mmRLC_CGTT_MGCG_OVERRIDE, data); -/* enable cgcg FSM(0x0020003F) */ +/* enable cgcg FSM(0x0000363F) */ def =RREG32_SOC15 (GC ,0 , mmRLC_CGCG_CGLS_CTRL); - data = (0x2000 <<RLC_CGCG_CGLS_CTRL__CGCG_GFX_IDLE_THRESHOLD__SHIFT ) | + + data = (0x36 <<RLC_CGCG_CGLS_CTRL__CGCG_GFX_IDLE_THRESHOLD__SHIFT ) |RLC_CGCG_CGLS_CTRL__CGCG_EN_MASK ;if (adev->cg_flags &AMD_CG_SUPPORT_GFX_CGLS ) data |= (0x000F << RLC_CGCG_CGLS_CTRL__CGLS_REP_COMPANSAT_DELAY__SHIFT) |
Signature · 6 lines
2.18.0 _______________________________________________ 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): [email protected]
RE: [PATCH 07/10] drm/amdgpu: reduce the idle period that RLC has to wait before request CGCG
Ping..
Quoted 58 lines
-----Original Message-----
From: Evan Quan [mailto:[email protected]]
Sent: Thursday, July 05, 2018 5:10 PM
To: [email protected]
Cc: Quan, Evan <[email protected]>
Subject: [PATCH 07/10] drm/amdgpu: reduce the idle period that RLC has to wait before request CGCGGfxoff feature may depends on the
CGCG(on vega12, that's the case). This change will help to enable gfxoff feature more frequently.Change-Id I021577e331b7beb19796bd6f5465b867f6038974Signed-off-by Evan Quan <[email protected]>--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +2
-2@@ -3629,9 +3629,11 @@ static void gfx_v9_0_update_3d_clock_gating(struct amdgpu_device *adev,/* update CGCG and CGLS override bits */ if (def != data) WREG32_SOC15(GC, 0, mmRLC_CGTT_MGCG_OVERRIDE, data); - /* enable 3Dcgcg FSM(0x0020003f) */ + +/* enable 3Dcgcg FSM(0x0000363f) */ def =RREG32_SOC15 (GC ,0 , mmRLC_CGCG_CGLS_CTRL_3D); - data = (0x2000 <<
RLC_CGCG_CGLS_CTRL_3D__CGCG_GFX_IDLE_THRESHOLD__SHIFT) |drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +3
-0+ + data = (0x36 << +RLC_CGCG_CGLS_CTRL_3D__CGCG_GFX_IDLE_THRESHOLD__SHIFT ) |RLC_CGCG_CGLS_CTRL_3D__CGCG_EN_MASK ;if (adev->cg_flags &AMD_CG_SUPPORT_GFX_3D_CGLS ) data |= (0x000F <<
RLC_CGCG_CGLS_CTRL_3D__CGLS_REP_COMPANSAT_DELAY__SHIFT) |drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-0@@ -3678,9 +3680,10 @@ static voidgfx_v9_0_update_coarse_grain_clock_gating(struct
amdgpu_device*adevdrivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-0if (def != data) WREG32_SOC15(GC, 0,
mmRLC_CGTT_MGCG_OVERRIDE, data);drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1
-2-/* enable cgcg FSM(0x0020003F) */ +/* enable cgcg FSM(0x0000363F) */ def =RREG32_SOC15 (GC ,0 , mmRLC_CGCG_CGLS_CTRL); - data = (0x2000 <<
RLC_CGCG_CGLS_CTRL__CGCG_GFX_IDLE_THRESHOLD__SHIFT) |drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +2
-0+ + data = (0x36 <<
RLC_CGCG_CGLS_CTRL__CGCG_GFX_IDLE_THRESHOLD__SHIFT) |drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-0RLC_CGCG_CGLS_CTRL__CGCG_EN_MASK ;if (adev->cg_flags &AMD_CG_SUPPORT_GFX_CGLS ) data |= (0x000F <<
Quoted 3 lines
RLC_CGCG_CGLS_CTRL__CGLS_REP_COMPANSAT_DELAY__SHIFT) | --
2.18.0
_______________________________________________
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): SN6PR12MB2656009EA5F895E6F2B399B5E4440-kxOKjb6HO/FeL/[email protected]
Alex Deucher
Acked-byRe: [PATCH 07/10] drm/amdgpu: reduce the idle period that RLC has to wait before request CGCG
Quoted 12 lines · Evan
Ping..
Quoted 10 lines
-----Original Message-----
From: Evan Quan [mailto:[email protected]]
Sent: Thursday, July 05, 2018 5:10 PM
To: [email protected]
Cc: Quan, Evan <[email protected]>
Subject: [PATCH 07/10] drm/amdgpu: reduce the idle period that RLC has to wait before request CGCGGfxoff feature may depends on the
CGCG(on vega12, that's the case). This change will help to enable gfxoff feature more frequently.
I assume this is ok for RV gfxoff as well? if so:
Quoted 48 lines
Quoted 48 lines
Change-Id I021577e331b7beb19796bd6f5465b867f6038974Signed-off-by Evan Quan <[email protected]>--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +2
-2@@ -3629,9 +3629,11 @@ static void gfx_v9_0_update_3d_clock_gating(struct amdgpu_device *adev,/* update CGCG and CGLS override bits */ if (def != data) WREG32_SOC15(GC, 0, mmRLC_CGTT_MGCG_OVERRIDE, data); - /* enable 3Dcgcg FSM(0x0020003f) */ + +/* enable 3Dcgcg FSM(0x0000363f) */ def =RREG32_SOC15 (GC ,0 , mmRLC_CGCG_CGLS_CTRL_3D); - data = (0x2000 <<
RLC_CGCG_CGLS_CTRL_3D__CGCG_GFX_IDLE_THRESHOLD__SHIFT) |drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +3
-0+ + data = (0x36 << +RLC_CGCG_CGLS_CTRL_3D__CGCG_GFX_IDLE_THRESHOLD__SHIFT ) |RLC_CGCG_CGLS_CTRL_3D__CGCG_EN_MASK ;if (adev->cg_flags &AMD_CG_SUPPORT_GFX_3D_CGLS ) data |= (0x000F <<
RLC_CGCG_CGLS_CTRL_3D__CGLS_REP_COMPANSAT_DELAY__SHIFT) |drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-0@@ -3678,9 +3680,10 @@ static voidgfx_v9_0_update_coarse_grain_clock_gating(struct
amdgpu_device*adevif (def != data) WREG32_SOC15(GC, 0,
mmRLC_CGTT_MGCG_OVERRIDE, data);drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1
-2-/* enable cgcg FSM(0x0020003F) */ +/* enable cgcg FSM(0x0000363F) */ def =RREG32_SOC15 (GC ,0 , mmRLC_CGCG_CGLS_CTRL); - data = (0x2000 <<
RLC_CGCG_CGLS_CTRL__CGCG_GFX_IDLE_THRESHOLD__SHIFT) |drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +2
-0+ + data = (0x36 <<
RLC_CGCG_CGLS_CTRL__CGCG_GFX_IDLE_THRESHOLD__SHIFT) |RLC_CGCG_CGLS_CTRL__CGCG_EN_MASK; if (adev->cg_flags & AMD_CG_SUPPORT_GFX_CGLS) data |= (0x000F <<
Quoted 8 lines
Quoted 3 lines
RLC_CGCG_CGLS_CTRL__CGLS_REP_COMPANSAT_DELAY__SHIFT) | --
2.18.0_______________________________________________
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
A message that is not in the archive (sent off-list or not yet received): CADnq5_NhmSk62EE3VG+V-=9M-pWZo-jJzzrLKL_K0By2_OaQ7g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
RE: [PATCH 07/10] drm/amdgpu: reduce the idle period that RLC has to wait before request CGCG
Yes, Rv gfxoff is not affected.
Regards,
Evan
Quoted 60 lines
-----Original Message-----
From: Alex Deucher [mailto:[email protected]]
Sent: Wednesday, July 11, 2018 1:20 AM
To: Quan, Evan <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH 07/10] drm/amdgpu: reduce the idle period that RLC has to wait before request CGCGQuoted 12 lines · Evan
Ping..
Quoted 10 lines
-----Original Message-----
From: Evan Quan [mailto:[email protected]]
Sent: Thursday, July 05, 2018 5:10 PM
To: [email protected]
Cc: Quan, Evan <[email protected]>
Subject: [PATCH 07/10] drm/amdgpu: reduce the idle period that RLC has to wait before request CGCGGfxoff feature may depends on the
CGCG(on vega12, that's the case). This change will help to enable gfxoff feature more frequently.I assume this is ok for RV gfxoff as well? if so:
Acked-by Alex Deucher <[email protected]>Quoted 23 lines
Quoted 23 lines
Change-Id I021577e331b7beb19796bd6f5465b867f6038974Signed-off-by Evan Quan <[email protected]>--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +2
-2@@ -3629,9 +3629,11 @@ static void gfx_v9_0_update_3d_clock_gating(struct amdgpu_device *adev,/* update CGCG and CGLS override bits */ if (def != data) WREG32_SOC15(GC, 0, mmRLC_CGTT_MGCG_OVERRIDE, data); - /* enable 3Dcgcg FSM(0x0020003f) */ + +/* enable 3Dcgcg FSM(0x0000363f) */ def =RREG32_SOC15 (GC ,0 , mmRLC_CGCG_CGLS_CTRL_3D); - data = (0x2000 <<Quoted 8 lines
Quoted 8 lines
RLC_CGCG_CGLS_CTRL_3D__CGCG_GFX_IDLE_THRESHOLD__SHIFT) |drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +3
-0+ + data = (0x36 << +RLC_CGCG_CGLS_CTRL_3D__CGCG_GFX_IDLE_THRESHOLD__SHIFT ) |RLC_CGCG_CGLS_CTRL_3D__CGCG_EN_MASK ;if (adev->cg_flags &AMD_CG_SUPPORT_GFX_3D_CGLS ) data |= (0x000F <<
RLC_CGCG_CGLS_CTRL_3D__CGLS_REP_COMPANSAT_DELAY__SHIFT) |@@ -3678,9
Quoted 26 lines
Quoted 2 lines
Quoted 2 lines
+3680,10 @@ static void gfx_v9_0_update_coarse_grain_clock_gating(struct
amdgpu_device*adev
Quoted 23 lines
Quoted 12 lines
if (def != data) WREG32_SOC15(GC, 0, mmRLC_CGTT_MGCG_OVERRIDE,data);
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1
-2-/* enable cgcg FSM(0x0020003F) */ +/* enable cgcg FSM(0x0000363F) */ def =RREG32_SOC15 (GC ,0 , mmRLC_CGCG_CGLS_CTRL); - data = (0x2000 <<
RLC_CGCG_CGLS_CTRL__CGCG_GFX_IDLE_THRESHOLD__SHIFT) |drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +2
-0+ + data = (0x36 <<
RLC_CGCG_CGLS_CTRL__CGCG_GFX_IDLE_THRESHOLD__SHIFT) |Quoted 6 lines
RLC_CGCG_CGLS_CTRL__CGCG_EN_MASK; if (adev->cg_flags & AMD_CG_SUPPORT_GFX_CGLS) data |= (0x000F <<
RLC_CGCG_CGLS_CTRL__CGLS_REP_COMPANSAT_DELAY__SHIFT) | --
2.18.0_______________________________________________
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
PATCH 8/10 drm/amdgpu: use the accessible target rlc safe mode Apis directly
In reply to a message not in the archiveNo need to do double dereference to reach the Apis. They are accessible directly.
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +4 -4
@@ -3618,7 +3618,7 @@ static void gfx_v9_0_update_3d_clock_gating(struct amdgpu_device *adev, {uint32_t data, def; - adev->gfx.rlc.funcs->enter_safe_mode (adev); +gfx_v9_0_enter_rlc_safe_mode (adev);/* Enable 3D CGCG/CGLS */ if (enable && (adev->cg_flags &AMD_CG_SUPPORT_GFX_3D_CGCG )) {
@@ -3658,7 +3658,7 @@ static void gfx_v9_0_update_3d_clock_gating(struct amdgpu_device *adev,WREG32_SOC15 (GC ,0 , mmRLC_CGCG_CGLS_CTRL_3D, data); } - adev->gfx.rlc.funcs->exit_safe_mode (adev); +gfx_v9_0_exit_rlc_safe_mode (adev); } static void gfx_v9_0_update_coarse_grain_clock_gating(struct amdgpu_device *adev,
@@ -3666,7 +3666,7 @@ static void gfx_v9_0_update_coarse_grain_clock_gating(struct amdgpu_device *adev {uint32_t def, data; - adev->gfx.rlc.funcs->enter_safe_mode (adev); +gfx_v9_0_enter_rlc_safe_mode (adev);if (enable && (adev->cg_flags &AMD_CG_SUPPORT_GFX_CGCG )) { def = data =RREG32_SOC15 (GC ,0 , mmRLC_CGTT_MGCG_OVERRIDE);
@@ -3706,7 +3706,7 @@ static void gfx_v9_0_update_coarse_grain_clock_gating(struct amdgpu_device *adevWREG32_SOC15 (GC ,0 , mmRLC_CGCG_CGLS_CTRL, data); } - adev->gfx.rlc.funcs->exit_safe_mode (adev); +gfx_v9_0_exit_rlc_safe_mode (adev); } static int gfx_v9_0_update_gfx_clock_gating(struct amdgpu_device *adev,
Signature · 6 lines
2.18.0 _______________________________________________ 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): [email protected]
RE: [PATCH 08/10] drm/amdgpu: use the accessible target rlc safe mode Apis directly
Ping..
Quoted 63 lines
-----Original Message-----
From: Evan Quan [mailto:[email protected]]
Sent: Thursday, July 05, 2018 5:10 PM
To: [email protected]
Cc: Quan, Evan <[email protected]>
Subject: [PATCH 08/10] drm/amdgpu: use the accessible target rlc safe mode Apis directlyNo need to do double dereference to reach the Apis. They are accessible directly.
Change-Id I4b810c5e1981e0810df36a701b20edaf1f6af207Signed-off-by Evan Quan <[email protected]>--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1
-1@@ -3618,7 +3618,7 @@ static void gfx_v9_0_update_3d_clock_gating(struct amdgpu_device *adev, { uint32_t data, def; - adev->gfx.rlc.funcs->enter_safe_mode (adev); +gfx_v9_0_enter_rlc_safe_mode (adev);/* Enable 3D CGCG/CGLS */ if (enable && (adev->cg_flags &
AMD_CG_SUPPORT_GFX_3D_CGCG)) { @@ -3658,7 +3658,7 @@ static void gfx_v9_0_update_3d_clock_gating(structamdgpu_device*adev,
WREG32_SOC15(GC, 0,mmRLC_CGCG_CGLS_CTRL_3D, data);drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1
-1} - adev->gfx.rlc.funcs->exit_safe_mode (adev); +gfx_v9_0_exit_rlc_safe_mode (adev); } static void gfx_v9_0_update_coarse_grain_clock_gating(struct
amdgpu_device*adev, @@ -3666,7 +3666,7 @@ static void gfx_v9_0_update_coarse_grain_clock_gating(structamdgpu_device*adev {drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1
-1uint32_t def, data; - adev->gfx.rlc.funcs->enter_safe_mode (adev); +gfx_v9_0_enter_rlc_safe_mode (adev);if (enable && (adev->cg_flags &AMD_CG_SUPPORT_GFX_CGCG )) { def = data = RREG32_SOC15(GC, 0,
mmRLC_CGTT_MGCG_OVERRIDE); @@ -3706,7 +3706,7 @@ static void gfx_v9_0_update_coarse_grain_clock_gating(structamdgpu_device*adev
WREG32_SOC15(GC, 0,mmRLC_CGCG_CGLS_CTRL,
data);drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1
-2} - adev->gfx.rlc.funcs->exit_safe_mode (adev); +gfx_v9_0_exit_rlc_safe_mode (adev); } static int gfx_v9_0_update_gfx_clock_gating(struct amdgpu_device *adev, --
Quoted 1 line
2.18.0
_______________________________________________
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): SN6PR12MB26569BE03C4B86F63E161B94E4440-kxOKjb6HO/FeL/[email protected]
Re: [PATCH 08/10] drm/amdgpu: use the accessible target rlc safe mode Apis directly
Quoted 13 lines · Evan
Ping..
Quoted 11 lines
-----Original Message-----
From: Evan Quan [mailto:[email protected]]
Sent: Thursday, July 05, 2018 5:10 PM
To: [email protected]
Cc: Quan, Evan <[email protected]>
Subject: [PATCH 08/10] drm/amdgpu: use the accessible target rlc safe mode Apis directlyNo need to do double dereference to reach the Apis. They are accessible directly.
One advantage of using the callback is that you may end up having different callbacks for different asics within the gfx9 family. I don't know if this will be the case or not. IIRC, there were differences between chips on older gfx versions.
Alex
Quoted 50 lines
Quoted 50 lines
Change-Id I4b810c5e1981e0810df36a701b20edaf1f6af207Signed-off-by Evan Quan <[email protected]>--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1
-1@@ -3618,7 +3618,7 @@ static void gfx_v9_0_update_3d_clock_gating(struct amdgpu_device *adev, { uint32_t data, def; - adev->gfx.rlc.funcs->enter_safe_mode (adev); +gfx_v9_0_enter_rlc_safe_mode (adev);/* Enable 3D CGCG/CGLS */ if (enable && (adev->cg_flags &
AMD_CG_SUPPORT_GFX_3D_CGCG)) { @@ -3658,7 +3658,7 @@ static void gfx_v9_0_update_3d_clock_gating(structamdgpu_device*adev,WREG32_SOC15(GC, 0, mmRLC_CGCG_CGLS_CTRL_3D, data); }drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1
-1- adev->gfx.rlc.funcs->exit_safe_mode (adev); +gfx_v9_0_exit_rlc_safe_mode (adev); } static void gfx_v9_0_update_coarse_grain_clock_gating(struct
amdgpu_device*adev, @@ -3666,7 +3666,7 @@ static voidgfx_v9_0_update_coarse_grain_clock_gating(struct amdgpu_device *adev { uint32_t def, data;drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1
-1- adev->gfx.rlc.funcs->enter_safe_mode (adev); +gfx_v9_0_enter_rlc_safe_mode (adev);if (enable && (adev->cg_flags &AMD_CG_SUPPORT_GFX_CGCG )) { def = data = RREG32_SOC15(GC, 0,
mmRLC_CGTT_MGCG_OVERRIDE); @@ -3706,7 +3706,7 @@ static void gfx_v9_0_update_coarse_grain_clock_gating(structamdgpu_device*adevWREG32_SOC15(GC, 0, mmRLC_CGCG_CGLS_CTRL, data); }drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1
-1- adev->gfx.rlc.funcs->exit_safe_mode (adev); +gfx_v9_0_exit_rlc_safe_mode (adev); }
Quoted 8 lines
Quoted 3 lines
static int gfx_v9_0_update_gfx_clock_gating(struct
amdgpu_device*adev,
--
2.18.0_______________________________________________
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
A message that is not in the archive (sent off-list or not yet received): CADnq5_OkzpNCaGBNsB5uOCutr9+m6szm6O6QpmkoEvBSh7Ux5A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
RE: [PATCH 08/10] drm/amdgpu: use the accessible target rlc safe mode Apis directly
Ok, I will drop this patch.
Regards,
Evan
Quoted 67 lines
-----Original Message-----
From: Alex Deucher [mailto:[email protected]]
Sent: Wednesday, July 11, 2018 1:24 AM
To: Quan, Evan <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH 08/10] drm/amdgpu: use the accessible target rlc safe mode Apis directlyQuoted 13 lines · Evan
Ping..
Quoted 11 lines
-----Original Message-----
From: Evan Quan [mailto:[email protected]]
Sent: Thursday, July 05, 2018 5:10 PM
To: [email protected]
Cc: Quan, Evan <[email protected]>
Subject: [PATCH 08/10] drm/amdgpu: use the accessible target rlc safe mode Apis directlyNo need to do double dereference to reach the Apis. They are accessible directly.
One advantage of using the callback is that you may end up having different callbacks for different asics within the gfx9 family. I don't know if this will be the case or not. IIRC, there were differences between chips on older gfx versions.
Alex
Quoted 15 lines
Quoted 15 lines
Change-Id I4b810c5e1981e0810df36a701b20edaf1f6af207Signed-off-by Evan Quan <[email protected]>--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-0@@ -3618,7 +3618,7 @@ static void gfx_v9_0_update_3d_clock_gating(struct amdgpu_device *adev, {uint32_t data, def;Quoted 6 lines
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1
-1- adev->gfx.rlc.funcs->enter_safe_mode (adev); +gfx_v9_0_enter_rlc_safe_mode (adev);/* Enable 3D CGCG/CGLS */ if (enable && (adev->cg_flags &
AMD_CG_SUPPORT_GFX_3D_CGCG)) { @@ -3658,7 +3658,7 @@ staticvoid
Quoted 5 lines
Quoted 5 lines
gfx_v9_0_update_3d_clock_gating(struct
amdgpu_device*adev,WREG32_SOC15(GC, 0, mmRLC_CGCG_CGLS_CTRL_3D, data); }Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1
-1- adev->gfx.rlc.funcs->exit_safe_mode (adev); +gfx_v9_0_exit_rlc_safe_mode (adev); } static void gfx_v9_0_update_coarse_grain_clock_gating(struct
amdgpu_device*adev, @@ -3666,7 +3666,7 @@ static void gfx_v9_0_update_coarse_grain_clock_gating(structamdgpu_device*adev {
Quoted 2 lines
Quoted 2 lines
uint32_t def, data;
Quoted 25 lines
Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1
-1- adev->gfx.rlc.funcs->enter_safe_mode (adev); +gfx_v9_0_enter_rlc_safe_mode (adev);if (enable && (adev->cg_flags &AMD_CG_SUPPORT_GFX_CGCG )) { def = data = RREG32_SOC15(GC, 0,
mmRLC_CGTT_MGCG_OVERRIDE); @@ -3706,7 +3706,7 @@ static void gfx_v9_0_update_coarse_grain_clock_gating(structamdgpu_device*adev
Quoted 17 lines
Quoted 9 lines
WREG32_SOC15(GC, 0, mmRLC_CGCG_CGLS_CTRL, data); }drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1
-1- adev->gfx.rlc.funcs->exit_safe_mode (adev); +gfx_v9_0_exit_rlc_safe_mode (adev); } static int gfx_v9_0_update_gfx_clock_gating(struct amdgpu_deviceQuoted 3 lines
*adev,
--
2.18.0_______________________________________________
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
PATCH 9/10 drm/amd/powerplay: add vega12 SMU gfxoff support
In reply to a message not in the archiveExport apis for enabling/disabling SMU gfxoff support.
--- .../drm/amd/powerplay/hwmgr/vega12_hwmgr.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c +19 -0
@@ -2329,6 +2329,24 @@ static int vega12_get_thermal_temperature_range(struct pp_hwmgr *hwmgr,return 0 ; } +static int vega12_enable_gfx_off (struct pp_hwmgr *hwmgr) +{ +return smum_send_msg_to_smc (hwmgr, PPSMC_MSG_AllowGfxOff); +} + +static int vega12_disable_gfx_off (struct pp_hwmgr *hwmgr) +{ +return smum_send_msg_to_smc (hwmgr, PPSMC_MSG_DisallowGfxOff); +} + +static int vega12_gfx_off_control (struct pp_hwmgr *hwmgr,bool enable) +{ +if (enable) +return vega12_enable_gfx_off (hwmgr); +else +return vega12_disable_gfx_off (hwmgr); +} +static const struct pp_hwmgr_func vega12_hwmgr_funcs = { .backend_init = vega12_hwmgr_backend_init, .backend_fini = vega12_hwmgr_backend_fini,
@@ -2378,6 +2396,7 @@ static const struct pp_hwmgr_func vega12_hwmgr_funcs = { .get_thermal_temperature_range = vega12_get_thermal_temperature_range, .register_irq_handlers = smu9_register_irq_handlers, .start_thermal_controller = vega12_start_thermal_controller, + .gfx_off_control = vega12_gfx_off_control, };int vega12_hwmgr_init (struct pp_hwmgr *hwmgr)
Signature · 6 lines
2.18.0 _______________________________________________ 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): [email protected]
Huang Rui
Reviewed-byRe: [PATCH 09/10] drm/amd/powerplay: add vega12 SMU gfxoff support
Quoted 4 lines · Evan Quan
Export apis for enabling/disabling SMU gfxoff support.
Change-Id Idcea1db9f3dbe15edda1b76e1ff05435865af2a1Signed-off-by Evan Quan <[email protected]>
Quoted 48 lines
--- .../drm/amd/powerplay/hwmgr/vega12_hwmgr.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c +19
-0@@ -2329,6 +2329,24 @@ static int vega12_get_thermal_temperature_range(struct pp_hwmgr *hwmgr,return 0 ; } +static int vega12_enable_gfx_off (struct pp_hwmgr *hwmgr) +{ +return smum_send_msg_to_smc (hwmgr, PPSMC_MSG_AllowGfxOff); +} + +static int vega12_disable_gfx_off (struct pp_hwmgr *hwmgr) +{ +return smum_send_msg_to_smc (hwmgr, PPSMC_MSG_DisallowGfxOff); +} + +static int vega12_gfx_off_control (struct pp_hwmgr *hwmgr,bool enable) +{ +if (enable) +return vega12_enable_gfx_off (hwmgr); +else +return vega12_disable_gfx_off (hwmgr); +} +static const struct pp_hwmgr_func vega12_hwmgr_funcs = { .backend_init = vega12_hwmgr_backend_init, .backend_fini = vega12_hwmgr_backend_fini,@@ -2378,6 +2396,7 @@ static const struct pp_hwmgr_func vega12_hwmgr_funcs = { .get_thermal_temperature_range = vega12_get_thermal_temperature_range, .register_irq_handlers = smu9_register_irq_handlers, .start_thermal_controller = vega12_start_thermal_controller, + .gfx_off_control = vega12_gfx_off_control, };int vega12_hwmgr_init (struct pp_hwmgr *hwmgr)Signature · 6 lines
2.18.0 _______________________________________________ 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
PATCH 10/10 drm/amd/powerplay: no need to mask workable gfxoff feature for vega12
In reply to a message not in the archiveGfxoff feature for vega12 is workable. So, there is no need to mask it any more.
--- drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c +1 -1
@@ -147,10 +147,10 @@ int hwmgr_early_init(struct pp_hwmgr *hwmgr)smu7_init_function_pointers (hwmgr);break ;case AMDGPU_FAMILY_AI : - hwmgr->feature_mask &= ~PP_GFXOFF_MASK ;switch (hwmgr->chip_id) {case CHIP_VEGA10 :case CHIP_VEGA20 : + hwmgr->feature_mask &= ~PP_GFXOFF_MASK ; hwmgr->smumgr_funcs = &vega10_smu_funcs;vega10_hwmgr_init (hwmgr);break ;
Signature · 6 lines
2.18.0 _______________________________________________ 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): [email protected]
RE: [PATCH 10/10] drm/amd/powerplay: no need to mask workable gfxoff feature for vega12
Ping..
Quoted 35 lines
-----Original Message-----
From: Evan Quan [mailto:[email protected]]
Sent: Thursday, July 05, 2018 5:10 PM
To: [email protected]
Cc: Quan, Evan <[email protected]>
Subject: [PATCH 10/10] drm/amd/powerplay: no need to mask workable gfxoff feature for vega12Gfxoff feature for vega12 is workable. So, there is no need to mask it any more.
Change-Id I7e4d05c5c0acc2aa2b077eaaaf6f13589c87114bSigned-off-by Evan Quan <[email protected]>--- drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c +1
-2@@ -147,10 +147,10 @@ int hwmgr_early_init(struct pp_hwmgr *hwmgr)smu7_init_function_pointers (hwmgr);break ;case AMDGPU_FAMILY_AI : - hwmgr->feature_mask &= ~PP_GFXOFF_MASK ;switch (hwmgr->chip_id) {case CHIP_VEGA10 :case CHIP_VEGA20 : + hwmgr->feature_mask &= ~PP_GFXOFF_MASK ; hwmgr->smumgr_funcs = &vega10_smu_funcs;vega10_hwmgr_init (hwmgr);break ; --
Quoted 1 line
2.18.0
_______________________________________________
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): SN6PR12MB2656713C37BA977A41CB04CEE4440-kxOKjb6HO/FeL/[email protected]
Alex Deucher
Acked-byRe: [PATCH 10/10] drm/amd/powerplay: no need to mask workable gfxoff feature for vega12
Quoted 15 lines · Evan
Ping..
Quoted 13 lines
-----Original Message-----
From: Evan Quan [mailto:[email protected]]
Sent: Thursday, July 05, 2018 5:10 PM
To: [email protected]
Cc: Quan, Evan <[email protected]>
Subject: [PATCH 10/10] drm/amd/powerplay: no need to mask workable gfxoff feature for vega12Gfxoff feature for vega12 is workable. So, there is no need to mask it any more.
Change-Id I7e4d05c5c0acc2aa2b077eaaaf6f13589c87114bSigned-off-by Evan Quan <[email protected]>
Quoted 20 lines
Quoted 20 lines
--- drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c +1
-1@@ -147,10 +147,10 @@ int hwmgr_early_init(struct pp_hwmgr *hwmgr)smu7_init_function_pointers (hwmgr);break ;case AMDGPU_FAMILY_AI : - hwmgr->feature_mask &= ~PP_GFXOFF_MASK ;switch (hwmgr->chip_id) {case CHIP_VEGA10 :case CHIP_VEGA20 : + hwmgr->feature_mask &= ~PP_GFXOFF_MASK ; hwmgr->smumgr_funcs = &vega10_smu_funcs;vega10_hwmgr_init (hwmgr);
Quoted 8 lines
Quoted 3 lines
drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c +0
-1break ; --2.18.0
_______________________________________________
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
Huang Rui
Reviewed-byQuoted 6 lines · 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 I1ae1f2eed096eaba5f601cf2a3e2650c8e583dc9Signed-off-by Evan Quan <[email protected]>
It is nice to have the comments behind of csb_vram_pin function to explain why we need "pin" here during resume phase.
Quoted 83 lines
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 40 +++++++++++++++++++++++++++ 1 file changed, 40 insertions(+)drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +40
-0@@ -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 ; }Signature · 6 lines
2.18.0 _______________________________________________ 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
Quoted 5 lines · Huang Rui
Quoted 4 lines · 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.
Quoted 7 lines
Quoted 2 lines
Change-Id I1ae1f2eed096eaba5f601cf2a3e2650c8e583dc9Signed-off-by Evan Quan <[email protected]>It is nice to have the comments behind of
csb_vram_pinfunction to explain why we need "pin" here during resume phase.Reviewed-by Huang Rui <[email protected]>
Do the save restore buffers in gfx7 and 8 need a similar fix?
Alex
Quoted 80 lines
Quoted 80 lines
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 40 +++++++++++++++++++++++++++ 1 file changed, 40 insertions(+)drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +40
-1@@ -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
Quoted 8 lines
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
_______________________________________________
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): CADnq5_ObbDpsjt1-gC5oOJLe-89jU2L1VBs4sOr1-4tgq8n=3Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Comment inline
Quoted 17 lines
-----Original Message-----
From: Alex Deucher [mailto:[email protected]]
Sent: Thursday, July 05, 2018 11:25 PM
To: Huang, Ray <[email protected]>
Cc: Quan, Evan <[email protected]>; amd-gfx list <amd- [email protected]>
Subject: Re: [PATCH 01/10] drm/amdgpu: pin the csb buffer on hw initQuoted 8 lines · Huang Rui
Quoted 6 lines · 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 I1ae1f2eed096eaba5f601cf2a3e2650c8e583dc9Signed-off-by Evan Quan <[email protected]>
Quoted 8 lines
Quoted 4 lines
It is nice to have the comments behind of
csb_vram_pinfunction to explain why we need "pin" here during resume phase.Reviewed-by Huang Rui <[email protected]>Do the save restore buffers in gfx7 and 8 need a similar fix?
Alex
It seems so. Test on polaris11, the csb is corrupt after resume from S3. I will send another patch to fix them.
Quoted 20 lines
Quoted 6 lines
Quoted 6 lines
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 40 +++++++++++++++++++++++++++ 1 file changed, 40 insertions(+)Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c static int gfx_v9_0_rlc_init(struct amdgpu_device
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-0@@ -943,6 +943,7 @@ static int gfx_v9_0_rlc_init(struct amdgpu_device*adev)
Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1
-0dst_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); }
Quoted 69 lines
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c static int gfx_v9_0_rlc_init(struct amdgpu_device
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-0@@ -971,6 +972,39 @@ static int gfx_v9_0_rlc_init(struct amdgpu_device*adev)
Quoted 67 lines
Quoted 59 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +37
-1return 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
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
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx