Skip to contentSkip to conversation

SWDEV-183622 4k@60hz dp monitor always flicking

PATCH In review hersen wu 4 participants 4 messages Apr 15, 2019 – Apr 16, 2019 3 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

hersen wu

author
#0 lore raw

PATCH 1/1 SWDEV-183622 4k@60hz dp monitor always flicking

[WHY] clock unit mis-match between caller DC and SMU interface.
dc pass lock in mhz. the same unit as smu. no covert is needed.

[HOW] remove covert_10k_to_mhz in smu interface

---
 .../gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c   | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c +6 -11
index f32e3d0aaea6..078613348e78 100644
@@ -204,18 +204,13 @@ static int smu10_set_clock_limit(struct pp_hwmgr *hwmgr, const void *input)
 	return 0;
 }
 
-static inline uint32_t convert_10k_to_mhz(uint32_t clock)
-{
-	return (clock + 99) / 100;
-}
-
 static int smu10_set_min_deep_sleep_dcefclk(struct pp_hwmgr *hwmgr, uint32_t clock)
 {
 	struct smu10_hwmgr *smu10_data = (struct smu10_hwmgr *)(hwmgr->backend);
 
 	if (smu10_data->need_min_deep_sleep_dcefclk &&
-		smu10_data->deep_sleep_dcefclk != convert_10k_to_mhz(clock)) {
-		smu10_data->deep_sleep_dcefclk = convert_10k_to_mhz(clock);
+		smu10_data->deep_sleep_dcefclk != clock) {
+		smu10_data->deep_sleep_dcefclk = clock;
 		smum_send_msg_to_smc_with_parameter(hwmgr,
 					PPSMC_MSG_SetMinDeepSleepDcefclk,
 					smu10_data->deep_sleep_dcefclk);
@@ -228,8 +223,8 @@ static int smu10_set_hard_min_dcefclk_by_freq(struct pp_hwmgr *hwmgr, uint32_t c
 	struct smu10_hwmgr *smu10_data = (struct smu10_hwmgr *)(hwmgr->backend);
 
 	if (smu10_data->dcf_actual_hard_min_freq &&
-		smu10_data->dcf_actual_hard_min_freq != convert_10k_to_mhz(clock)) {
-		smu10_data->dcf_actual_hard_min_freq = convert_10k_to_mhz(clock);
+		smu10_data->dcf_actual_hard_min_freq != clock) {
+		smu10_data->dcf_actual_hard_min_freq = clock;
 		smum_send_msg_to_smc_with_parameter(hwmgr,
 					PPSMC_MSG_SetHardMinDcefclkByFreq,
 					smu10_data->dcf_actual_hard_min_freq);
@@ -242,8 +237,8 @@ static int smu10_set_hard_min_fclk_by_freq(struct pp_hwmgr *hwmgr, uint32_t cloc
 	struct smu10_hwmgr *smu10_data = (struct smu10_hwmgr *)(hwmgr->backend);
 
 	if (smu10_data->f_actual_hard_min_freq &&
-		smu10_data->f_actual_hard_min_freq != convert_10k_to_mhz(clock)) {
-		smu10_data->f_actual_hard_min_freq = convert_10k_to_mhz(clock);
+		smu10_data->f_actual_hard_min_freq != clock) {
+		smu10_data->f_actual_hard_min_freq = clock;
 		smum_send_msg_to_smc_with_parameter(hwmgr,
 					PPSMC_MSG_SetHardMinFclkByFreq,
 					smu10_data->f_actual_hard_min_freq);
Signature · 6 lines
2.17.1

_______________________________________________
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]

#2 lore raw

Maybe mention that this fixes issues with stutter mode and 4k. With that,

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of hersen wu <[email protected]>
Sent: Monday, April 15, 2019 9:52 AM
To: [email protected]; Feng, Kenneth
Cc: Wu, Hersen
Subject: [PATCH] SWDEV-183622 4k@60hz dp monitor always flicking

[WHY] clock unit mis-match between caller DC and SMU interface.
dc pass lock in mhz. the same unit as smu. no covert is needed.

[HOW] remove covert_10k_to_mhz in smu interface

---
 .../gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c   | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c +6 -11
index f32e3d0aaea6..078613348e78 100644
@@ -204,18 +204,13 @@ static int smu10_set_clock_limit(struct pp_hwmgr *hwmgr, const void *input)
         return 0;
 }
 
-static inline uint32_t convert_10k_to_mhz(uint32_t clock)
-{
-       return (clock + 99) / 100;
-}
-
 static int smu10_set_min_deep_sleep_dcefclk(struct pp_hwmgr *hwmgr, uint32_t clock)
 {
         struct smu10_hwmgr *smu10_data = (struct smu10_hwmgr *)(hwmgr->backend);
 
         if (smu10_data->need_min_deep_sleep_dcefclk &&
-               smu10_data->deep_sleep_dcefclk != convert_10k_to_mhz(clock)) {
-               smu10_data->deep_sleep_dcefclk = convert_10k_to_mhz(clock);
+               smu10_data->deep_sleep_dcefclk != clock) {
+               smu10_data->deep_sleep_dcefclk = clock;
                 smum_send_msg_to_smc_with_parameter(hwmgr,
                                         PPSMC_MSG_SetMinDeepSleepDcefclk,
                                         smu10_data->deep_sleep_dcefclk);
@@ -228,8 +223,8 @@ static int smu10_set_hard_min_dcefclk_by_freq(struct pp_hwmgr *hwmgr, uint32_t c
         struct smu10_hwmgr *smu10_data = (struct smu10_hwmgr *)(hwmgr->backend);
 
         if (smu10_data->dcf_actual_hard_min_freq &&
-               smu10_data->dcf_actual_hard_min_freq != convert_10k_to_mhz(clock)) {
-               smu10_data->dcf_actual_hard_min_freq = convert_10k_to_mhz(clock);
+               smu10_data->dcf_actual_hard_min_freq != clock) {
+               smu10_data->dcf_actual_hard_min_freq = clock;
                 smum_send_msg_to_smc_with_parameter(hwmgr,
                                         PPSMC_MSG_SetHardMinDcefclkByFreq,
                                         smu10_data->dcf_actual_hard_min_freq);
@@ -242,8 +237,8 @@ static int smu10_set_hard_min_fclk_by_freq(struct pp_hwmgr *hwmgr, uint32_t cloc
         struct smu10_hwmgr *smu10_data = (struct smu10_hwmgr *)(hwmgr->backend);
 
         if (smu10_data->f_actual_hard_min_freq &&
-               smu10_data->f_actual_hard_min_freq != convert_10k_to_mhz(clock)) {
-               smu10_data->f_actual_hard_min_freq = convert_10k_to_mhz(clock);
+               smu10_data->f_actual_hard_min_freq != clock) {
+               smu10_data->f_actual_hard_min_freq = clock;
                 smum_send_msg_to_smc_with_parameter(hwmgr,
                                         PPSMC_MSG_SetHardMinFclkByFreq,
                                         smu10_data->f_actual_hard_min_freq);

--
2.17.1

_______________________________________________
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): BN6PR12MB1809DCA485322E878285C1F7F72B0-/b2+HYfkarSEx6ez0IUAagdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

Acked-by Nicholas Kazlauskas
#4 lore raw
Quoted 12 lines · Alexander

Maybe mention that this fixes issues with stutter mode and 4k.  With that,

------------------------------------------------------------------------
*From:* amd-gfx <[email protected]> on behalf of hersen wu <[email protected]>
*Sent:* Monday, April 15, 2019 9:52 AM
*To:* [email protected]; Feng, Kenneth
*Cc:* Wu, Hersen
*Subject:* [PATCH] SWDEV-183622 4k@60hz dp monitor always flicking [WHY] clock unit mis-match between caller DC and SMU interface.
      dc pass lock in mhz. the same unit as smu. no covert is needed.

Quoted 3 lines

[HOW] remove covert_10k_to_mhz in smu interface

In addition to Alex's comments, you'll want to drop that SWDEV tag from the patch title and probably name it something like:

drm/amd/powerplay: Fix clock units mismatch between DC and SMU

Some other minor nitpicks in the commit body too that can be fixed up:

- dc pass (c)lock in mhz:
- no co(n)vert is needed.

With all those fixed, this patch is:

Quoted 65 lines
---
  .../gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c   | 17 ++++++-----------
  1 file changed, 6 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c +2 -7
index f32e3d0aaea6..078613348e78 100644
@@ -204,18 +204,13 @@ static int smu10_set_clock_limit(struct pp_hwmgr 
 *hwmgr, const void *input)
          return 0;
  }
 
-static inline uint32_t convert_10k_to_mhz(uint32_t clock)
-{
-       return (clock + 99) / 100;
-}
-
  static int smu10_set_min_deep_sleep_dcefclk(struct pp_hwmgr *hwmgr, 
 uint32_t clock)
  {
          struct smu10_hwmgr *smu10_data = (struct smu10_hwmgr 
 *)(hwmgr->backend);
 
          if (smu10_data->need_min_deep_sleep_dcefclk &&
-               smu10_data->deep_sleep_dcefclk != 
 convert_10k_to_mhz(clock)) {
-               smu10_data->deep_sleep_dcefclk = convert_10k_to_mhz(clock);
+               smu10_data->deep_sleep_dcefclk != clock) {
+               smu10_data->deep_sleep_dcefclk = clock;
                  smum_send_msg_to_smc_with_parameter(hwmgr,
                                          PPSMC_MSG_SetMinDeepSleepDcefclk,
                                          smu10_data->deep_sleep_dcefclk);
@@ -228,8 +223,8 @@ static int smu10_set_hard_min_dcefclk_by_freq(struct 

pp_hwmgr *hwmgr, uint32_t c
         struct smu10_hwmgr *smu10_data = (struct smu10_hwmgr
*)(hwmgr->backend);

         if (smu10_data->dcf_actual_hard_min_freq &&
-               smu10_data->dcf_actual_hard_min_freq != convert_10k_to_mhz(clock)) {
-               smu10_data->dcf_actual_hard_min_freq = convert_10k_to_mhz(clock);
+               smu10_data->dcf_actual_hard_min_freq != clock) { +               smu10_data->dcf_actual_hard_min_freq = clock;
                 smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_SetHardMinDcefclkByFreq,

smu10_data->dcf_actual_hard_min_freq);

drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c +0 -0
@@ -242,8 +237,8 @@ static int smu10_set_hard_min_fclk_by_freq(struct 

pp_hwmgr *hwmgr, uint32_t cloc
         struct smu10_hwmgr *smu10_data = (struct smu10_hwmgr
*)(hwmgr->backend);

         if (smu10_data->f_actual_hard_min_freq &&
-               smu10_data->f_actual_hard_min_freq != convert_10k_to_mhz(clock)) {
-               smu10_data->f_actual_hard_min_freq = convert_10k_to_mhz(clock);
+               smu10_data->f_actual_hard_min_freq != clock) { +               smu10_data->f_actual_hard_min_freq = clock;
                 smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_SetHardMinFclkByFreq,

Quoted 14 lines

smu10_data->f_actual_hard_min_freq);

Signature · 11 lines
2.17.1

_______________________________________________
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

_______________________________________________
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): e38a2bb3-f810-d47f-4dbe-4005d7ed2e95-5C7GfCeVMHo@public.gmane.org

#6 lore raw

With comments of Nicholas and Alex addressed, the patch is reviewed-by: Evan Quan <[email protected]>

Quoted 121 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Kazlauskas, Nicholas
Sent: Monday, April 15, 2019 10:12 PM
To: Deucher, Alexander <[email protected]>; Wu, Hersen <[email protected]>; [email protected]; Feng, Kenneth <[email protected]>
Subject: Re: [PATCH] SWDEV-183622 4k@60hz dp monitor always flicking

Quoted 14 lines · Alexander

Maybe mention that this fixes issues with stutter mode and 4k.  With that,

----------------------------------------------------------------------
--
*From:* amd-gfx <[email protected]> on behalf of hersen wu <[email protected]>
*Sent:* Monday, April 15, 2019 9:52 AM
*To:* [email protected]; Feng, Kenneth
*Cc:* Wu, Hersen
*Subject:* [PATCH] SWDEV-183622 4k@60hz dp monitor always flicking [WHY] clock unit mis-match between caller DC and SMU interface.
      dc pass lock in mhz. the same unit as smu. no covert is needed.

Quoted 3 lines

[HOW] remove covert_10k_to_mhz in smu interface

In addition to Alex's comments, you'll want to drop that SWDEV tag from the patch title and probably name it something like:

drm/amd/powerplay: Fix clock units mismatch between DC and SMU

Some other minor nitpicks in the commit body too that can be fixed up:

- dc pass (c)lock in mhz:
- no co(n)vert is needed.

With all those fixed, this patch is:

Quoted 79 lines
---
  .../gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c   | 17
++++++-----------
  1 file changed, 6 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c +0 -6
index f32e3d0aaea6..078613348e78 100644
@@ -204,18 +204,13 @@ static int smu10_set_clock_limit(struct pp_hwmgr
 *hwmgr, const void *input)
          return 0;
  }
 
-static inline uint32_t convert_10k_to_mhz(uint32_t clock) -{
-       return (clock + 99) / 100;
-}
-
  static int smu10_set_min_deep_sleep_dcefclk(struct pp_hwmgr *hwmgr,
 uint32_t clock)
  {
          struct smu10_hwmgr *smu10_data = (struct smu10_hwmgr
 *)(hwmgr->backend);
 
          if (smu10_data->need_min_deep_sleep_dcefclk &&
-               smu10_data->deep_sleep_dcefclk !=
 convert_10k_to_mhz(clock)) {
-               smu10_data->deep_sleep_dcefclk =

convert_10k_to_mhz(clock);
+               smu10_data->deep_sleep_dcefclk != clock) { +               smu10_data->deep_sleep_dcefclk = clock;
                 smum_send_msg_to_smc_with_parameter(hwmgr,

PPSMC_MSG_SetMinDeepSleepDcefclk,

smu10_data->deep_sleep_dcefclk); @@ -228,8 +223,8 @@ static int smu10_set_hard_min_dcefclk_by_freq(struct
pp_hwmgr *hwmgr, uint32_t c
         struct smu10_hwmgr *smu10_data = (struct smu10_hwmgr
*)(hwmgr->backend);

         if (smu10_data->dcf_actual_hard_min_freq &&
-               smu10_data->dcf_actual_hard_min_freq != convert_10k_to_mhz(clock)) {
-               smu10_data->dcf_actual_hard_min_freq = convert_10k_to_mhz(clock);
+               smu10_data->dcf_actual_hard_min_freq != clock) { +               smu10_data->dcf_actual_hard_min_freq = clock;
                 smum_send_msg_to_smc_with_parameter(hwmgr,

PPSMC_MSG_SetHardMinDcefclkByFreq,

smu10_data->dcf_actual_hard_min_freq);

drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c +0 -0
@@ -242,8 +237,8 @@ static int smu10_set_hard_min_fclk_by_freq(struct

pp_hwmgr *hwmgr, uint32_t cloc
         struct smu10_hwmgr *smu10_data = (struct smu10_hwmgr
*)(hwmgr->backend);

         if (smu10_data->f_actual_hard_min_freq &&
-               smu10_data->f_actual_hard_min_freq != convert_10k_to_mhz(clock)) {
-               smu10_data->f_actual_hard_min_freq = convert_10k_to_mhz(clock);
+               smu10_data->f_actual_hard_min_freq != clock) { +               smu10_data->f_actual_hard_min_freq = clock;
                 smum_send_msg_to_smc_with_parameter(hwmgr,

PPSMC_MSG_SetHardMinFclkByFreq,

smu10_data->f_actual_hard_min_freq);
--
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Quoted 10 lines
Quoted 5 lines

_______________________________________________
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

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx