<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p><br>
</p>
<div class="moz-cite-prefix">On 4/16/2024 7:27 PM, Alex Deucher
wrote:<br>
</div>
<blockquote type="cite" cite="mid:CADnq5_ODDOi4vOXyH7m1J3DJ54+PG__K0vzm8fQ=TT0vPTQX4w@mail.gmail.com">
<pre class="moz-quote-pre" wrap="">On Tue, Apr 16, 2024 at 8:08 AM Sunil Khatri <a class="moz-txt-link-rfc2396E" href="mailto:sunil.khatri@amd.com"><sunil.khatri@amd.com></a> wrote:
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">
Add support to print ip information to be
used to print registers in devcoredump
buffer.
Signed-off-by: Sunil Khatri <a class="moz-txt-link-rfc2396E" href="mailto:sunil.khatri@amd.com"><sunil.khatri@amd.com></a>
---
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
index 822bee932041..a7c2a3ddd613 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
@@ -9268,6 +9268,21 @@ static void gfx_v10_0_emit_mem_sync(struct amdgpu_ring *ring)
amdgpu_ring_write(ring, gcr_cntl); /* GCR_CNTL */
}
+static void gfx_v10_ip_print(void *handle, struct drm_printer *p)
+{
+ struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+ uint32_t i;
+ uint32_t reg_count = ARRAY_SIZE(gc_reg_list_10_1);
+
+ if (!adev->gfx.ip_dump)
+ return;
+
+ for (i = 0; i < reg_count; i++)
+ drm_printf(p, "0x%04x \t 0x%08x\n",
+ adev->gfx.ip_dump[i].offset,
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
Print the name of the register rather than the offset here to make it
output easier to read. See my comments from patch 2.</pre>
</blockquote>
<p>Just register name and value is fine or we need the offset too. <br>
</p>
<p>Also i am assuming stringify the macro is good enough ?<br>
eg:<br>
</p>
<div style="color: #cccccc;background-color: #1f1f1f;font-family: Consolas, 'Courier New', monospace;font-weight: normal;font-size: 14px;line-height: 19px;white-space: pre;"><div><span style="color: #c586c0;">#define</span><span style="color: #569cd6;"> </span><span style="color: #569cd6;">mmGRBM_STATUS</span><span style="color: #569cd6;"> </span><span style="color: #b5cea8;">0x0da4</span></div><div><span style="color: #b5cea8;">so printing register name exactly like mmGRBM_STATUS is acceptable ? we dont need to remove mm as it makes it complicated.
</span></div></div>
<blockquote type="cite" cite="mid:CADnq5_ODDOi4vOXyH7m1J3DJ54+PG__K0vzm8fQ=TT0vPTQX4w@mail.gmail.com">
<pre class="moz-quote-pre" wrap="">
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">+ adev->gfx.ip_dump[i].value);
+}
+
static void gfx_v10_ip_dump(void *handle)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
@@ -9300,7 +9315,7 @@ static const struct amd_ip_funcs gfx_v10_0_ip_funcs = {
.set_powergating_state = gfx_v10_0_set_powergating_state,
.get_clockgating_state = gfx_v10_0_get_clockgating_state,
.dump_ip_state = gfx_v10_ip_dump,
- .print_ip_state = NULL,
+ .print_ip_state = gfx_v10_ip_print,
};
static const struct amdgpu_ring_funcs gfx_v10_0_ring_funcs_gfx = {
--
2.34.1
</pre>
</blockquote>
</blockquote>
</body>
</html>