<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);">
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 Jack Zhang <Jack.Zhang1@amd.com><br>
<b>Sent:</b> Monday, July 13, 2020 10:46 PM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Zhang, Jack (Jian) <Jack.Zhang1@amd.com>; Liu, Leo <Leo.Liu@amd.com>; Zhang, Hawking <Hawking.Zhang@amd.com><br>
<b>Subject:</b> [PATCH 2/5] drm/amdgpu: optimize rlcg write for gfx_v10</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">For gfx10 boards, except for nv12, other boards take mmio write<br>
rather than rlcg write<br>
---<br>
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 26 +++++++++++++++++++-------<br>
 1 file changed, 19 insertions(+), 7 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c<br>
index c1f8c986380c..a78a6a1b593a 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c<br>
@@ -4728,12 +4728,19 @@ static int gfx_v10_0_init_csb(struct amdgpu_device *adev)<br>
         adev->gfx.rlc.funcs->get_csb_buffer(adev, adev->gfx.rlc.cs_ptr);<br>
 <br>
         /* csib */<br>
-       WREG32_SOC15_RLC(GC, 0, mmRLC_CSIB_ADDR_HI,<br>
-                        adev->gfx.rlc.clear_state_gpu_addr >> 32);<br>
-       WREG32_SOC15_RLC(GC, 0, mmRLC_CSIB_ADDR_LO,<br>
-                        adev->gfx.rlc.clear_state_gpu_addr & 0xfffffffc);<br>
-       WREG32_SOC15_RLC(GC, 0, mmRLC_CSIB_LENGTH, adev->gfx.rlc.clear_state_size);<br>
-<br>
+       if (adev->asic_type == CHIP_NAVI12) {<br>
+               WREG32_SOC15_RLC(GC, 0, mmRLC_CSIB_ADDR_HI,<br>
+                               adev->gfx.rlc.clear_state_gpu_addr >> 32);<br>
+               WREG32_SOC15_RLC(GC, 0, mmRLC_CSIB_ADDR_LO,<br>
+                               adev->gfx.rlc.clear_state_gpu_addr & 0xfffffffc);<br>
+               WREG32_SOC15_RLC(GC, 0, mmRLC_CSIB_LENGTH, adev->gfx.rlc.clear_state_size);<br>
+       } else {<br>
+               WREG32_SOC15(GC, 0, mmRLC_CSIB_ADDR_HI,<br>
+                               adev->gfx.rlc.clear_state_gpu_addr >> 32);<br>
+               WREG32_SOC15(GC, 0, mmRLC_CSIB_ADDR_LO,<br>
+                               adev->gfx.rlc.clear_state_gpu_addr & 0xfffffffc);<br>
+               WREG32_SOC15(GC, 0, mmRLC_CSIB_LENGTH, adev->gfx.rlc.clear_state_size);<br>
+       }<br>
         return 0;<br>
 }<br>
 <br>
@@ -5341,7 +5348,12 @@ static int gfx_v10_0_cp_gfx_enable(struct amdgpu_device *adev, bool enable)<br>
         tmp = REG_SET_FIELD(tmp, CP_ME_CNTL, ME_HALT, enable ? 0 : 1);<br>
         tmp = REG_SET_FIELD(tmp, CP_ME_CNTL, PFP_HALT, enable ? 0 : 1);<br>
         tmp = REG_SET_FIELD(tmp, CP_ME_CNTL, CE_HALT, enable ? 0 : 1);<br>
-       WREG32_SOC15_RLC(GC, 0, mmCP_ME_CNTL, tmp);<br>
+<br>
+       if (adev->asic_type == CHIP_NAVI12) {<br>
+               WREG32_SOC15_RLC(GC, 0, mmCP_ME_CNTL, tmp);<br>
+       } else {<br>
+               WREG32_SOC15(GC, 0, mmCP_ME_CNTL, tmp);<br>
+       }<br>
 <br>
         for (i = 0; i < adev->usec_timeout; i++) {<br>
                 if (RREG32_SOC15(GC, 0, mmCP_STAT) == 0)<br>
-- <br>
2.17.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=02%7C01%7Calexander.deucher%40amd.com%7Ce334ea6c4d504943153c08d827a02c4b%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637302916203617712&amp;sdata=zj8wkoVYWIyGZ8Y0Dtv8JQ7p6C3RzV%2B%2BnbKFhLYtHDg%3D&amp;reserved=0">https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Calexander.deucher%40amd.com%7Ce334ea6c4d504943153c08d827a02c4b%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637302916203617712&amp;sdata=zj8wkoVYWIyGZ8Y0Dtv8JQ7p6C3RzV%2B%2BnbKFhLYtHDg%3D&amp;reserved=0</a><br>
</div>
</span></font></div>
</div>
</body>
</html>