<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
{margin-top:0;
margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>seems reasonable.</p>
<p><br>
</p>
<p>but i think need to check <span style="color:rgb(33,33,33); font-size:13.3333px">num_levels can't be 0. in some case, there is only one level of mclk, and
<span style="color:rgb(33,33,33); font-size:13.3333px">higher than the max validation clocks.. and will lead kernel panic.</span></span></p>
<p><span style="color:rgb(33,33,33); font-size:13.3333px"><span style="color:rgb(33,33,33); font-size:13.3333px"><br>
</span></span></p>
<p><span style="color:rgb(33,33,33); font-size:13.3333px"><span style="color:rgb(33,33,33); font-size:13.3333px">Best Regards</span></span></p>
<p><span style="color:rgb(33,33,33); font-size:13.3333px"><span style="color:rgb(33,33,33); font-size:13.3333px">Rex</span></span></p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Wentland, Harry<br>
<b>Sent:</b> Monday, February 6, 2017 10:54:24 PM<br>
<b>To:</b> Zhu, Rex; amd-gfx@lists.freedesktop.org<br>
<b>Subject:</b> Re: [PATCH 1/2] drm/amd/display: fix array lenth error.</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">On 2017-02-06 12:08 AM, Rex Zhu wrote:<br>
> Change-Id: I09011c5e6d5493db7e3d9a7ff7ab8c871a8db862<br>
> Signed-off-by: Rex Zhu <Rex.Zhu@amd.com><br>
> ---<br>
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c | 4 ++--<br>
> 1 file changed, 2 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 5af27aa..50576c6 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>
> @@ -358,7 +358,7 @@ bool dm_pp_get_clock_levels_by_type(<br>
> * non-boosted one. */<br>
> DRM_INFO("DM_PPLIB: reducing engine clock level from %d to %d\n",<br>
> dc_clks->num_levels, i + 1);<br>
> - dc_clks->num_levels = i;<br>
> + dc_clks->num_levels = i + 1;<br>
<br>
It seems to me the DRM_INFO print is wrong here, not the actual<br>
assignment. We're setting num_levels to the current index if the clocks<br>
for that index are higher than the max validation clocks, hence this<br>
index now should become num_levels.<br>
<br>
> break;<br>
> }<br>
> }<br>
> @@ -367,7 +367,7 @@ bool dm_pp_get_clock_levels_by_type(<br>
> if (dc_clks->clocks_in_khz[i] > validation_clks.memory_max_clock) {<br>
> DRM_INFO("DM_PPLIB: reducing memory clock level from %d to %d\n",<br>
> dc_clks->num_levels, i + 1);<br>
> - dc_clks->num_levels = i;<br>
> + dc_clks->num_levels = i + 1;<br>
> break;<br>
> }<br>
> }<br>
> <br>
<br>
Same comment as above.<br>
<br>
Harry<br>
</div>
</span></font>
</body>
</html>