lede/target/linux/bcm27xx/patches-6.12/950-0630-drm-vc4-Add-hvs_dlist_allocs-debugfs-function.patch
=?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= d81c03f05e bcm27xx: add 6.12 patches from RPi repo
These patches were generated from:
https://github.com/raspberrypi/linux/commits/rpi-6.12.y
With the following command:
git format-patch -N v6.12.27..HEAD
(HEAD -> 8d3206ee456a5ecdf9ddbfd8e5e231e4f0cd716e)

Exceptions:
- (def)configs patches
- github workflows patches
- applied & reverted patches
- readme patches
- wireless patches

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-06-20 17:01:06 +08:00

62 lines
2.0 KiB
Diff

From 7e1bbe35681bf00c5a8f0b0875b542c4b4664a6b Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
Date: Fri, 27 Oct 2023 16:46:04 +0100
Subject: [PATCH] drm/vc4: Add hvs_dlist_allocs debugfs function.
Users are reporting running out of DLIST memory. Add a
debugfs file to dump out all the allocations.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
drivers/gpu/drm/vc4/vc4_hvs.c | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
--- a/drivers/gpu/drm/vc4/vc4_hvs.c
+++ b/drivers/gpu/drm/vc4/vc4_hvs.c
@@ -349,6 +349,36 @@ static int vc6_hvs_debugfs_upm_allocs(st
return 0;
}
+static int vc4_hvs_debugfs_dlist_allocs(struct seq_file *m, void *data)
+{
+ struct drm_debugfs_entry *entry = m->private;
+ struct drm_device *dev = entry->dev;
+ struct vc4_dev *vc4 = to_vc4_dev(dev);
+ struct vc4_hvs *hvs = vc4->hvs;
+ struct drm_printer p = drm_seq_file_printer(m);
+ struct vc4_hvs_dlist_allocation *cur, *next;
+ struct drm_mm_node *mm_node;
+ unsigned long flags;
+
+ spin_lock_irqsave(&hvs->mm_lock, flags);
+
+ drm_printf(&p, "Allocated nodes:\n");
+ list_for_each_entry(mm_node, drm_mm_nodes(&hvs->dlist_mm), node_list) {
+ drm_printf(&p, "node [%08llx + %08llx]\n", mm_node->start, mm_node->size);
+ }
+
+ drm_printf(&p, "Stale nodes:\n");
+ list_for_each_entry_safe(cur, next, &hvs->stale_dlist_entries, node) {
+ drm_printf(&p, "node [%08llx + %08llx] channel %u frcnt %u\n",
+ cur->mm_node.start, cur->mm_node.size, cur->channel,
+ cur->target_frame_count);
+ }
+
+ spin_unlock_irqrestore(&hvs->mm_lock, flags);
+
+ return 0;
+}
+
/* The filter kernel is composed of dwords each containing 3 9-bit
* signed integers packed next to each other.
*/
@@ -1478,6 +1508,8 @@ int vc4_hvs_debugfs_init(struct drm_mino
drm_debugfs_add_file(drm, "hvs_underrun", vc4_hvs_debugfs_underrun, NULL);
+ drm_debugfs_add_file(drm, "hvs_dlist_allocs", vc4_hvs_debugfs_dlist_allocs, NULL);
+
vc4_debugfs_add_regset32(drm, "hvs_regs", &hvs->regset);
return 0;