<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<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,Arial,Helvetica,sans-serif;" dir="ltr">
<p>Minor nit: the comment says v8 <img class="EmojiInsert" id="OWAEmoji249760" alt="😊" style="vertical-align: bottom;" src="cid:21a735af-bb78-47a3-9e53-f366ba2223b2"></p>
<p><br>
</p>
<p>The changes to the GFX6/7/8 look reasonable though only question is you read from
<span style="font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 13.3333px;">
mmVM_PRT_CNTL</span> and then write to <span style="font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 13.3333px;">
mmVM_CONTEXT1_CNTL</span> . Is that expected?</p>
<p><br>
</p>
<p>Tom</p>
<br>
<br>
<div style="color: rgb(0, 0, 0);">
<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> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Christian König <deathsimple@vodafone.de><br>
<b>Sent:</b> Monday, January 30, 2017 07:57<br>
<b>To:</b> bas@basnieuwenhuizen.nl; airlied@gmail.com<br>
<b>Cc:</b> amd-gfx@lists.freedesktop.org<br>
<b>Subject:</b> [PATCH 4/6] drm/amdgpu: implement PRT for GFX6</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">From: Christian König <christian.koenig@amd.com><br>
<br>
Enable/disable the handling globally for now and<br>
print a warning when we enable it for the first time.<br>
<br>
Signed-off-by: Christian König <christian.koenig@amd.com><br>
---<br>
drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 63 +++++++++++++++++++++++++++++++++++<br>
1 file changed, 63 insertions(+)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c<br>
index e2b0b16..c23503e 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c<br>
@@ -398,6 +398,68 @@ static void gmc_v6_0_set_fault_enable_default(struct amdgpu_device *adev,<br>
WREG32(mmVM_CONTEXT1_CNTL, tmp);<br>
}<br>
<br>
+ /**<br>
+ + * gmc_v8_0_set_prt - set PRT VM fault<br>
+ + *<br>
+ + * @adev: amdgpu_device pointer<br>
+ + * @enable: enable/disable VM fault handling for PRT<br>
+ +*/<br>
+static void gmc_v6_0_set_prt(struct amdgpu_device *adev, bool enable)<br>
+{<br>
+ u32 tmp;<br>
+<br>
+ if (enable && !adev->mc.prt_warning) {<br>
+ dev_warn(adev->dev, "Disabling VM faults because of PRT request!\n");<br>
+ adev->mc.prt_warning = true;<br>
+ }<br>
+<br>
+ tmp = RREG32(mmVM_PRT_CNTL);<br>
+ tmp = REG_SET_FIELD(tmp, VM_PRT_CNTL,<br>
+ CB_DISABLE_READ_FAULT_ON_UNMAPPED_ACCESS,<br>
+ enable);<br>
+ tmp = REG_SET_FIELD(tmp, VM_PRT_CNTL,<br>
+ CB_DISABLE_WRITE_FAULT_ON_UNMAPPED_ACCESS,<br>
+ enable);<br>
+ tmp = REG_SET_FIELD(tmp, VM_PRT_CNTL,<br>
+ TC_DISABLE_READ_FAULT_ON_UNMAPPED_ACCESS,<br>
+ enable);<br>
+ tmp = REG_SET_FIELD(tmp, VM_PRT_CNTL,<br>
+ TC_DISABLE_WRITE_FAULT_ON_UNMAPPED_ACCESS,<br>
+ enable);<br>
+ tmp = REG_SET_FIELD(tmp, VM_PRT_CNTL,<br>
+ L2_CACHE_STORE_INVALID_ENTRIES,<br>
+ enable);<br>
+ tmp = REG_SET_FIELD(tmp, VM_PRT_CNTL,<br>
+ L1_TLB_STORE_INVALID_ENTRIES,<br>
+ enable);<br>
+ tmp = REG_SET_FIELD(tmp, VM_PRT_CNTL,<br>
+ MASK_PDE0_FAULT, enable);<br>
+ WREG32(mmVM_CONTEXT1_CNTL, tmp);<br>
+<br>
+ if (enable) {<br>
+ uint32_t low = AMDGPU_VA_RESERVED_SIZE >> AMDGPU_GPU_PAGE_SHIFT;<br>
+ uint32_t high = adev->vm_manager.max_pfn;<br>
+<br>
+ WREG32(mmVM_PRT_APERTURE0_LOW_ADDR, low);<br>
+ WREG32(mmVM_PRT_APERTURE1_LOW_ADDR, low);<br>
+ WREG32(mmVM_PRT_APERTURE2_LOW_ADDR, low);<br>
+ WREG32(mmVM_PRT_APERTURE3_LOW_ADDR, low);<br>
+ WREG32(mmVM_PRT_APERTURE0_HIGH_ADDR, high);<br>
+ WREG32(mmVM_PRT_APERTURE1_HIGH_ADDR, high);<br>
+ WREG32(mmVM_PRT_APERTURE2_HIGH_ADDR, high);<br>
+ WREG32(mmVM_PRT_APERTURE3_HIGH_ADDR, high);<br>
+ } else {<br>
+ WREG32(mmVM_PRT_APERTURE0_LOW_ADDR, 0xfffffff);<br>
+ WREG32(mmVM_PRT_APERTURE1_LOW_ADDR, 0xfffffff);<br>
+ WREG32(mmVM_PRT_APERTURE2_LOW_ADDR, 0xfffffff);<br>
+ WREG32(mmVM_PRT_APERTURE3_LOW_ADDR, 0xfffffff);<br>
+ WREG32(mmVM_PRT_APERTURE0_HIGH_ADDR, 0x0);<br>
+ WREG32(mmVM_PRT_APERTURE1_HIGH_ADDR, 0x0);<br>
+ WREG32(mmVM_PRT_APERTURE2_HIGH_ADDR, 0x0);<br>
+ WREG32(mmVM_PRT_APERTURE3_HIGH_ADDR, 0x0);<br>
+ }<br>
+}<br>
+<br>
static int gmc_v6_0_gart_enable(struct amdgpu_device *adev)<br>
{<br>
int r, i;<br>
@@ -1080,6 +1142,7 @@ static const struct amd_ip_funcs gmc_v6_0_ip_funcs = {<br>
static const struct amdgpu_gart_funcs gmc_v6_0_gart_funcs = {<br>
.flush_gpu_tlb = gmc_v6_0_gart_flush_gpu_tlb,<br>
.set_pte_pde = gmc_v6_0_gart_set_pte_pde,<br>
+ .set_prt = gmc_v6_0_set_prt,<br>
};<br>
<br>
static const struct amdgpu_irq_src_funcs gmc_v6_0_irq_funcs = {<br>
-- <br>
2.5.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" id="LPlnk685925" previewremoved="true">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a>
<div id="LPBorder_GT_14857846636950.18213166157152716" style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table id="LPContainer_14857846636930.6345001279342901" cellspacing="0" style="width: 90%; background-color: rgb(255, 255, 255); position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top: 1px dotted rgb(200, 200, 200); border-bottom: 1px dotted rgb(200, 200, 200);">
<tbody>
<tr valign="top" style="border-spacing: 0px;">
<td id="TextCell_14857846636940.48014062491777976" colspan="2" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;">
<div id="LPRemovePreviewContainer_14857846636940.3774216837186106"></div>
<div id="LPTitle_14857846636940.9893355573948246" style="top: 0px; color: rgb(59, 87, 119); font-weight: normal; font-size: 21px; font-family: wf_segoe-ui_light, "Segoe UI Light", "Segoe WP Light", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; line-height: 21px;">
<a id="LPUrlAnchor_14857846636950.10171241072401171" href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx" target="_blank" style="text-decoration: none;">amd-gfx Info Page - lists.freedesktop.org</a></div>
<div id="LPMetadata_14857846636950.8672987540780379" style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 14px;">
lists.freedesktop.org</div>
<div id="LPDescription_14857846636950.14446370601966319" style="display: block; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;">
To see the collection of prior postings to the list, visit the amd-gfx Archives. Using amd-gfx: To post a message to all the list members, send email ...</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>