From: Daniel Vetter <daniel@ffwll.ch>
To: Boris Brezillon <boris.brezillon@collabora.com>
Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>,
Christopher Healy <healych@amazon.com>,
dri-devel@lists.freedesktop.org,
Steven Price <steven.price@arm.com>,
Rob Herring <robh+dt@kernel.org>,
Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>,
Robin Murphy <robin.murphy@arm.com>
Subject: Re: [PATCH RFC 1/4] drm/panfrost: Provide a dummy show_fdinfo() implementation
Date: Thu, 5 Jan 2023 16:31:49 +0100 [thread overview]
Message-ID: <Y7btZUve7rDA/ctq@phenom.ffwll.local> (raw)
In-Reply-To: <20230104130308.3467806-2-boris.brezillon@collabora.com>
On Wed, Jan 04, 2023 at 02:03:05PM +0100, Boris Brezillon wrote:
> Provide a dummy show_fdinfo() implementation exposing drm-driver and
> drm-client-id. More stats will be added soon.
>
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> ---
> drivers/gpu/drm/panfrost/panfrost_drv.c | 17 ++++++++++++++++-
> 1 file changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c
> index 2fa5afe21288..6ee43559fc14 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_drv.c
> +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c
> @@ -515,7 +515,22 @@ static const struct drm_ioctl_desc panfrost_drm_driver_ioctls[] = {
> PANFROST_IOCTL(MADVISE, madvise, DRM_RENDER_ALLOW),
> };
>
> -DEFINE_DRM_GEM_FOPS(panfrost_drm_driver_fops);
> +static void panfrost_show_fdinfo(struct seq_file *m, struct file *f)
> +{
> + struct drm_file *file = f->private_data;
> + struct panfrost_file_priv *panfrost_priv = file->driver_priv;
> +
> + seq_printf(m, "drm-driver:\t%s\n", file->minor->dev->driver->name);
> + seq_printf(m, "drm-client-id:\t%llu\n", panfrost_priv->sched_entity[0].fence_context);
I think at this point we really need to not just have a document that says
what this should look like, but drm infrastructure with shared code.
Drivers all inventing their fdinfo really doesn't seem like a great idea
to me.
-Daniel
> +}
> +
> +static const struct file_operations panfrost_drm_driver_fops = {
> + .owner = THIS_MODULE,
> + DRM_GEM_FOPS,
> +#ifdef CONFIG_PROC_FS
> + .show_fdinfo = panfrost_show_fdinfo,
> +#endif
> +};
>
> /*
> * Panfrost driver version:
> --
> 2.38.1
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
next prev parent reply other threads:[~2023-01-05 15:31 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-04 13:03 [PATCH RFC 0/4] drm/panfrost: Expose memory usage stats through fdinfo Boris Brezillon
2023-01-04 13:03 ` [PATCH RFC 1/4] drm/panfrost: Provide a dummy show_fdinfo() implementation Boris Brezillon
2023-01-05 15:31 ` Daniel Vetter [this message]
2023-01-09 8:34 ` Boris Brezillon
2023-01-09 10:17 ` Daniel Vetter
2023-01-09 10:44 ` Boris Brezillon
2023-01-04 13:03 ` [PATCH RFC 2/4] drm/panfrost: Track BO resident size Boris Brezillon
2023-01-04 13:03 ` [PATCH RFC 3/4] drm/panfrost: Add a helper to retrieve MMU context stats Boris Brezillon
2023-01-04 13:03 ` [PATCH RFC 4/4] drm/panfrost: Expose some memory related stats through fdinfo Boris Brezillon
2023-01-23 11:18 ` Tvrtko Ursulin
2023-01-16 10:30 ` [PATCH RFC 0/4] drm/panfrost: Expose memory usage " Steven Price
2023-01-16 11:05 ` Boris Brezillon
2023-01-16 12:21 ` Steven Price
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=Y7btZUve7rDA/ctq@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=alyssa.rosenzweig@collabora.com \
--cc=boris.brezillon@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=healych@amazon.com \
--cc=robh+dt@kernel.org \
--cc=robin.murphy@arm.com \
--cc=steven.price@arm.com \
--cc=tomeu.vizoso@collabora.com \
/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