public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@collabora.com>
To: "Adrián Larumbe" <adrian.larumbe@collabora.com>
Cc: Steven Price <steven.price@arm.com>,
	Liviu Dudau <liviu.dudau@arm.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	kernel@collabora.com, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/4] drm/panthor: Display heap chunk entries in DebugFS GEMS file
Date: Wed, 19 Mar 2025 17:39:03 +0100	[thread overview]
Message-ID: <20250319173903.5e8a9479@collabora.com> (raw)
In-Reply-To: <hvbohkjfpsahl4kzildhy6nekiz3a4mxp7bwova6z45ibpwl6r@7t7wbwmuw6mc>

On Wed, 19 Mar 2025 13:18:53 +0000
Adrián Larumbe <adrian.larumbe@collabora.com> wrote:

> On 17.03.2025 09:31, Boris Brezillon wrote:
> > On Sun, 16 Mar 2025 21:51:35 +0000
> > Adrián Larumbe <adrian.larumbe@collabora.com> wrote:
> >  
> > > 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@collabora.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);  
> >
> > Do we really need the extra quotes around 'Tiler heap chunk'?  
> 
> We want them quoted like this so that the BO name can be told apart from the
> the extra tagging information (like modifiers) and any suffix sent down from gl

Feels like you want the kernel to use a format that's used by mesa but
not really standardized. What happens if we decide to change the
formatting there? Suddenly, kernel BOs become the outliers again, and
you're back to the inconsistency you were trying to avoid. My
recommendation would be to keep kernel BO labels simple (just a regular
string, no quoting, no extra props) and let the debugfs printer
segregate kernel BOs from user BOs to make the distinction clear.

      reply	other threads:[~2025-03-19 16:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-16 21:51 [PATCH 0/4] Panthor BO tagging and GEMS debug display Adrián Larumbe
2025-03-16 21:51 ` [PATCH 1/4] drm/panthor: Introduce BO labeling Adrián Larumbe
2025-03-17  7:45   ` Boris Brezillon
2025-03-16 21:51 ` [PATCH 2/4] drm/panthor: Add driver IOCTL for setting BO labels Adrián Larumbe
2025-03-17  7:50   ` Boris Brezillon
2025-03-19 13:49     ` Adrián Larumbe
2025-03-19 16:28       ` Boris Brezillon
2025-03-17  7:54   ` Boris Brezillon
2025-03-16 21:51 ` [PATCH 3/4] drm/panthor: show device-wide list of DRM GEM objects over DebugFS Adrián Larumbe
2025-03-17  8:26   ` Boris Brezillon
2025-03-16 21:51 ` [PATCH 4/4] drm/panthor: Display heap chunk entries in DebugFS GEMS file Adrián Larumbe
2025-03-17  8:31   ` Boris Brezillon
2025-03-19 13:18     ` Adrián Larumbe
2025-03-19 16:39       ` Boris Brezillon [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250319173903.5e8a9479@collabora.com \
    --to=boris.brezillon@collabora.com \
    --cc=adrian.larumbe@collabora.com \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liviu.dudau@arm.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=steven.price@arm.com \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox