lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250316215139.3940623-5-adrian.larumbe@collabora.com>
Date: Sun, 16 Mar 2025 21:51:35 +0000
From: Adrián Larumbe <adrian.larumbe@...labora.com>
To: Boris Brezillon <boris.brezillon@...labora.com>,
	Steven Price <steven.price@....com>,
	Liviu Dudau <liviu.dudau@....com>,
	Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
	Maxime Ripard <mripard@...nel.org>,
	Thomas Zimmermann <tzimmermann@...e.de>,
	David Airlie <airlied@...il.com>,
	Simona Vetter <simona@...ll.ch>
Cc: kernel@...labora.com,
	Adrián Larumbe <adrian.larumbe@...labora.com>,
	dri-devel@...ts.freedesktop.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH 4/4] drm/panthor: Display heap chunk entries in DebugFS GEMS file

Expand the driver's DebugFS GEMS file to display entries for the heap
chunks' GEM objects, both those allocated at heap creation time through an
ioctl(), or in response to a tiler OOM event.

Signed-off-by: Adrián Larumbe <adrian.larumbe@...labora.com>
---
 drivers/gpu/drm/panthor/panthor_heap.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/gpu/drm/panthor/panthor_heap.c b/drivers/gpu/drm/panthor/panthor_heap.c
index db0285ce5812..520d1fcf5c36 100644
--- a/drivers/gpu/drm/panthor/panthor_heap.c
+++ b/drivers/gpu/drm/panthor/panthor_heap.c
@@ -139,6 +139,10 @@ static int panthor_alloc_heap_chunk(struct panthor_device *ptdev,
 	struct panthor_heap_chunk *chunk;
 	struct panthor_heap_chunk_header *hdr;
 	int ret;
+#ifdef CONFIG_DEBUG_FS
+	struct panthor_gem_object *obj;
+	const char *label;
+#endif
 
 	chunk = kmalloc(sizeof(*chunk), GFP_KERNEL);
 	if (!chunk)
@@ -180,6 +184,17 @@ static int panthor_alloc_heap_chunk(struct panthor_device *ptdev,
 	heap->chunk_count++;
 	mutex_unlock(&heap->lock);
 
+#ifdef CONFIG_DEBUG_FS
+	obj = to_panthor_bo(chunk->bo->obj);
+
+	mutex_lock(&ptdev->gems_lock);
+	list_add_tail(&obj->gems_node, &ptdev->gems);
+	mutex_unlock(&ptdev->gems_lock);
+
+	label = kstrdup_const("\"Tiler heap chunk\"", GFP_KERNEL);
+	panthor_gem_label_bo(chunk->bo->obj, label);
+#endif
+
 	return 0;
 
 err_destroy_bo:
-- 
2.48.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ