All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: correct clock info for SRIOV
@ 2017-06-03  9:44 Xiangliang Yu
       [not found] ` <1496483095-11415-1-git-send-email-Xiangliang.Yu-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Xiangliang Yu @ 2017-06-03  9:44 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Xiangliang Yu

Currently, get clock info from default clk of pm if dpm is disable.
Buf SRIOV doesn't support dpm and pm, can't get anything from pm.
Only get clock info only from default clk of amdgpu for SRIOV.

And driver get pm default clk also from amdgpu default clk and never
be changed by others. So use amdgpu default clk value for SRIOV
and non-dpm cases.

Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
index 4947f04..1935f07 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
@@ -530,8 +530,8 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file
 			dev_info.max_engine_clock = amdgpu_dpm_get_sclk(adev, false) * 10;
 			dev_info.max_memory_clock = amdgpu_dpm_get_mclk(adev, false) * 10;
 		} else {
-			dev_info.max_engine_clock = adev->pm.default_sclk * 10;
-			dev_info.max_memory_clock = adev->pm.default_mclk * 10;
+			dev_info.max_engine_clock = adev->clock.default_sclk * 10;
+			dev_info.max_memory_clock = adev->clock.default_mclk * 10;
 		}
 		dev_info.enabled_rb_pipes_mask = adev->gfx.config.backend_enable_mask;
 		dev_info.num_rb_pipes = adev->gfx.config.max_backends_per_se *
-- 
2.7.4

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

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

* RE: [PATCH] drm/amdgpu: correct clock info for SRIOV
       [not found] ` <1496483095-11415-1-git-send-email-Xiangliang.Yu-5C7GfCeVMHo@public.gmane.org>
@ 2017-06-05 15:10   ` Deucher, Alexander
       [not found]     ` <BN6PR12MB1652E86A04552889BF7827D0F7CA0-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Deucher, Alexander @ 2017-06-05 15:10 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Yu, Xiangliang

> -----Original Message-----
> From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf
> Of Xiangliang Yu
> Sent: Saturday, June 03, 2017 5:45 AM
> To: amd-gfx@lists.freedesktop.org
> Cc: Yu, Xiangliang
> Subject: [PATCH] drm/amdgpu: correct clock info for SRIOV
> 
> Currently, get clock info from default clk of pm if dpm is disable.
> Buf SRIOV doesn't support dpm and pm, can't get anything from pm.
> Only get clock info only from default clk of amdgpu for SRIOV.
> 
> And driver get pm default clk also from amdgpu default clk and never
> be changed by others. So use amdgpu default clk value for SRIOV
> and non-dpm cases.

This won't work for vega10 or Raven since we don't parse the default clock info on them anymore due to atom firmware changes.

Alex

> 
> Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> index 4947f04..1935f07 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> @@ -530,8 +530,8 @@ static int amdgpu_info_ioctl(struct drm_device *dev,
> void *data, struct drm_file
>  			dev_info.max_engine_clock =
> amdgpu_dpm_get_sclk(adev, false) * 10;
>  			dev_info.max_memory_clock =
> amdgpu_dpm_get_mclk(adev, false) * 10;
>  		} else {
> -			dev_info.max_engine_clock = adev-
> >pm.default_sclk * 10;
> -			dev_info.max_memory_clock = adev-
> >pm.default_mclk * 10;
> +			dev_info.max_engine_clock = adev-
> >clock.default_sclk * 10;
> +			dev_info.max_memory_clock = adev-
> >clock.default_mclk * 10;
>  		}
>  		dev_info.enabled_rb_pipes_mask = adev-
> >gfx.config.backend_enable_mask;
>  		dev_info.num_rb_pipes = adev-
> >gfx.config.max_backends_per_se *
> --
> 2.7.4
> 
> _______________________________________________
> 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

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

* RE: [PATCH] drm/amdgpu: correct clock info for SRIOV
       [not found]     ` <BN6PR12MB1652E86A04552889BF7827D0F7CA0-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2017-06-06  2:33       ` Yu, Xiangliang
       [not found]         ` <BY2PR1201MB0935E8E42BA0FD5EB5E56F6BEBCB0-O28G1zQ8oGkaqtME6NEo1mrFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Yu, Xiangliang @ 2017-06-06  2:33 UTC (permalink / raw)
  To: Deucher, Alexander, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

> > Currently, get clock info from default clk of pm if dpm is disable.
> > Buf SRIOV doesn't support dpm and pm, can't get anything from pm.
> > Only get clock info only from default clk of amdgpu for SRIOV.
> >
> > And driver get pm default clk also from amdgpu default clk and never
> > be changed by others. So use amdgpu default clk value for SRIOV and
> > non-dpm cases.
> 
> This won't work for vega10 or Raven since we don't parse the default clock
> info on them anymore due to atom firmware changes.

I don't get the info.
Even so, we need to support this for VI family.

> 
> Alex
> 
> >
> > Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
> > ---
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> > b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> > index 4947f04..1935f07 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> > @@ -530,8 +530,8 @@ static int amdgpu_info_ioctl(struct drm_device
> > *dev, void *data, struct drm_file
> >  			dev_info.max_engine_clock =
> > amdgpu_dpm_get_sclk(adev, false) * 10;
> >  			dev_info.max_memory_clock =
> > amdgpu_dpm_get_mclk(adev, false) * 10;
> >  		} else {
> > -			dev_info.max_engine_clock = adev-
> > >pm.default_sclk * 10;
> > -			dev_info.max_memory_clock = adev-
> > >pm.default_mclk * 10;
> > +			dev_info.max_engine_clock = adev-
> > >clock.default_sclk * 10;
> > +			dev_info.max_memory_clock = adev-
> > >clock.default_mclk * 10;
> >  		}
> >  		dev_info.enabled_rb_pipes_mask = adev-
> > >gfx.config.backend_enable_mask;
> >  		dev_info.num_rb_pipes = adev-
> > >gfx.config.max_backends_per_se *
> > --
> > 2.7.4
> >
> > _______________________________________________
> > 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

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

* RE: [PATCH] drm/amdgpu: correct clock info for SRIOV
       [not found]         ` <BY2PR1201MB0935E8E42BA0FD5EB5E56F6BEBCB0-O28G1zQ8oGkaqtME6NEo1mrFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
@ 2017-06-06 15:04           ` Deucher, Alexander
  0 siblings, 0 replies; 4+ messages in thread
From: Deucher, Alexander @ 2017-06-06 15:04 UTC (permalink / raw)
  To: Yu, Xiangliang, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

> -----Original Message-----
> From: Yu, Xiangliang
> Sent: Monday, June 05, 2017 10:33 PM
> To: Deucher, Alexander; amd-gfx@lists.freedesktop.org
> Subject: RE: [PATCH] drm/amdgpu: correct clock info for SRIOV
> 
> > > Currently, get clock info from default clk of pm if dpm is disable.
> > > Buf SRIOV doesn't support dpm and pm, can't get anything from pm.
> > > Only get clock info only from default clk of amdgpu for SRIOV.
> > >
> > > And driver get pm default clk also from amdgpu default clk and never
> > > be changed by others. So use amdgpu default clk value for SRIOV and
> > > non-dpm cases.
> >
> > This won't work for vega10 or Raven since we don't parse the default clock
> > info on them anymore due to atom firmware changes.
> 
> I don't get the info.
> Even so, we need to support this for VI family.

The default clocks are the boot clocks which don't reflect the actual clocks that chip is running it.  Assuming that is ok, the patch is:
Acked-by: Alex Deucher <alexander.deucher@amd.com>

> 
> >
> > Alex
> >
> > >
> > > Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
> > > ---
> > >  drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> > > b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> > > index 4947f04..1935f07 100644
> > > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> > > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> > > @@ -530,8 +530,8 @@ static int amdgpu_info_ioctl(struct drm_device
> > > *dev, void *data, struct drm_file
> > >  			dev_info.max_engine_clock =
> > > amdgpu_dpm_get_sclk(adev, false) * 10;
> > >  			dev_info.max_memory_clock =
> > > amdgpu_dpm_get_mclk(adev, false) * 10;
> > >  		} else {
> > > -			dev_info.max_engine_clock = adev-
> > > >pm.default_sclk * 10;
> > > -			dev_info.max_memory_clock = adev-
> > > >pm.default_mclk * 10;
> > > +			dev_info.max_engine_clock = adev-
> > > >clock.default_sclk * 10;
> > > +			dev_info.max_memory_clock = adev-
> > > >clock.default_mclk * 10;
> > >  		}
> > >  		dev_info.enabled_rb_pipes_mask = adev-
> > > >gfx.config.backend_enable_mask;
> > >  		dev_info.num_rb_pipes = adev-
> > > >gfx.config.max_backends_per_se *
> > > --
> > > 2.7.4
> > >
> > > _______________________________________________
> > > 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

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

end of thread, other threads:[~2017-06-06 15:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-03  9:44 [PATCH] drm/amdgpu: correct clock info for SRIOV Xiangliang Yu
     [not found] ` <1496483095-11415-1-git-send-email-Xiangliang.Yu-5C7GfCeVMHo@public.gmane.org>
2017-06-05 15:10   ` Deucher, Alexander
     [not found]     ` <BN6PR12MB1652E86A04552889BF7827D0F7CA0-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-06-06  2:33       ` Yu, Xiangliang
     [not found]         ` <BY2PR1201MB0935E8E42BA0FD5EB5E56F6BEBCB0-O28G1zQ8oGkaqtME6NEo1mrFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-06-06 15:04           ` Deucher, Alexander

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