RE: [PATCH 03/10] drm/amdgpu: init rlc save restore as long as the lists exist

2018-07-08 Thread Quan, Evan
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
> -Original Message-
> From: Huang Rui [mailto:ray.hu...@amd.com]
> Sent: Friday, July 06, 2018 6:15 PM
> To: Quan, Evan 
> Cc: amd-gfx@lists.freedesktop.org
> Subject: Re: [PATCH 03/10] drm/amdgpu: init rlc save restore as long as the
> lists exist
> 
> On Thu, Jul 05, 2018 at 05:09:28PM +0800, Evan Quan wrote:
> > It 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.
> >
> > Change-Id: I85c0e3525ca7fb385c3d0b9e5abc13708c91e795
> > Signed-off-by: Evan Quan 
> > ---
> >  drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 12 +++-
> >  1 file changed, 7 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> > b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> > index 2f6ac255203f..8d895afa6c69 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> > @@ -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
> 
> > +   /* 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);
> > --
> > 2.18.0
> >
> > ___
> > amd-gfx mailing list
> > amd-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 03/10] drm/amdgpu: init rlc save restore as long as the lists exist

2018-07-06 Thread Huang Rui
On Thu, Jul 05, 2018 at 05:09:28PM +0800, Evan Quan wrote:
> It 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.
> 
> Change-Id: I85c0e3525ca7fb385c3d0b9e5abc13708c91e795
> Signed-off-by: Evan Quan 
> ---
>  drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 12 +++-
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c 
> b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> index 2f6ac255203f..8d895afa6c69 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> @@ -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

> + /* 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);
> -- 
> 2.18.0
> 
> ___
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


RE: [PATCH 03/10] drm/amdgpu: init rlc save restore as long as the lists exist

2018-07-06 Thread Quan, Evan
For vega10, the rlc save & restore list is still not imported yet.

Regards,
Evan
> -Original Message-
> From: amd-gfx [mailto:amd-gfx-boun...@lists.freedesktop.org] On Behalf
> Of Huang Rui
> Sent: Thursday, July 05, 2018 11:19 PM
> To: Quan, Evan 
> Cc: amd-gfx@lists.freedesktop.org
> Subject: Re: [PATCH 03/10] drm/amdgpu: init rlc save restore as long as the
> lists exist
> 
> On Thu, Jul 05, 2018 at 05:09:28PM +0800, Evan Quan wrote:
> > It 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.
> >
> > Change-Id: I85c0e3525ca7fb385c3d0b9e5abc13708c91e795
> > Signed-off-by: Evan Quan 
> > ---
> >  drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 12 +++-
> >  1 file changed, 7 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> > b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> > index 2f6ac255203f..8d895afa6c69 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> > @@ -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
> 
> > +   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);
> > --
> > 2.18.0
> >
> > ___
> > amd-gfx mailing list
> > amd-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/amd-gfx
> ___
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 03/10] drm/amdgpu: init rlc save restore as long as the lists exist

2018-07-05 Thread Huang Rui
On Thu, Jul 05, 2018 at 05:09:28PM +0800, Evan Quan wrote:
> It 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.
> 
> Change-Id: I85c0e3525ca7fb385c3d0b9e5abc13708c91e795
> Signed-off-by: Evan Quan 
> ---
>  drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 12 +++-
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c 
> b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> index 2f6ac255203f..8d895afa6c69 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> @@ -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

> + 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);
> -- 
> 2.18.0
> 
> ___
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[PATCH 03/10] drm/amdgpu: init rlc save restore as long as the lists exist

2018-07-05 Thread Evan Quan
It 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.

Change-Id: I85c0e3525ca7fb385c3d0b9e5abc13708c91e795
Signed-off-by: Evan Quan 
---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index 2f6ac255203f..8d895afa6c69 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -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);
-- 
2.18.0

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