Skip to contentSkip to conversation

drm/amdgpu: cleanup debugfs handling a bit

PATCH In review Christian König 2 participants 3 messages Dec 7, 2017 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm/amdgpu: cleanup debugfs handling a bit

Remove the superflous .debugfs_init callback and register all files in amdgpu_device.c in just one function.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h        |  5 ----
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 46 +++++++-----------------------
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c    |  3 --
 3 files changed, 11 insertions(+), 43 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +0 -5
index c56a986a4be2..7db9a7fa15a8 100644
@@ -1250,11 +1250,6 @@ int amdgpu_debugfs_add_files(struct amdgpu_device *adev,
 			     const struct drm_info_list *files,
 			     unsigned nfiles);
 int amdgpu_debugfs_fence_init(struct amdgpu_device *adev);
-
-#if defined(CONFIG_DEBUG_FS)
-int amdgpu_debugfs_init(struct drm_minor *minor);
-#endif
-
 int amdgpu_debugfs_firmware_init(struct amdgpu_device *adev);
 
 /*
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +11 -35

85 lines not on this page · raw message

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -3
index 31383e004947..cb4e90adc280 100644
@@ -850,9 +850,6 @@ static struct drm_driver kms_driver = {
 	.disable_vblank = amdgpu_disable_vblank_kms,
 	.get_vblank_timestamp = drm_calc_vbltimestamp_from_scanoutpos,
 	.get_scanout_position = amdgpu_get_crtc_scanout_position,
-#if defined(CONFIG_DEBUG_FS)
-	.debugfs_init = amdgpu_debugfs_init,
-#endif
 	.irq_preinstall = amdgpu_irq_preinstall,
 	.irq_postinstall = amdgpu_irq_postinstall,
 	.irq_uninstall = amdgpu_irq_uninstall,
Signature · 6 lines
2.11.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20171207153816.1795-1-christian.koenig-5C7GfCeVMHo@public.gmane.org

#2 lore raw

PATCH 2/2 drm/amdgpu: add amdgpu_evict_vram debugfs file

Torture test for MM and VM support, can be used to evict all VRAM while the system is under load.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +12 -1
index 975e821617b1..a9bca0d5fefe 100644
@@ -3970,9 +3970,20 @@ static int amdgpu_debugfs_get_vbios_dump(struct seq_file *m, void *data)
 	return 0;
 }
 
+static int amdgpu_debugfs_evict_vram(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;
+
+	seq_printf(m, "(%d)\n", amdgpu_bo_evict_vram(adev));
+	return 0;
+}
+
 static const struct drm_info_list amdgpu_debugfs_list[] = {
 	{"amdgpu_vbios", amdgpu_debugfs_get_vbios_dump},
-	{"amdgpu_test_ib", &amdgpu_debugfs_test_ib}
+	{"amdgpu_test_ib", &amdgpu_debugfs_test_ib},
+	{"amdgpu_evict_vram", &amdgpu_debugfs_evict_vram}
 };
 
 static int amdgpu_debugfs_init(struct amdgpu_device *adev)
Signature · 6 lines
2.11.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20171207153816.1795-2-christian.koenig-5C7GfCeVMHo@public.gmane.org

Reviewed-by
#4 lore raw

Re: [PATCH 2/2] drm/amdgpu: add amdgpu_evict_vram debugfs file

Quoted 4 lines · Christian König

Torture test for MM and VM support, can be used to evict all VRAM while the system is under load.

Series is:

Quoted 33 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +12 -2
index 975e821617b1..a9bca0d5fefe 100644
@@ -3970,9 +3970,20 @@ static int amdgpu_debugfs_get_vbios_dump(struct seq_file *m, void *data)
        return 0;
 }
 
+static int amdgpu_debugfs_evict_vram(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;
+
+       seq_printf(m, "(%d)\n", amdgpu_bo_evict_vram(adev));
+       return 0;
+}
+
 static const struct drm_info_list amdgpu_debugfs_list[] = {
        {"amdgpu_vbios", amdgpu_debugfs_get_vbios_dump},
-       {"amdgpu_test_ib", &amdgpu_debugfs_test_ib}
+       {"amdgpu_test_ib", &amdgpu_debugfs_test_ib},
+       {"amdgpu_evict_vram", &amdgpu_debugfs_evict_vram}
 };
 
 static int amdgpu_debugfs_init(struct amdgpu_device *adev)
--

2.11.0

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx