Skip to contentSkip to conversation

drm/amd/powerplay: convert the sclk/mclk into Mhz for comparation

PATCH In review Evan Quan 3 participants 5 messages Jul 11, 2018 – Jul 12, 2018 3 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Evan Quan

author
#0 lore raw

PATCH 1/1 drm/amd/powerplay: convert the sclk/mclk into Mhz for comparation

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

Change-Id I80e1af975715712f5ddef4ca6a6e356d90932613
---
 drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c +2 -2
index cae76fe65881..c0ceb69a23b0 100644
@@ -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:
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]

Reviewed-by
#2 lore raw
Quoted 5 lines · Evan Quan

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

Change-Id I80e1af975715712f5ddef4ca6a6e356d90932613
Quoted 33 lines
---
 drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c +2 -2
index cae76fe65881..c0ceb69a23b0 100644
@@ -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:
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

Reviewed-by
#3 lore raw
In reply to a message not in the archive
Quoted 14 lines · Evan Quan

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

Change-Id I80e1af975715712f5ddef4ca6a6e356d90932613
---
 drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c +0 -0
index cae76fe65881..c0ceb69a23b0 100644

drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c static int vega12_print_clock_levels(struct pp_hwmgr *hwmgr, · line 1884

Quoted 5 lines
drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c +1 -1
@@ -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) ? "*" : "");

drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c static int vega12_print_clock_levels(struct pp_hwmgr *hwmgr, · line 1900

Quoted 9 lines
drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c +1 -1
                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:

Quoted 10 lines
drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c +0 -1
                break;
 
        case PP_PCIE:
--

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_M+OQDMjaHbXHoOMHVfSrQbGSLoz4gHNvYZiJCCjtwe7g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

author
#5 lore raw
Quoted 3 lines

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

Quoted 48 lines

-----Original Message-----
From: Alex Deucher [mailto:[email protected]]
Sent: Wednesday, July 11, 2018 11:35 PM
To: Quan, Evan <[email protected]>
Cc: amd-gfx list <[email protected]>
Subject: Re: [PATCH] drm/amd/powerplay: convert the sclk/mclk into Mhz for comparation

drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c static int vega12_print_clock_levels(struct

Quoted 15 lines · Evan Quan

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

Change-Id I80e1af975715712f5ddef4ca6a6e356d90932613
---
 drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c +0 -0
index cae76fe65881..c0ceb69a23b0 100644
@@ -1881,7 +1881,7 @@ static int vega12_print_clock_levels(struct

pp_hwmgr *hwmgr,

drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c static int vega12_print_clock_levels(struct pp_hwmgr *hwmgr,

Quoted 6 lines
drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c +2 -1
                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) ? "*" : "");

drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c static int vega12_print_clock_levels(struct

Quoted 4 lines
drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c +0 -0
                break;
 
        case PP_MCLK:
@@ -1897,7 +1897,7 @@ static int vega12_print_clock_levels(struct

pp_hwmgr *hwmgr,

drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c static int vega12_print_clock_levels(struct pp_hwmgr *hwmgr,

Quoted 6 lines
drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c +2 -1
                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) ? "*" : "");
Quoted 13 lines

Same here. Either way:

Quoted 10 lines
drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c +0 -1
                break;
 
        case PP_PCIE:
--

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): SN6PR12MB265670F9019D1B6B213E4B30E4590-kxOKjb6HO/FeL/[email protected]

Reviewed-by
#7 lore raw
Quoted 5 lines · Evan
Quoted 3 lines

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,

Alex

Quoted 64 lines

Regards,
Evan

Quoted 61 lines

-----Original Message-----
From: Alex Deucher [mailto:[email protected]]
Sent: Wednesday, July 11, 2018 11:35 PM
To: Quan, Evan <[email protected]>
Cc: amd-gfx list <[email protected]>
Subject: Re: [PATCH] drm/amd/powerplay: convert the sclk/mclk into Mhz for comparation

drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c static int vega12_print_clock_levels(struct

Quoted 15 lines · Evan Quan

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

Change-Id I80e1af975715712f5ddef4ca6a6e356d90932613
---
 drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c +0 -0
index cae76fe65881..c0ceb69a23b0 100644
@@ -1881,7 +1881,7 @@ static int vega12_print_clock_levels(struct

pp_hwmgr *hwmgr,

drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c static int vega12_print_clock_levels(struct pp_hwmgr *hwmgr,

Quoted 6 lines
drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c +2 -1
                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) ? "*" : "");

drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c static int vega12_print_clock_levels(struct

Quoted 4 lines
drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c +0 -0
                break;
 
        case PP_MCLK:
@@ -1897,7 +1897,7 @@ static int vega12_print_clock_levels(struct

pp_hwmgr *hwmgr,

drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c static int vega12_print_clock_levels(struct pp_hwmgr *hwmgr,

Quoted 6 lines
drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c +2 -1
                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:

Quoted 10 lines
drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c +0 -1
                break;
 
        case PP_PCIE:
--

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