All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] drm/amd/powerplay: Copy watermark to SMU
@ 2019-12-13 16:11 Zhan Liu
  2019-12-13 17:10 ` Alex Deucher
  0 siblings, 1 reply; 2+ messages in thread
From: Zhan Liu @ 2019-12-13 16:11 UTC (permalink / raw)
  To: amd-gfx, hersenxs.wu, Alexander.Deucher, Kevin1.Wang, Evan.Quan,
	Tianci.Yin
  Cc: Zhan Liu

[Why]
Watermark value was expected to copy to SMU
within navi10_display_config_changed(). But
navi10_display_config_changed() is never called.
As a result, the watermark value is never
copied to SMU.

[How]
At end of navi10_set_watermarks_table,
copy watermark to SMU.

Signed-off-by: Zhan Liu <zhan.liu@amd.com>
---
 drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
index 15403b7979d6..f4cdd78492fa 100644
--- a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
+++ b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
@@ -1472,6 +1472,17 @@ static int navi10_set_watermarks_table(struct smu_context *smu,
 				clock_ranges->wm_mcif_clocks_ranges[i].wm_set_id;
 	}
 
+	/* Pass data to smu controller */
+	if ((smu->watermarks_bitmap & WATERMARKS_EXIST) &&
+			!(smu->watermarks_bitmap & WATERMARKS_LOADED)) {
+		int ret = smu_write_watermarks_table(smu);
+		if (ret) {
+			pr_err("Failed to update WMTABLE!");
+			return ret;
+		}
+		smu->watermarks_bitmap |= WATERMARKS_LOADED;
+	}
+
 	return 0;
 }
 
-- 
2.17.1

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

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

* Re: [PATCH v3] drm/amd/powerplay: Copy watermark to SMU
  2019-12-13 16:11 [PATCH v3] drm/amd/powerplay: Copy watermark to SMU Zhan Liu
@ 2019-12-13 17:10 ` Alex Deucher
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Deucher @ 2019-12-13 17:10 UTC (permalink / raw)
  To: Zhan Liu
  Cc: Kevin Wang, tiancyin, amd-gfx list, Hersen Wu, Deucher,
	Alexander, Quan, Evan

On Fri, Dec 13, 2019 at 11:11 AM Zhan Liu <zhan.liu@amd.com> wrote:
>
> [Why]
> Watermark value was expected to copy to SMU
> within navi10_display_config_changed(). But
> navi10_display_config_changed() is never called.
> As a result, the watermark value is never
> copied to SMU.
>
> [How]
> At end of navi10_set_watermarks_table,
> copy watermark to SMU.
>
> Signed-off-by: Zhan Liu <zhan.liu@amd.com>

This and the renoir patch are:
Acked-by: Alex Deucher <alexander.deucher@amd.com>

Do we know why this isn't getting setup in the display configuration
callback?  Are the watermarks static or do the depend on something?

Alex

> ---
>  drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
> index 15403b7979d6..f4cdd78492fa 100644
> --- a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
> +++ b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
> @@ -1472,6 +1472,17 @@ static int navi10_set_watermarks_table(struct smu_context *smu,
>                                 clock_ranges->wm_mcif_clocks_ranges[i].wm_set_id;
>         }
>
> +       /* Pass data to smu controller */
> +       if ((smu->watermarks_bitmap & WATERMARKS_EXIST) &&
> +                       !(smu->watermarks_bitmap & WATERMARKS_LOADED)) {
> +               int ret = smu_write_watermarks_table(smu);
> +               if (ret) {
> +                       pr_err("Failed to update WMTABLE!");
> +                       return ret;
> +               }
> +               smu->watermarks_bitmap |= WATERMARKS_LOADED;
> +       }
> +
>         return 0;
>  }
>
> --
> 2.17.1
>
> Fix a typo here.
> _______________________________________________
> 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] 2+ messages in thread

end of thread, other threads:[~2019-12-13 20:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-13 16:11 [PATCH v3] drm/amd/powerplay: Copy watermark to SMU Zhan Liu
2019-12-13 17:10 ` Alex Deucher

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.