From 1543e317f1da31b75942316931e8f491a8920811 Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Thu, 04 Jan 2024 10:08:02 +0000
Subject: [PATCH] disable FB
---
kernel/drivers/gpu/arm/bifrost/mali_kbase_gpu_memory_debugfs.c | 27 +++++++++++++++++----------
1 files changed, 17 insertions(+), 10 deletions(-)
diff --git a/kernel/drivers/gpu/arm/bifrost/mali_kbase_gpu_memory_debugfs.c b/kernel/drivers/gpu/arm/bifrost/mali_kbase_gpu_memory_debugfs.c
index cb372ea..bf5f259 100644
--- a/kernel/drivers/gpu/arm/bifrost/mali_kbase_gpu_memory_debugfs.c
+++ b/kernel/drivers/gpu/arm/bifrost/mali_kbase_gpu_memory_debugfs.c
@@ -48,18 +48,30 @@
kbdev = list_entry(entry, struct kbase_device, entry);
/* output the total memory usage and cap for this device */
+ seq_printf(sfile, "<dev> <pages>\n");
seq_printf(sfile, "%-16s %10u\n",
kbdev->devname,
atomic_read(&(kbdev->memdev.used_pages)));
mutex_lock(&kbdev->kctx_list_lock);
+ seq_printf(sfile, " <kctx> <comm> <pid> <pages>\n");
list_for_each_entry(kctx, &kbdev->kctx_list, kctx_list_link) {
+ struct pid *pid_struct;
+ struct task_struct *task;
+
+ rcu_read_lock();
+ pid_struct = find_get_pid(kctx->tgid);
+ task = pid_task(pid_struct, PIDTYPE_PID);
/* output the memory usage and cap for each kctx
- * opened on this device
- */
- seq_printf(sfile, " %s-0x%pK %10u\n",
+ * opened on this device
+ */
+ seq_printf(sfile, " %s-0x%pK %-20s %-10d %10u\n",
"kctx",
kctx,
+ task ? task->comm : "[null comm]",
+ kctx->tgid,
atomic_read(&(kctx->used_pages)));
+ put_pid(pid_struct);
+ rcu_read_unlock();
}
mutex_unlock(&kbdev->kctx_list_lock);
}
@@ -88,18 +100,13 @@
*/
void kbasep_gpu_memory_debugfs_init(struct kbase_device *kbdev)
{
- debugfs_create_file("gpu_memory", S_IRUGO,
+ debugfs_create_file("gpu_memory", 0444,
kbdev->mali_debugfs_directory, NULL,
&kbasep_gpu_memory_debugfs_fops);
- return;
}
-
#else
/*
* Stub functions for when debugfs is disabled
*/
-void kbasep_gpu_memory_debugfs_init(struct kbase_device *kbdev)
-{
- return;
-}
+void kbasep_gpu_memory_debugfs_init(struct kbase_device *kbdev) {}
#endif
--
Gitblit v1.6.2