<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">
<p style="font-family:Arial;font-size:11pt;color:#0078D7;margin:5pt;" align="Left">
[AMD Official Use Only - Internal Distribution Only]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Acked-by: Alex Deucher <alexander.deucher@amd.com><br>
</div>
<div id="appendonsend"></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 Aurabindo Pillai <aurabindo.pillai@amd.com><br>
<b>Sent:</b> Wednesday, April 21, 2021 3:17 PM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Lakha, Bhawanpreet <Bhawanpreet.Lakha@amd.com>; Kazlauskas, Nicholas <Nicholas.Kazlauskas@amd.com>; R, Bindu <Bindu.R@amd.com><br>
<b>Subject:</b> [PATCH] drm/amd/display: get socBB from VBIOS for dcn302</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">[why]<br>
Some SOC BB paramters may vary per SKU, and it does<br>
not make sense for driver to hardcode these values.<br>
This change was added for dcn30 and dcn301, but not<br>
for dcn302<br>
<br>
[how]<br>
Parse the values from VBIOS if available, and use<br>
them if valid<br>
<br>
Fixes: 93669c8e48 ("drm/amd/display: get socBB from VBIOS")<br>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com><br>
---<br>
 .../amd/display/dc/dcn302/dcn302_resource.c   | 20 +++++++++++++++++++<br>
 1 file changed, 20 insertions(+)<br>
<br>
diff --git a/drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c b/drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c<br>
index fc2dea243d1b..f44814d15206 100644<br>
--- a/drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c<br>
+++ b/drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c<br>
@@ -1101,6 +1101,26 @@ static bool init_soc_bounding_box(struct dc *dc,  struct resource_pool *pool)<br>
         loaded_ip->max_num_dpp = pool->pipe_count;<br>
         loaded_ip->clamp_min_dcfclk = dc->config.clamp_min_dcfclk;<br>
         dcn20_patch_bounding_box(dc, loaded_bb);<br>
+<br>
+       if (dc->ctx->dc_bios->funcs->get_soc_bb_info) {<br>
+               struct bp_soc_bb_info bb_info = { 0 };<br>
+<br>
+               if (dc->ctx->dc_bios->funcs->get_soc_bb_info(<br>
+                           dc->ctx->dc_bios, &bb_info) == BP_RESULT_OK) {<br>
+                       if (bb_info.dram_clock_change_latency_100ns > 0)<br>
+                               dcn3_02_soc.dram_clock_change_latency_us =<br>
+                                       bb_info.dram_clock_change_latency_100ns * 10;<br>
+<br>
+                       if (bb_info.dram_sr_enter_exit_latency_100ns > 0)<br>
+                               dcn3_02_soc.sr_enter_plus_exit_time_us =<br>
+                                       bb_info.dram_sr_enter_exit_latency_100ns * 10;<br>
+<br>
+                       if (bb_info.dram_sr_exit_latency_100ns > 0)<br>
+                               dcn3_02_soc.sr_exit_time_us =<br>
+                                       bb_info.dram_sr_exit_latency_100ns * 10;<br>
+               }<br>
+       }<br>
+<br>
         return true;<br>
 }<br>
 <br>
-- <br>
2.31.1<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Calexander.deucher%40amd.com%7Cd4786559160d4972759e08d904fa2c5d%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637546294804838871%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=qVnczJLExg%2FX2JaAh4euZPDU%2F5HO1fKscQ0XYjVrk5I%3D&amp;reserved=0">https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Calexander.deucher%40amd.com%7Cd4786559160d4972759e08d904fa2c5d%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637546294804838871%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=qVnczJLExg%2FX2JaAh4euZPDU%2F5HO1fKscQ0XYjVrk5I%3D&amp;reserved=0</a><br>
</div>
</span></font></div>
</div>
</body>
</html>