All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/powerplay: Fix hardmins not being sent to SMU for RV
@ 2020-08-21 15:31 Nicholas Kazlauskas
  2020-08-21 15:35 ` Alex Deucher
  2020-08-24  3:12 ` Quan, Evan
  0 siblings, 2 replies; 3+ messages in thread
From: Nicholas Kazlauskas @ 2020-08-21 15:31 UTC (permalink / raw)
  To: amd-gfx; +Cc: Hersen Wu, Nicholas Kazlauskas

[Why]
DC uses these to raise the voltage as needed for higher dispclk/dppclk
and to ensure that we have enough bandwidth to drive the displays.

There's a bug preventing these from actuially sending messages since
it's checking the actual clock (which is 0) instead of the incoming
clock (which shouldn't be 0) when deciding to send the hardmin.

[How]
Check the clocks != 0 instead of the actual clocks.

Fixes: 9ed9203c3ee7 ("drm/amd/powerplay: rv dal-pplib interface refactor powerplay part")
Cc: Hersen Wu <hersenxs.wu@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
---
 drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c
index c9cfe90a2947..9ee8cf8267c8 100644
--- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c
+++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c
@@ -204,8 +204,7 @@ static int smu10_set_min_deep_sleep_dcefclk(struct pp_hwmgr *hwmgr, uint32_t clo
 {
 	struct smu10_hwmgr *smu10_data = (struct smu10_hwmgr *)(hwmgr->backend);
 
-	if (smu10_data->need_min_deep_sleep_dcefclk &&
-		smu10_data->deep_sleep_dcefclk != clock) {
+	if (clock && smu10_data->deep_sleep_dcefclk != clock) {
 		smu10_data->deep_sleep_dcefclk = clock;
 		smum_send_msg_to_smc_with_parameter(hwmgr,
 					PPSMC_MSG_SetMinDeepSleepDcefclk,
@@ -219,8 +218,7 @@ 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 != clock) {
+	if (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,
@@ -234,8 +232,7 @@ 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 != clock) {
+	if (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,
-- 
2.25.1

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

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

* Re: [PATCH] drm/amd/powerplay: Fix hardmins not being sent to SMU for RV
  2020-08-21 15:31 [PATCH] drm/amd/powerplay: Fix hardmins not being sent to SMU for RV Nicholas Kazlauskas
@ 2020-08-21 15:35 ` Alex Deucher
  2020-08-24  3:12 ` Quan, Evan
  1 sibling, 0 replies; 3+ messages in thread
From: Alex Deucher @ 2020-08-21 15:35 UTC (permalink / raw)
  To: Nicholas Kazlauskas; +Cc: Hersen Wu, amd-gfx list

On Fri, Aug 21, 2020 at 11:31 AM Nicholas Kazlauskas
<nicholas.kazlauskas@amd.com> wrote:
>
> [Why]
> DC uses these to raise the voltage as needed for higher dispclk/dppclk
> and to ensure that we have enough bandwidth to drive the displays.
>
> There's a bug preventing these from actuially sending messages since
> it's checking the actual clock (which is 0) instead of the incoming
> clock (which shouldn't be 0) when deciding to send the hardmin.
>
> [How]
> Check the clocks != 0 instead of the actual clocks.
>
> Fixes: 9ed9203c3ee7 ("drm/amd/powerplay: rv dal-pplib interface refactor powerplay part")
> Cc: Hersen Wu <hersenxs.wu@amd.com>
> Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c
> index c9cfe90a2947..9ee8cf8267c8 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c
> @@ -204,8 +204,7 @@ static int smu10_set_min_deep_sleep_dcefclk(struct pp_hwmgr *hwmgr, uint32_t clo
>  {
>         struct smu10_hwmgr *smu10_data = (struct smu10_hwmgr *)(hwmgr->backend);
>
> -       if (smu10_data->need_min_deep_sleep_dcefclk &&
> -               smu10_data->deep_sleep_dcefclk != clock) {
> +       if (clock && smu10_data->deep_sleep_dcefclk != clock) {
>                 smu10_data->deep_sleep_dcefclk = clock;
>                 smum_send_msg_to_smc_with_parameter(hwmgr,
>                                         PPSMC_MSG_SetMinDeepSleepDcefclk,
> @@ -219,8 +218,7 @@ 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 != clock) {
> +       if (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,
> @@ -234,8 +232,7 @@ 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 != clock) {
> +       if (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,
> --
> 2.25.1
>
> _______________________________________________
> 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] 3+ messages in thread

* RE: [PATCH] drm/amd/powerplay: Fix hardmins not being sent to SMU for RV
  2020-08-21 15:31 [PATCH] drm/amd/powerplay: Fix hardmins not being sent to SMU for RV Nicholas Kazlauskas
  2020-08-21 15:35 ` Alex Deucher
@ 2020-08-24  3:12 ` Quan, Evan
  1 sibling, 0 replies; 3+ messages in thread
From: Quan, Evan @ 2020-08-24  3:12 UTC (permalink / raw)
  To: Kazlauskas, Nicholas, amd-gfx; +Cc: Wu, Hersen, Kazlauskas, Nicholas

[AMD Official Use Only - Internal Distribution Only]

Reviewed-by: Evan Quan <evan.quan@amd.com>

-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Nicholas Kazlauskas
Sent: Friday, August 21, 2020 11:32 PM
To: amd-gfx@lists.freedesktop.org
Cc: Wu, Hersen <hersenxs.wu@amd.com>; Kazlauskas, Nicholas <Nicholas.Kazlauskas@amd.com>
Subject: [PATCH] drm/amd/powerplay: Fix hardmins not being sent to SMU for RV

[Why]
DC uses these to raise the voltage as needed for higher dispclk/dppclk
and to ensure that we have enough bandwidth to drive the displays.

There's a bug preventing these from actuially sending messages since
it's checking the actual clock (which is 0) instead of the incoming
clock (which shouldn't be 0) when deciding to send the hardmin.

[How]
Check the clocks != 0 instead of the actual clocks.

Fixes: 9ed9203c3ee7 ("drm/amd/powerplay: rv dal-pplib interface refactor powerplay part")
Cc: Hersen Wu <hersenxs.wu@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
---
 drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c
index c9cfe90a2947..9ee8cf8267c8 100644
--- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c
+++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c
@@ -204,8 +204,7 @@ static int smu10_set_min_deep_sleep_dcefclk(struct pp_hwmgr *hwmgr, uint32_t clo
 {
 struct smu10_hwmgr *smu10_data = (struct smu10_hwmgr *)(hwmgr->backend);

-if (smu10_data->need_min_deep_sleep_dcefclk &&
-smu10_data->deep_sleep_dcefclk != clock) {
+if (clock && smu10_data->deep_sleep_dcefclk != clock) {
 smu10_data->deep_sleep_dcefclk = clock;
 smum_send_msg_to_smc_with_parameter(hwmgr,
 PPSMC_MSG_SetMinDeepSleepDcefclk,
@@ -219,8 +218,7 @@ 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 != clock) {
+if (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,
@@ -234,8 +232,7 @@ 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 != clock) {
+if (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,
--
2.25.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Cevan.quan%40amd.com%7Cfb748092bae64ab5310b08d845e757fe%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637336207270141080&amp;sdata=Fx4uvt6aq66As36HOBIIkGzMmIOS%2B2JbEpQzSGC6RfE%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

end of thread, other threads:[~2020-08-24  3:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-21 15:31 [PATCH] drm/amd/powerplay: Fix hardmins not being sent to SMU for RV Nicholas Kazlauskas
2020-08-21 15:35 ` Alex Deucher
2020-08-24  3:12 ` Quan, Evan

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.