aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/0458-drm-amd-amdgpu-Enable-ability-to-print-register-stat.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/files/0458-drm-amd-amdgpu-Enable-ability-to-print-register-stat.patch')
-rw-r--r--common/recipes-kernel/linux/files/0458-drm-amd-amdgpu-Enable-ability-to-print-register-stat.patch91
1 files changed, 91 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/files/0458-drm-amd-amdgpu-Enable-ability-to-print-register-stat.patch b/common/recipes-kernel/linux/files/0458-drm-amd-amdgpu-Enable-ability-to-print-register-stat.patch
new file mode 100644
index 00000000..a2e6a8f1
--- /dev/null
+++ b/common/recipes-kernel/linux/files/0458-drm-amd-amdgpu-Enable-ability-to-print-register-stat.patch
@@ -0,0 +1,91 @@
+From 0f09539c772af43949b4358c6b45fe30a9b14861 Mon Sep 17 00:00:00 2001
+From: Tom St Denis <tom.stdenis@amd.com>
+Date: Mon, 28 Mar 2016 08:21:52 -0400
+Subject: [PATCH 0458/1110] drm/amd/amdgpu: Enable ability to print register
+ status
+
+Added file "amdgpu_print_status" to debugfs and you can
+cat it to have the dmesg log populated with register values
+from various IP blocks.
+
+Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
+Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 42 ++++++++++++++++++++++++++++++
+ 1 file changed, 42 insertions(+)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+index 9663d17..f03fa47 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+@@ -47,6 +47,8 @@
+
+ static int amdgpu_debugfs_regs_init(struct amdgpu_device *adev);
+ static void amdgpu_debugfs_regs_cleanup(struct amdgpu_device *adev);
++static int amdgpu_debugfs_status_init(struct amdgpu_device *adev);
++
+
+ static const char *amdgpu_asic_name[] = {
+ "BONAIRE",
+@@ -1110,6 +1112,15 @@ const struct amdgpu_ip_block_version * amdgpu_get_ip_block(
+ return NULL;
+ }
+
++void amdgpu_print_status(struct amdgpu_device *adev)
++{
++ int i;
++
++ for (i = 0; i < adev->num_ip_blocks; i++)
++ if (adev->ip_blocks[i].funcs->print_status)
++ adev->ip_blocks[i].funcs->print_status(adev);
++}
++
+ /**
+ * amdgpu_ip_block_version_cmp
+ *
+@@ -1258,6 +1269,8 @@ static int amdgpu_init(struct amdgpu_device *adev)
+ adev->ip_block_status[i].hw = true;
+ }
+
++ amdgpu_debugfs_status_init(adev);
++
+ return 0;
+ }
+
+@@ -2162,3 +2175,32 @@ static int amdgpu_debugfs_regs_init(struct amdgpu_device *adev)
+ }
+ static void amdgpu_debugfs_regs_cleanup(struct amdgpu_device *adev) { }
+ #endif
++
++/*
++ * Status debugfs
++ */
++#if defined(CONFIG_DEBUG_FS)
++static int amdgpu_debugfs_print_status(struct seq_file *m, void *data)
++{
++ struct drm_info_node *node = (struct drm_info_node *)m->private;
++ struct drm_device *dev = node->minor->dev;
++ struct amdgpu_device *adev = dev->dev_private;
++
++ amdgpu_print_status(adev);
++
++ return 0;
++}
++
++static struct drm_info_list amdgpu_debugfs_status_list[] = {
++ {"amdgpu_print_status", &amdgpu_debugfs_print_status, 0, NULL},
++};
++#endif
++
++static int amdgpu_debugfs_status_init(struct amdgpu_device *adev)
++{
++#if defined(CONFIG_DEBUG_FS)
++ return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_status_list, 1);
++#else
++ return 0;
++#endif
++}
+--
+2.7.4
+