Skip to contentSkip to conversation

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

PATCH In review hersen wu 4 participants 5 messages Apr 15, 2019 – Apr 17, 2019 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

hersen wu

author
#0 lore raw

PATCH 1/2 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
this fixes corruption issue with 4k @60 display and stutter mode enable

---
 .../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]

author
#2 lore raw

Hi, Kenneth, Ray,

Would you please help review this change?

Thanks,
Hersen

-----Original Message-----
From: hersen wu <[email protected]>
Sent: Monday, April 15, 2019 10:18 AM
To: [email protected]; Deucher, Alexander <[email protected]>
Cc: Wu, Hersen <[email protected]>
Subject: [PATCH 1/2] 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
this fixes corruption issue with 4k @60 display and stutter mode enable

---
 .../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 -10
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

Reviewed-by Kenneth Feng
#3 lore raw
In reply to a message not in the archive

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of hersen wu
Sent: Monday, April 15, 2019 10:18 PM
To: [email protected]; Deucher, Alexander <[email protected]>
Cc: Wu, Hersen <[email protected]>
Subject: [PATCH 1/2] 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
this fixes corruption issue with 4k @60 display and stutter mode enable

---
 .../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 -10
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

#4 lore raw
In reply to a message not in the archive
Quoted 9 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of hersen wu
Sent: Monday, April 15, 2019 10:18 PM
To: [email protected]; Deucher, Alexander <[email protected]>
Cc: Wu, Hersen <[email protected]>
Subject: [PATCH 1/2] SWDEV-183622 4k@60hz dp monitor always flicking

Quoted 8 lines

[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
this fixes corruption issue with 4k @60 display and stutter mode enable

We would better not to expose internal ticket (SWDEV-183622) to public.

Shall we modify the patch title as "drm/amd/powerplay: fix the issue that 4k@60hz dp monitor always flicking"

With that fixed, patch is Reviewed-by: Huang Rui <[email protected]>

Quoted 69 lines
---
 .../gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c   | 17 ++++++----------
(quoted diff) +0 -1
-
 1 file changed, 6 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c +2 -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,

drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c +0 -0
 					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);

drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c +0 -1
 	if (smu10_data->dcf_actual_hard_min_freq &&
-		smu10_data->dcf_actual_hard_min_freq !=

convert_10k_to_mhz(clock)) {

drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c +0 -1
-		smu10_data->dcf_actual_hard_min_freq =

convert_10k_to_mhz(clock);

drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c +2 -0
+		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-

Quoted 1 line

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);

drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c +0 -1
 	if (smu10_data->f_actual_hard_min_freq &&
-		smu10_data->f_actual_hard_min_freq !=

convert_10k_to_mhz(clock)) {

drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c +0 -1
-		smu10_data->f_actual_hard_min_freq =

convert_10k_to_mhz(clock);

drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c +2 -0
+		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-
Quoted 1 line

f_actual_hard_min_freq);

Quoted 7 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

A message that is not in the archive (sent off-list or not yet received): MN2PR12MB3309542F67D66964D8469D24EC250-rweVpJHSKTpWdvXm18W95QdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

#6 lore raw

Patch is Tested-by: Likun Gao <[email protected]>

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Huang, Ray
Sent: Wednesday, April 17, 2019 2:26 PM
To: Wu, Hersen <[email protected]>; [email protected]; Deucher, Alexander <[email protected]>
Cc: Wu, Hersen <[email protected]>
Subject: RE: [PATCH 1/2] SWDEV-183622 4k@60hz dp monitor always flicking

Quoted 9 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of hersen wu
Sent: Monday, April 15, 2019 10:18 PM
To: [email protected]; Deucher, Alexander <[email protected]>
Cc: Wu, Hersen <[email protected]>
Subject: [PATCH 1/2] SWDEV-183622 4k@60hz dp monitor always flicking

Quoted 8 lines

[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
this fixes corruption issue with 4k @60 display and stutter mode enable

We would better not to expose internal ticket (SWDEV-183622) to public.

Shall we modify the patch title as "drm/amd/powerplay: fix the issue that 4k@60hz dp monitor always flicking"

With that fixed, patch is Reviewed-by: Huang Rui <[email protected]>

Quoted 67 lines
---
 .../gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c   | 17 ++++++----------
(quoted diff) +0 -1
-
 1 file changed, 6 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c +2 -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);

drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c +0 -1
 	if (smu10_data->dcf_actual_hard_min_freq &&
-		smu10_data->dcf_actual_hard_min_freq !=

convert_10k_to_mhz(clock)) {

drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c +0 -1
-		smu10_data->dcf_actual_hard_min_freq =

convert_10k_to_mhz(clock);

drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c +2 -0
+		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-

Quoted 1 line

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);

drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c +0 -1
 	if (smu10_data->f_actual_hard_min_freq &&
-		smu10_data->f_actual_hard_min_freq !=

convert_10k_to_mhz(clock)) {

drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c +0 -1
-		smu10_data->f_actual_hard_min_freq =

convert_10k_to_mhz(clock);

drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c +2 -0
+		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-
Quoted 1 line

f_actual_hard_min_freq);

Quoted 7 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