All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sunil Khatri <sunil.khatri@amd.com>
To: "Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>
Cc: amd-gfx@lists.freedesktop.org, Sunil Khatri <sunil.khatri@amd.com>
Subject: [PATCH v5 4/6] drm/amdgpu: add support for gfx v10 print
Date: Wed, 17 Apr 2024 15:08:07 +0530	[thread overview]
Message-ID: <20240417093809.168002-4-sunil.khatri@amd.com> (raw)
In-Reply-To: <20240417093809.168002-1-sunil.khatri@amd.com>

Add support to print ip information to be
used to print registers in devcoredump
buffer.

Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
---
 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 ceeeafef668c..9b0b8ce5f5e5 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
@@ -9267,6 +9267,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, "%-50s \t 0x%08x\n",
+			   gc_reg_list_10_1[i].reg_name,
+			   adev->gfx.ip_dump[i]);
+}
+
 static void gfx_v10_ip_dump(void *handle)
 {
 	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
@@ -9299,7 +9314,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


  parent reply	other threads:[~2024-04-17  9:38 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-17  9:38 [PATCH v5 1/6] drm/amdgpu: add prototype for ip dump Sunil Khatri
2024-04-17  9:38 ` [PATCH v5 2/6] drm/amdgpu: add support of gfx10 register dump Sunil Khatri
2024-04-17 15:51   ` Alex Deucher
2024-04-17 16:01     ` Lazar, Lijo
2024-04-17 16:11       ` Khatri, Sunil
2024-04-17 16:23         ` Lazar, Lijo
2024-04-17 16:51           ` Alex Deucher
2024-04-17 17:01             ` Khatri, Sunil
2024-04-17 17:30               ` Alex Deucher
2024-04-18  6:12                 ` Christian König
2024-04-17  9:38 ` [PATCH v5 3/6] drm/amdgpu: add protype for print ip state Sunil Khatri
2024-04-17 15:48   ` Alex Deucher
2024-04-17  9:38 ` Sunil Khatri [this message]
2024-04-17 15:52   ` [PATCH v5 4/6] drm/amdgpu: add support for gfx v10 print Alex Deucher
2024-04-17  9:38 ` [PATCH v5 5/6] drm/amdgpu: dump ip state before reset for each ip Sunil Khatri
2024-04-17 15:52   ` Alex Deucher
2024-04-17  9:38 ` [PATCH v5 6/6] drm/amdgpu: add ip dump for each ip in devcoredump Sunil Khatri
2024-04-17 15:53   ` Alex Deucher
2024-04-17 15:45 ` [PATCH v5 1/6] drm/amdgpu: add prototype for ip dump Alex Deucher
2024-04-18  8:45   ` Christian König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240417093809.168002-4-sunil.khatri@amd.com \
    --to=sunil.khatri@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.