<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0"><span style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 14.6667px;">> + /* translate 10kHz to kHz */</span><br style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 14.6667px;">
<span style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 14.6667px;">> + clk_level_info->data[i].clocks_in_khz = pp_clks->data[i].clocks_in_khz;</span><br style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 14.6667px;">
<span style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 14.6667px;">> + clk_level_info->data[i].latency_in_us = pp_clks->data[i].clocks_in_khz;</span></p>
<p style="margin-top:0;margin-bottom:0"><span style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 14.6667px;"></span>This seems a typo(latency_in_us = clocks_in_khz
?).</p>
<p style="margin-top:0;margin-bottom:0">And the comment does not meet the code. If it <span style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 14.6667px;">translates
10kHz to kHz, why there is no "*10"?</span><br style="">
<span style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 14.6667px;">> + }</span><br>
</p>
<p style="margin-top:0;margin-bottom:0"><span style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 14.6667px;"><br>
</span></p>
<p style="margin-top:0;margin-bottom:0"><span style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 14.6667px;">Regards,</span></p>
<p style="margin-top:0;margin-bottom:0"><font color="#212121" face="wf_segoe-ui_normal, Segoe UI, Segoe WP, Tahoma, Arial, sans-serif, serif, EmojiFont"><span style="font-size: 14.6667px;">Evan</span></font></p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Alex Deucher <alexdeucher@gmail.com><br>
<b>Sent:</b> Thursday, May 24, 2018 12:35:52 PM<br>
<b>To:</b> Wentland, Harry<br>
<b>Cc:</b> Cheng, Tony; Lipski, Mikita; Zhu, Rex; Wu, Hersen; amd-gfx list<br>
<b>Subject:</b> Re: [PATCH] drm/amd/display: Implement dm_pp_get_clock_levels_by_type_with_latency</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">On Wed, May 23, 2018 at 1:51 PM, Harry Wentland <harry.wentland@amd.com> wrote:<br>
> This is required so we use the correct minimum clocks for Vega. Without<br>
> this pplib will never be able to enter the lowest clock states.<br>
><br>
> Signed-off-by: Harry Wentland <harry.wentland@amd.com><br>
> ---<br>
> .../display/amdgpu_dm/amdgpu_dm_services.c | 46 ++++++++++++++++++-<br>
> 1 file changed, 44 insertions(+), 2 deletions(-)<br>
><br>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c<br>
> index 0229c7edb8ad..30ddd329104d 100644<br>
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c<br>
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c<br>
> @@ -234,6 +234,34 @@ static void pp_to_dc_clock_levels(<br>
> }<br>
> }<br>
><br>
> +static void pp_to_dc_clock_levels_with_latency(<br>
> + const struct pp_clock_levels_with_latency *pp_clks,<br>
> + struct dm_pp_clock_levels_with_latency *clk_level_info,<br>
> + enum dm_pp_clock_type dc_clk_type)<br>
> +{<br>
> + uint32_t i;<br>
> +<br>
> + if (pp_clks->num_levels > DM_PP_MAX_CLOCK_LEVELS) {<br>
> + DRM_INFO("DM_PPLIB: Warning: %s clock: number of levels %d exceeds maximum of %d!\n",<br>
> + DC_DECODE_PP_CLOCK_TYPE(dc_clk_type),<br>
> + pp_clks->num_levels,<br>
> + DM_PP_MAX_CLOCK_LEVELS);<br>
> +<br>
> + clk_level_info->num_levels = DM_PP_MAX_CLOCK_LEVELS;<br>
> + } else<br>
> + clk_level_info->num_levels = pp_clks->num_levels;<br>
> +<br>
> + DRM_INFO("DM_PPLIB: values for %s clock\n",<br>
> + DC_DECODE_PP_CLOCK_TYPE(dc_clk_type));<br>
> +<br>
> + for (i = 0; i < clk_level_info->num_levels; i++) {<br>
> + DRM_INFO("DM_PPLIB:\t %d\n", pp_clks->data[i].clocks_in_khz);<br>
<br>
leftover debugging output? Maybe make that DRM_DEBUG? With that addressed:<br>
Acked-by: Alex Deucher <alexander.deucher@amd.com><br>
<br>
Alex<br>
<br>
> + /* translate 10kHz to kHz */<br>
> + clk_level_info->data[i].clocks_in_khz = pp_clks->data[i].clocks_in_khz;<br>
> + clk_level_info->data[i].latency_in_us = pp_clks->data[i].clocks_in_khz;<br>
> + }<br>
> +}<br>
> +<br>
> bool dm_pp_get_clock_levels_by_type(<br>
> const struct dc_context *ctx,<br>
> enum dm_pp_clock_type clk_type,<br>
> @@ -311,8 +339,22 @@ bool dm_pp_get_clock_levels_by_type_with_latency(<br>
> enum dm_pp_clock_type clk_type,<br>
> struct dm_pp_clock_levels_with_latency *clk_level_info)<br>
> {<br>
> - /* TODO: to be implemented */<br>
> - return false;<br>
> + struct amdgpu_device *adev = ctx->driver_context;<br>
> + void *pp_handle = adev->powerplay.pp_handle;<br>
> + struct pp_clock_levels_with_latency pp_clks = { 0 };<br>
> + const struct amd_pm_funcs *pp_funcs = adev->powerplay.pp_funcs;<br>
> +<br>
> + if (!pp_funcs->get_clock_by_type_with_latency)<br>
> + return false;<br>
> +<br>
> + if (pp_funcs->get_clock_by_type_with_latency(pp_handle,<br>
> + dc_to_pp_clock_type(clk_type),<br>
> + &pp_clks))<br>
> + return false;<br>
> +<br>
> + pp_to_dc_clock_levels_with_latency(&pp_clks, clk_level_info, clk_type);<br>
> +<br>
> + return true;<br>
> }<br>
><br>
> bool dm_pp_get_clock_levels_by_type_with_voltage(<br>
> --<br>
> 2.17.0<br>
><br>
> _______________________________________________<br>
> amd-gfx mailing list<br>
> amd-gfx@lists.freedesktop.org<br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</div>
</span></font></div>
</body>
</html>