<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Series is:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Reviewed-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 Christian König <ckoenig.leichtzumerken@gmail.com><br>
<b>Sent:</b> Friday, September 13, 2019 8:18 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Subject:</b> [PATCH 3/3] drm/amdgpu: trace if a PD/PT update is done directly</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">This is usfull for debugging.<br>
<br>
Signed-off-by: Christian König <christian.koenig@amd.com><br>
---<br>
 drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h   | 23 +++++++++++++--------<br>
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c  |  2 +-<br>
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c |  4 ++--<br>
 3 files changed, 17 insertions(+), 12 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h<br>
index d3ca2424b5fe..e9feb5a8fb9d 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h<br>
@@ -325,14 +325,15 @@ DEFINE_EVENT(amdgpu_vm_mapping, amdgpu_vm_bo_cs,<br>
 <br>
 TRACE_EVENT(amdgpu_vm_set_ptes,<br>
             TP_PROTO(uint64_t pe, uint64_t addr, unsigned count,<br>
-                    uint32_t incr, uint64_t flags),<br>
-           TP_ARGS(pe, addr, count, incr, flags),<br>
+                    uint32_t incr, uint64_t flags, bool direct),<br>
+           TP_ARGS(pe, addr, count, incr, flags, direct),<br>
             TP_STRUCT__entry(<br>
                              __field(u64, pe)<br>
                              __field(u64, addr)<br>
                              __field(u32, count)<br>
                              __field(u32, incr)<br>
                              __field(u64, flags)<br>
+                            __field(bool, direct)<br>
                              ),<br>
 <br>
             TP_fast_assign(<br>
@@ -341,28 +342,32 @@ TRACE_EVENT(amdgpu_vm_set_ptes,<br>
                            __entry->count = count;<br>
                            __entry->incr = incr;<br>
                            __entry->flags = flags;<br>
+                          __entry->direct = direct;<br>
                            ),<br>
-           TP_printk("pe=%010Lx, addr=%010Lx, incr=%u, flags=%llx, count=%u",<br>
-                     __entry->pe, __entry->addr, __entry->incr,<br>
-                     __entry->flags, __entry->count)<br>
+           TP_printk("pe=%010Lx, addr=%010Lx, incr=%u, flags=%llx, count=%u, "<br>
+                     "direct=%d", __entry->pe, __entry->addr, __entry->incr,<br>
+                     __entry->flags, __entry->count, __entry->direct)<br>
 );<br>
 <br>
 TRACE_EVENT(amdgpu_vm_copy_ptes,<br>
-           TP_PROTO(uint64_t pe, uint64_t src, unsigned count),<br>
-           TP_ARGS(pe, src, count),<br>
+           TP_PROTO(uint64_t pe, uint64_t src, unsigned count, bool direct),<br>
+           TP_ARGS(pe, src, count, direct),<br>
             TP_STRUCT__entry(<br>
                              __field(u64, pe)<br>
                              __field(u64, src)<br>
                              __field(u32, count)<br>
+                            __field(bool, direct)<br>
                              ),<br>
 <br>
             TP_fast_assign(<br>
                            __entry->pe = pe;<br>
                            __entry->src = src;<br>
                            __entry->count = count;<br>
+                          __entry->direct = direct;<br>
                            ),<br>
-           TP_printk("pe=%010Lx, src=%010Lx, count=%u",<br>
-                     __entry->pe, __entry->src, __entry->count)<br>
+           TP_printk("pe=%010Lx, src=%010Lx, count=%u, direct=%d",<br>
+                     __entry->pe, __entry->src, __entry->count,<br>
+                     __entry->direct)<br>
 );<br>
 <br>
 TRACE_EVENT(amdgpu_vm_flush,<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c<br>
index a2daeadd770f..73fec7a0ced5 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c<br>
@@ -89,7 +89,7 @@ static int amdgpu_vm_cpu_update(struct amdgpu_vm_update_params *p,<br>
 <br>
         pe += (unsigned long)amdgpu_bo_kptr(bo);<br>
 <br>
-       trace_amdgpu_vm_set_ptes(pe, addr, count, incr, flags);<br>
+       trace_amdgpu_vm_set_ptes(pe, addr, count, incr, flags, p->direct);<br>
 <br>
         for (i = 0; i < count; i++) {<br>
                 value = p->pages_addr ?<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c<br>
index 38c966cedc26..e8db1467a71d 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c<br>
@@ -143,7 +143,7 @@ static void amdgpu_vm_sdma_copy_ptes(struct amdgpu_vm_update_params *p,<br>
         src += p->num_dw_left * 4;<br>
 <br>
         pe += amdgpu_bo_gpu_offset(bo);<br>
-       trace_amdgpu_vm_copy_ptes(pe, src, count);<br>
+       trace_amdgpu_vm_copy_ptes(pe, src, count, p->direct);<br>
 <br>
         amdgpu_vm_copy_pte(p->adev, ib, pe, src, count);<br>
 }<br>
@@ -170,7 +170,7 @@ static void amdgpu_vm_sdma_set_ptes(struct amdgpu_vm_update_params *p,<br>
         struct amdgpu_ib *ib = p->job->ibs;<br>
 <br>
         pe += amdgpu_bo_gpu_offset(bo);<br>
-       trace_amdgpu_vm_set_ptes(pe, addr, count, incr, flags);<br>
+       trace_amdgpu_vm_set_ptes(pe, addr, count, incr, flags, p->direct);<br>
         if (count < 3) {<br>
                 amdgpu_vm_write_pte(p->adev, ib, pe, addr | flags,<br>
                                     count, incr);<br>
-- <br>
2.17.1<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a></div>
</span></font></div>
</body>
</html>