All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Deucher <alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: "Quan, Evan" <Evan.Quan-5C7GfCeVMHo@public.gmane.org>
Cc: amd-gfx list <amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Subject: Re: [PATCH] drm/amd/powerplay: convert the sclk/mclk into Mhz for comparation
Date: Wed, 11 Jul 2018 23:25:59 -0400	[thread overview]
Message-ID: <CADnq5_N1iW-_CNjNq8wUP=e1NMCoom8Noo_a1zM2qZgz1ZHfoQ@mail.gmail.com> (raw)
In-Reply-To: <SN6PR12MB265670F9019D1B6B213E4B30E4590-kxOKjb6HO/FeL/N0e1LXkAdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>

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

      parent reply	other threads:[~2018-07-12  3:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADnq5_N1iW-_CNjNq8wUP=e1NMCoom8Noo_a1zM2qZgz1ZHfoQ@mail.gmail.com' \
    --to=alexdeucher-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=Evan.Quan-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.