Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ghimiray, Himal Prasad" <himal.prasad.ghimiray@intel.com>
To: Tejas Upadhyay <tejas.upadhyay@intel.com>,
	<intel-xe@lists.freedesktop.org>
Subject: Re: [Intel-xe] [PATCH 2/7] drm/xe: Interface xe drm client with fdinfo interface
Date: Wed, 6 Sep 2023 09:51:52 +0530	[thread overview]
Message-ID: <5d05faa2-ea15-430e-80ee-e851cb2d2e9d@intel.com> (raw)
In-Reply-To: <20230831090536.2949934-3-tejas.upadhyay@intel.com>


On 31-08-2023 14:35, Tejas Upadhyay wrote:
> DRM core driver has introduced recently fdinfo interface to
> show memory stats of individual drm client. Lets interface
> xe drm client to fdinfo interface.
>
> Signed-off-by: Tejas Upadhyay <tejas.upadhyay@intel.com>
> ---
>   drivers/gpu/drm/xe/xe_device.c     |  4 ++++
>   drivers/gpu/drm/xe/xe_drm_client.c | 17 +++++++++++++++++
>   drivers/gpu/drm/xe/xe_drm_client.h |  4 +++-
>   3 files changed, 24 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
> index cf59c7b74eaf..1aae352a982c 100644
> --- a/drivers/gpu/drm/xe/xe_device.c
> +++ b/drivers/gpu/drm/xe/xe_device.c
> @@ -138,6 +138,9 @@ static const struct file_operations xe_driver_fops = {
>   	.read = drm_read,
>   	.compat_ioctl = drm_compat_ioctl,
>   	.llseek = noop_llseek,
> +#ifdef CONFIG_PROC_FS
> +	.show_fdinfo = drm_show_fdinfo,
> +#endif
>   };
>   
>   static void xe_driver_release(struct drm_device *dev)
> @@ -162,6 +165,7 @@ static struct drm_driver driver = {
>   
>   	.dumb_create = xe_bo_dumb_create,
>   	.dumb_map_offset = drm_gem_ttm_dumb_map_offset,
> +	.show_fdinfo = PTR_IF(IS_ENABLED(CONFIG_PROC_FS), xe_drm_client_fdinfo),
>   	.release = &xe_driver_release,
>   
>   	.ioctls = xe_ioctls,
> diff --git a/drivers/gpu/drm/xe/xe_drm_client.c b/drivers/gpu/drm/xe/xe_drm_client.c
> index ea7993338076..b5dc024b5dd0 100644
> --- a/drivers/gpu/drm/xe/xe_drm_client.c
> +++ b/drivers/gpu/drm/xe/xe_drm_client.c
> @@ -50,3 +50,20 @@ void __xe_drm_client_free(struct kref *kref)
>   
>   	kfree(client);
>   }
> +
> +#ifdef CONFIG_PROC_FS
> +/**
> + * xe_drm_client_fdinfo() - Callback for fdinfo interface
> + * @p: The drm_printer ptr
> + * @file: The drm_file ptr
> + *
> + * This is callabck for drm fdinfo interface. Register this callback
> + * in drm driver ops for show_fdinfo.
> + *
> + * Return: void
> + */
> +void xe_drm_client_fdinfo(struct drm_printer *p, struct drm_file *file)
> +{
> +	/* show_meminfo() will be developed here */
> +}
> +#endif

LGTM.

Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>

> diff --git a/drivers/gpu/drm/xe/xe_drm_client.h b/drivers/gpu/drm/xe/xe_drm_client.h
> index be097cdf5d12..dbe3a083c9df 100644
> --- a/drivers/gpu/drm/xe/xe_drm_client.h
> +++ b/drivers/gpu/drm/xe/xe_drm_client.h
> @@ -39,5 +39,7 @@ struct xe_drm_client *xe_drm_client_alloc(void);
>   static inline struct xe_drm_client *
>   xe_drm_client_get(struct xe_drm_client *client);
>   static inline void xe_drm_client_put(struct xe_drm_client *client);
> -
> +#ifdef CONFIG_PROC_FS
> +void xe_drm_client_fdinfo(struct drm_printer *p, struct drm_file *file);
> +#endif
>   #endif

  reply	other threads:[~2023-09-06  4:22 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-31  9:05 [Intel-xe] [PATCH 0/7] drm/xe: fdinfo memory stats Tejas Upadhyay
2023-08-31  9:05 ` [Intel-xe] [PATCH 1/7] drm/xe: Add drm-client infrastructure Tejas Upadhyay
2023-09-06  4:14   ` Ghimiray, Himal Prasad
2023-09-07  8:57     ` Upadhyay, Tejas
2023-09-12  8:24       ` Ghimiray, Himal Prasad
2023-08-31  9:05 ` [Intel-xe] [PATCH 2/7] drm/xe: Interface xe drm client with fdinfo interface Tejas Upadhyay
2023-09-06  4:21   ` Ghimiray, Himal Prasad [this message]
2023-08-31  9:05 ` [Intel-xe] [PATCH 3/7] drm/xe: Add tracking support for bos per client Tejas Upadhyay
2023-09-06  9:38   ` Ghimiray, Himal Prasad
2023-09-07  8:52     ` Upadhyay, Tejas
2023-08-31  9:05 ` [Intel-xe] [PATCH 4/7] drm/xe: Record each drm client with its VM Tejas Upadhyay
2023-09-06  9:47   ` Ghimiray, Himal Prasad
2023-09-07  8:49     ` Upadhyay, Tejas
2023-09-07  9:28       ` Ghimiray, Himal Prasad
2023-09-07  9:44         ` Upadhyay, Tejas
2023-08-31  9:05 ` [Intel-xe] [PATCH 5/7] drm/xe: Track page table memory usage for client Tejas Upadhyay
2023-09-06  9:54   ` Ghimiray, Himal Prasad
2023-09-07  8:40     ` Upadhyay, Tejas
2023-08-31  9:05 ` [Intel-xe] [PATCH 6/7] drm/xe: Account ring buffer and context state storage Tejas Upadhyay
2023-09-06 11:19   ` Ghimiray, Himal Prasad
2023-08-31  9:05 ` [Intel-xe] [PATCH 7/7] drm/xe: Implement fdinfo memory stats printing Tejas Upadhyay
2023-08-31 12:19   ` Upadhyay, Tejas
2023-09-12  6:22   ` Ghimiray, Himal Prasad
2023-09-12 11:14     ` Jani Nikula
2023-08-31  9:21 ` [Intel-xe] ✓ CI.Patch_applied: success for drm/xe: fdinfo memory stats Patchwork
2023-08-31  9:21 ` [Intel-xe] ✗ CI.checkpatch: warning " Patchwork
2023-08-31  9:22 ` [Intel-xe] ✓ CI.KUnit: success " Patchwork
2023-08-31  9:29 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-08-31  9:30 ` [Intel-xe] ✗ CI.Hooks: failure " Patchwork
2023-08-31  9:30 ` [Intel-xe] ✗ CI.checksparse: warning " Patchwork
2023-08-31 10:04 ` [Intel-xe] ✓ CI.BAT: success " Patchwork
2023-08-31 11:23 ` Patchwork
2023-09-07  9:22 ` [Intel-xe] [PATCH 0/7] " Ghimiray, Himal Prasad
2023-09-07  9:35   ` Upadhyay, Tejas

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=5d05faa2-ea15-430e-80ee-e851cb2d2e9d@intel.com \
    --to=himal.prasad.ghimiray@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=tejas.upadhyay@intel.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