<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:10pt;color:#0078D7;margin:15pt;" 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);">
Reviewed-by: <font size="2"><span style="font-size:11pt">Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com></span></font><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> Nicholas Kazlauskas <nicholas.kazlauskas@amd.com><br>
<b>Sent:</b> July 7, 2020 11:41 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Kazlauskas, Nicholas <Nicholas.Kazlauskas@amd.com>; Lakha, Bhawanpreet <Bhawanpreet.Lakha@amd.com><br>
<b>Subject:</b> [PATCH] drm/amd/display: Add missing CW4 programming for DCN30</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">[Why]<br>
To support inbox1 in CW4 we need to actually program CW4 instead of<br>
region 4 for newer firmware.<br>
<br>
This is done correctly on DCN20/DCN21 but this code wasn't added to<br>
DCN30.<br>
<br>
[How]<br>
Copy over the missing code. It doesn't need address translation since<br>
DCN30 uses virtual addressing.<br>
<br>
Cc: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com><br>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com><br>
---<br>
.../gpu/drm/amd/display/dmub/src/dmub_dcn30.c | 21 ++++++++++++++-----<br>
1 file changed, 16 insertions(+), 5 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn30.c b/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn30.c<br>
index ba8d0bfb5522..215178b8d415 100644<br>
--- a/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn30.c<br>
+++ b/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn30.c<br>
@@ -153,11 +153,22 @@ void dmub_dcn30_setup_windows(struct dmub_srv *dmub,<br>
<br>
offset = cw4->offset;<br>
<br>
- REG_WRITE(DMCUB_REGION4_OFFSET, offset.u.low_part);<br>
- REG_WRITE(DMCUB_REGION4_OFFSET_HIGH, offset.u.high_part);<br>
- REG_SET_2(DMCUB_REGION4_TOP_ADDRESS, 0, DMCUB_REGION4_TOP_ADDRESS,<br>
- cw4->region.top - cw4->region.base - 1, DMCUB_REGION4_ENABLE,<br>
- 1);<br>
+ /* New firmware can support CW4. */<br>
+ if (dmub->fw_version > DMUB_FW_VERSION(1, 0, 10)) {<br>
+ REG_WRITE(DMCUB_REGION3_CW4_OFFSET, offset.u.low_part);<br>
+ REG_WRITE(DMCUB_REGION3_CW4_OFFSET_HIGH, offset.u.high_part);<br>
+ REG_WRITE(DMCUB_REGION3_CW4_BASE_ADDRESS, cw4->region.base);<br>
+ REG_SET_2(DMCUB_REGION3_CW4_TOP_ADDRESS, 0,<br>
+ DMCUB_REGION3_CW4_TOP_ADDRESS, cw4->region.top,<br>
+ DMCUB_REGION3_CW4_ENABLE, 1);<br>
+ } else {<br>
+ REG_WRITE(DMCUB_REGION4_OFFSET, offset.u.low_part);<br>
+ REG_WRITE(DMCUB_REGION4_OFFSET_HIGH, offset.u.high_part);<br>
+ REG_SET_2(DMCUB_REGION4_TOP_ADDRESS, 0,<br>
+ DMCUB_REGION4_TOP_ADDRESS,<br>
+ cw4->region.top - cw4->region.base - 1,<br>
+ DMCUB_REGION4_ENABLE, 1);<br>
+ }<br>
<br>
offset = cw5->offset;<br>
<br>
-- <br>
2.25.1<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>