All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/powerplay: convert the sclk/mclk into Mhz for comparation
@ 2018-07-11  8:26 Evan Quan
       [not found] ` <20180711082637.1984-1-evan.quan-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Evan Quan @ 2018-07-11  8:26 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Evan Quan

Convert the clocks into right Mhz unit. Otherwise, it will miss
the equal situation.

Change-Id: I80e1af975715712f5ddef4ca6a6e356d90932613
Signed-off-by: Evan Quan <evan.quan@amd.com>
---
 drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
index cae76fe65881..c0ceb69a23b0 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
@@ -1881,7 +1881,7 @@ static int vega12_print_clock_levels(struct pp_hwmgr *hwmgr,
 		for (i = 0; i < clocks.num_levels; i++)
 			size += sprintf(buf + size, "%d: %uMhz %s\n",
 				i, clocks.data[i].clocks_in_khz / 1000,
-				(clocks.data[i].clocks_in_khz / 1000 == now) ? "*" : "");
+				(clocks.data[i].clocks_in_khz / 1000 == now / 100) ? "*" : "");
 		break;
 
 	case PP_MCLK:
@@ -1897,7 +1897,7 @@ static int vega12_print_clock_levels(struct pp_hwmgr *hwmgr,
 		for (i = 0; i < clocks.num_levels; i++)
 			size += sprintf(buf + size, "%d: %uMhz %s\n",
 				i, clocks.data[i].clocks_in_khz / 1000,
-				(clocks.data[i].clocks_in_khz / 1000 == now) ? "*" : "");
+				(clocks.data[i].clocks_in_khz / 1000 == now / 100) ? "*" : "");
 		break;
 
 	case PP_PCIE:
-- 
2.18.0

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

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

* Re: [PATCH] drm/amd/powerplay: convert the sclk/mclk into Mhz for comparation
       [not found] ` <20180711082637.1984-1-evan.quan-5C7GfCeVMHo@public.gmane.org>
@ 2018-07-11 10:13   ` Huang Rui
  2018-07-11 15:35   ` Alex Deucher
  1 sibling, 0 replies; 5+ messages in thread
From: Huang Rui @ 2018-07-11 10:13 UTC (permalink / raw)
  To: Evan Quan; +Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On Wed, Jul 11, 2018 at 04:26:37PM +0800, Evan Quan wrote:
> Convert the clocks into right Mhz unit. Otherwise, it will miss
> the equal situation.
> 
> Change-Id: I80e1af975715712f5ddef4ca6a6e356d90932613
> Signed-off-by: Evan Quan <evan.quan@amd.com>

Reviewed-by: Huang Rui <ray.huang@amd.com>

> ---
>  drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
> index cae76fe65881..c0ceb69a23b0 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
> @@ -1881,7 +1881,7 @@ static int vega12_print_clock_levels(struct pp_hwmgr *hwmgr,
>  		for (i = 0; i < clocks.num_levels; i++)
>  			size += sprintf(buf + size, "%d: %uMhz %s\n",
>  				i, clocks.data[i].clocks_in_khz / 1000,
> -				(clocks.data[i].clocks_in_khz / 1000 == now) ? "*" : "");
> +				(clocks.data[i].clocks_in_khz / 1000 == now / 100) ? "*" : "");
>  		break;
>  
>  	case PP_MCLK:
> @@ -1897,7 +1897,7 @@ static int vega12_print_clock_levels(struct pp_hwmgr *hwmgr,
>  		for (i = 0; i < clocks.num_levels; i++)
>  			size += sprintf(buf + size, "%d: %uMhz %s\n",
>  				i, clocks.data[i].clocks_in_khz / 1000,
> -				(clocks.data[i].clocks_in_khz / 1000 == now) ? "*" : "");
> +				(clocks.data[i].clocks_in_khz / 1000 == now / 100) ? "*" : "");
>  		break;
>  
>  	case PP_PCIE:
> -- 
> 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

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

* Re: [PATCH] drm/amd/powerplay: convert the sclk/mclk into Mhz for comparation
       [not found] ` <20180711082637.1984-1-evan.quan-5C7GfCeVMHo@public.gmane.org>
  2018-07-11 10:13   ` Huang Rui
@ 2018-07-11 15:35   ` Alex Deucher
       [not found]     ` <CADnq5_M+OQDMjaHbXHoOMHVfSrQbGSLoz4gHNvYZiJCCjtwe7g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  1 sibling, 1 reply; 5+ messages in thread
From: Alex Deucher @ 2018-07-11 15:35 UTC (permalink / raw)
  To: Evan Quan; +Cc: amd-gfx list

On Wed, Jul 11, 2018 at 4:26 AM, Evan Quan <evan.quan@amd.com> wrote:
> Convert the clocks into right Mhz unit. Otherwise, it will miss
> the equal situation.
>
> Change-Id: I80e1af975715712f5ddef4ca6a6e356d90932613
> Signed-off-by: Evan Quan <evan.quan@amd.com>
> ---
>  drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
> index cae76fe65881..c0ceb69a23b0 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
> @@ -1881,7 +1881,7 @@ static int vega12_print_clock_levels(struct pp_hwmgr *hwmgr,
>                 for (i = 0; i < clocks.num_levels; i++)
>                         size += sprintf(buf + size, "%d: %uMhz %s\n",
>                                 i, clocks.data[i].clocks_in_khz / 1000,
> -                               (clocks.data[i].clocks_in_khz / 1000 == now) ? "*" : "");
> +                               (clocks.data[i].clocks_in_khz / 1000 == now / 100) ? "*" : "");


You could simplify this to:
(clocks.data[i].clocks_in_khz / 10 == now) ? "*" : "");

>                 break;
>
>         case PP_MCLK:
> @@ -1897,7 +1897,7 @@ static int vega12_print_clock_levels(struct pp_hwmgr *hwmgr,
>                 for (i = 0; i < clocks.num_levels; i++)
>                         size += sprintf(buf + size, "%d: %uMhz %s\n",
>                                 i, clocks.data[i].clocks_in_khz / 1000,
> -                               (clocks.data[i].clocks_in_khz / 1000 == now) ? "*" : "");
> +                               (clocks.data[i].clocks_in_khz / 1000 == now / 100) ? "*" : "");

Same here.  Either way:
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

>                 break;
>
>         case PP_PCIE:
> --
> 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

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

* RE: [PATCH] drm/amd/powerplay: convert the sclk/mclk into Mhz for comparation
       [not found]     ` <CADnq5_M+OQDMjaHbXHoOMHVfSrQbGSLoz4gHNvYZiJCCjtwe7g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2018-07-12  2:58       ` Quan, Evan
       [not found]         ` <SN6PR12MB265670F9019D1B6B213E4B30E4590-kxOKjb6HO/FeL/N0e1LXkAdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Quan, Evan @ 2018-07-12  2:58 UTC (permalink / raw)
  To: Alex Deucher; +Cc: amd-gfx list

> You could simplify this to:
> (clocks.data[i].clocks_in_khz / 10 == now) ? "*" : "");
>
It cannot be simplified as this. Since we need to do comparation in Mhz.
Otherwise we will miss the 'equal' situation.

Regards,
Evan
> -----Original Message-----
> From: Alex Deucher [mailto:alexdeucher@gmail.com]
> Sent: Wednesday, July 11, 2018 11:35 PM
> To: Quan, Evan <Evan.Quan@amd.com>
> Cc: amd-gfx list <amd-gfx@lists.freedesktop.org>
> Subject: Re: [PATCH] drm/amd/powerplay: convert the sclk/mclk into Mhz
> for comparation
> 
> On Wed, Jul 11, 2018 at 4:26 AM, Evan Quan <evan.quan@amd.com> wrote:
> > Convert the clocks into right Mhz unit. Otherwise, it will miss the
> > equal situation.
> >
> > Change-Id: I80e1af975715712f5ddef4ca6a6e356d90932613
> > Signed-off-by: Evan Quan <evan.quan@amd.com>
> > ---
> >  drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
> > b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
> > index cae76fe65881..c0ceb69a23b0 100644
> > --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
> > +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
> > @@ -1881,7 +1881,7 @@ static int vega12_print_clock_levels(struct
> pp_hwmgr *hwmgr,
> >                 for (i = 0; i < clocks.num_levels; i++)
> >                         size += sprintf(buf + size, "%d: %uMhz %s\n",
> >                                 i, clocks.data[i].clocks_in_khz / 1000,
> > -                               (clocks.data[i].clocks_in_khz / 1000 == now) ? "*" : "");
> > +                               (clocks.data[i].clocks_in_khz / 1000
> > + == now / 100) ? "*" : "");
> 
> 
> You could simplify this to:
> (clocks.data[i].clocks_in_khz / 10 == now) ? "*" : "");
> 
> >                 break;
> >
> >         case PP_MCLK:
> > @@ -1897,7 +1897,7 @@ static int vega12_print_clock_levels(struct
> pp_hwmgr *hwmgr,
> >                 for (i = 0; i < clocks.num_levels; i++)
> >                         size += sprintf(buf + size, "%d: %uMhz %s\n",
> >                                 i, clocks.data[i].clocks_in_khz / 1000,
> > -                               (clocks.data[i].clocks_in_khz / 1000 == now) ? "*" : "");
> > +                               (clocks.data[i].clocks_in_khz / 1000
> > + == now / 100) ? "*" : "");
> 
> Same here.  Either way:
> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
> 
> >                 break;
> >
> >         case PP_PCIE:
> > --
> > 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

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

* Re: [PATCH] drm/amd/powerplay: convert the sclk/mclk into Mhz for comparation
       [not found]         ` <SN6PR12MB265670F9019D1B6B213E4B30E4590-kxOKjb6HO/FeL/N0e1LXkAdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2018-07-12  3:25           ` Alex Deucher
  0 siblings, 0 replies; 5+ messages in thread
From: Alex Deucher @ 2018-07-12  3:25 UTC (permalink / raw)
  To: Quan, Evan; +Cc: amd-gfx list

On Wed, Jul 11, 2018 at 10:58 PM, Quan, Evan <Evan.Quan@amd.com> wrote:
>> You could simplify this to:
>> (clocks.data[i].clocks_in_khz / 10 == now) ? "*" : "");
>>
> It cannot be simplified as this. Since we need to do comparation in Mhz.
> Otherwise we will miss the 'equal' situation.

Ah I see,
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

Alex

>
> Regards,
> Evan
>> -----Original Message-----
>> From: Alex Deucher [mailto:alexdeucher@gmail.com]
>> Sent: Wednesday, July 11, 2018 11:35 PM
>> To: Quan, Evan <Evan.Quan@amd.com>
>> Cc: amd-gfx list <amd-gfx@lists.freedesktop.org>
>> Subject: Re: [PATCH] drm/amd/powerplay: convert the sclk/mclk into Mhz
>> for comparation
>>
>> On Wed, Jul 11, 2018 at 4:26 AM, Evan Quan <evan.quan@amd.com> wrote:
>> > Convert the clocks into right Mhz unit. Otherwise, it will miss the
>> > equal situation.
>> >
>> > Change-Id: I80e1af975715712f5ddef4ca6a6e356d90932613
>> > Signed-off-by: Evan Quan <evan.quan@amd.com>
>> > ---
>> >  drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c | 4 ++--
>> >  1 file changed, 2 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
>> > b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
>> > index cae76fe65881..c0ceb69a23b0 100644
>> > --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
>> > +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
>> > @@ -1881,7 +1881,7 @@ static int vega12_print_clock_levels(struct
>> pp_hwmgr *hwmgr,
>> >                 for (i = 0; i < clocks.num_levels; i++)
>> >                         size += sprintf(buf + size, "%d: %uMhz %s\n",
>> >                                 i, clocks.data[i].clocks_in_khz / 1000,
>> > -                               (clocks.data[i].clocks_in_khz / 1000 == now) ? "*" : "");
>> > +                               (clocks.data[i].clocks_in_khz / 1000
>> > + == now / 100) ? "*" : "");
>>
>>
>> You could simplify this to:
>> (clocks.data[i].clocks_in_khz / 10 == now) ? "*" : "");
>>
>> >                 break;
>> >
>> >         case PP_MCLK:
>> > @@ -1897,7 +1897,7 @@ static int vega12_print_clock_levels(struct
>> pp_hwmgr *hwmgr,
>> >                 for (i = 0; i < clocks.num_levels; i++)
>> >                         size += sprintf(buf + size, "%d: %uMhz %s\n",
>> >                                 i, clocks.data[i].clocks_in_khz / 1000,
>> > -                               (clocks.data[i].clocks_in_khz / 1000 == now) ? "*" : "");
>> > +                               (clocks.data[i].clocks_in_khz / 1000
>> > + == now / 100) ? "*" : "");
>>
>> Same here.  Either way:
>> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
>>
>> >                 break;
>> >
>> >         case PP_PCIE:
>> > --
>> > 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

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

end of thread, other threads:[~2018-07-12  3:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-11  8:26 [PATCH] drm/amd/powerplay: convert the sclk/mclk into Mhz for comparation Evan Quan
     [not found] ` <20180711082637.1984-1-evan.quan-5C7GfCeVMHo@public.gmane.org>
2018-07-11 10:13   ` Huang Rui
2018-07-11 15:35   ` Alex Deucher
     [not found]     ` <CADnq5_M+OQDMjaHbXHoOMHVfSrQbGSLoz4gHNvYZiJCCjtwe7g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-07-12  2:58       ` Quan, Evan
     [not found]         ` <SN6PR12MB265670F9019D1B6B213E4B30E4590-kxOKjb6HO/FeL/N0e1LXkAdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-07-12  3:25           ` Alex Deucher

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.