Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "K V P, Satyanarayana" <satyanarayana.k.v.p@intel.com>
To: Michal Wajdeczko <michal.wajdeczko@intel.com>,
	<intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH v2 7/7] drm/xe/vf: Move VF CCS debugfs attribute
Date: Tue, 9 Sep 2025 13:53:57 +0530	[thread overview]
Message-ID: <7ce5cf51-f075-4b8d-820a-b5fe4d45f6c6@intel.com> (raw)
In-Reply-To: <20250908123025.747-8-michal.wajdeczko@intel.com>



On 08-09-2025 18:00, Michal Wajdeczko wrote:
> The VF CCS handling is per-device so its debugfs file should not
> be exposed on per-GT basis. Move it up to the device level.
> 
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Satyanarayana K V P <satyanarayana.k.v.p@intel.com>
> ---
>   drivers/gpu/drm/xe/xe_debugfs.c      |  3 +++
>   drivers/gpu/drm/xe/xe_gt_debugfs.c   | 39 ----------------------------
>   drivers/gpu/drm/xe/xe_sriov_vf.c     | 28 ++++++++++++++++++++
>   drivers/gpu/drm/xe/xe_sriov_vf.h     |  2 ++
>   drivers/gpu/drm/xe/xe_sriov_vf_ccs.c | 32 +++++++++++++++++++++++
>   drivers/gpu/drm/xe/xe_sriov_vf_ccs.h |  2 ++
>   6 files changed, 67 insertions(+), 39 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_debugfs.c b/drivers/gpu/drm/xe/xe_debugfs.c
> index 4b71570529a6..544d7d8460d9 100644
> --- a/drivers/gpu/drm/xe/xe_debugfs.c
> +++ b/drivers/gpu/drm/xe/xe_debugfs.c
> @@ -24,6 +24,7 @@
>   #include "xe_pxp_debugfs.h"
>   #include "xe_sriov.h"
>   #include "xe_sriov_pf.h"
> +#include "xe_sriov_vf.h"
>   #include "xe_step.h"
>   #include "xe_tile_debugfs.h"
>   #include "xe_wa.h"
> @@ -395,4 +396,6 @@ void xe_debugfs_register(struct xe_device *xe)
>   
>   	if (IS_SRIOV_PF(xe))
>   		xe_sriov_pf_debugfs_register(xe, root);
> +	else if (IS_SRIOV_VF(xe))
> +		xe_sriov_vf_debugfs_register(xe, root);
>   }
> diff --git a/drivers/gpu/drm/xe/xe_gt_debugfs.c b/drivers/gpu/drm/xe/xe_gt_debugfs.c
> index a9d960de0e5e..f253e2df4907 100644
> --- a/drivers/gpu/drm/xe/xe_gt_debugfs.c
> +++ b/drivers/gpu/drm/xe/xe_gt_debugfs.c
> @@ -124,33 +124,6 @@ static int powergate_info(struct xe_gt *gt, struct drm_printer *p)
>   	return ret;
>   }
>   
> -static int sa_info_vf_ccs(struct xe_gt *gt, struct drm_printer *p)
> -{
> -	struct xe_device *xe = gt_to_xe(gt);
> -	struct xe_sa_manager *bb_pool;
> -	enum xe_sriov_vf_ccs_rw_ctxs ctx_id;
> -
> -	if (!IS_VF_CCS_READY(gt_to_xe(gt)))
> -		return 0;
> -
> -	xe_pm_runtime_get(gt_to_xe(gt));
> -
> -	for_each_ccs_rw_ctx(ctx_id) {
> -		bb_pool = xe->sriov.vf.ccs.contexts[ctx_id].mem.ccs_bb_pool;
> -		if (!bb_pool)
> -			break;
> -
> -		drm_printf(p, "ccs %s bb suballoc info\n", ctx_id ? "write" : "read");
> -		drm_printf(p, "-------------------------\n");
> -		drm_suballoc_dump_debug_info(&bb_pool->base, p, xe_sa_manager_gpu_addr(bb_pool));
> -		drm_puts(p, "\n");
> -	}
> -
> -	xe_pm_runtime_put(gt_to_xe(gt));
> -
> -	return 0;
> -}
> -
>   static int topology(struct xe_gt *gt, struct drm_printer *p)
>   {
>   	xe_pm_runtime_get(gt_to_xe(gt));
> @@ -318,13 +291,6 @@ static const struct drm_info_list vf_safe_debugfs_list[] = {
>   	{"hwconfig", .show = xe_gt_debugfs_simple_show, .data = hwconfig},
>   };
>   
> -/*
> - * only for GT debugfs files which are valid on VF. Not valid on PF.
> - */
> -static const struct drm_info_list vf_only_debugfs_list[] = {
> -	{"sa_info_vf_ccs", .show = xe_gt_debugfs_simple_show, .data = sa_info_vf_ccs},
> -};
> -
>   /* everything else should be added here */
>   static const struct drm_info_list pf_only_debugfs_list[] = {
>   	{"hw_engines", .show = xe_gt_debugfs_simple_show, .data = hw_engines},
> @@ -465,11 +431,6 @@ void xe_gt_debugfs_register(struct xe_gt *gt)
>   		drm_debugfs_create_files(pf_only_debugfs_list,
>   					 ARRAY_SIZE(pf_only_debugfs_list),
>   					 root, minor);
> -	else
> -		drm_debugfs_create_files(vf_only_debugfs_list,
> -					 ARRAY_SIZE(vf_only_debugfs_list),
> -					 root, minor);
> -
>   
>   	xe_uc_debugfs_register(&gt->uc, root);
>   
> diff --git a/drivers/gpu/drm/xe/xe_sriov_vf.c b/drivers/gpu/drm/xe/xe_sriov_vf.c
> index cb062328551a..cdd9f8e78b2a 100644
> --- a/drivers/gpu/drm/xe/xe_sriov_vf.c
> +++ b/drivers/gpu/drm/xe/xe_sriov_vf.c
> @@ -3,6 +3,7 @@
>    * Copyright © 2023-2024 Intel Corporation
>    */
>   
> +#include <drm/drm_debugfs.h>
>   #include <drm/drm_managed.h>
>   
>   #include "xe_assert.h"
> @@ -445,3 +446,30 @@ int xe_sriov_vf_init_late(struct xe_device *xe)
>   
>   	return err;
>   }
> +
> +static int sa_info_vf_ccs(struct seq_file *m, void *data)
> +{
> +	struct drm_info_node *node = m->private;
> +	struct xe_device *xe = to_xe_device(node->minor->dev);
> +	struct drm_printer p = drm_seq_file_printer(m);
> +
> +	xe_sriov_vf_ccs_print(xe, &p);
> +	return 0;
> +}
> +
> +static const struct drm_info_list debugfs_list[] = {
> +	{ .name = "sa_info_vf_ccs", .show = sa_info_vf_ccs },
> +};
> +
> +/**
> + * xe_sriov_vf_debugfs_register - Register VF debugfs attributes.
> + * @xe: the &xe_device
> + * @root: the root &dentry
> + *
> + * Prepare debugfs attributes exposed by the VF.
> + */
> +void xe_sriov_vf_debugfs_register(struct xe_device *xe, struct dentry *root)
> +{
> +	drm_debugfs_create_files(debugfs_list, ARRAY_SIZE(debugfs_list),
> +				 root, xe->drm.primary);
> +}
> diff --git a/drivers/gpu/drm/xe/xe_sriov_vf.h b/drivers/gpu/drm/xe/xe_sriov_vf.h
> index 3bf3364799ad..9e752105ec2a 100644
> --- a/drivers/gpu/drm/xe/xe_sriov_vf.h
> +++ b/drivers/gpu/drm/xe/xe_sriov_vf.h
> @@ -8,11 +8,13 @@
>   
>   #include <linux/types.h>
>   
> +struct dentry;
>   struct xe_device;
>   
>   void xe_sriov_vf_init_early(struct xe_device *xe);
>   int xe_sriov_vf_init_late(struct xe_device *xe);
>   void xe_sriov_vf_start_migration_recovery(struct xe_device *xe);
>   bool xe_sriov_vf_migration_supported(struct xe_device *xe);
> +void xe_sriov_vf_debugfs_register(struct xe_device *xe, struct dentry *root);
>   
>   #endif
> diff --git a/drivers/gpu/drm/xe/xe_sriov_vf_ccs.c b/drivers/gpu/drm/xe/xe_sriov_vf_ccs.c
> index c5c60f05073d..8dec616c37c9 100644
> --- a/drivers/gpu/drm/xe/xe_sriov_vf_ccs.c
> +++ b/drivers/gpu/drm/xe/xe_sriov_vf_ccs.c
> @@ -13,6 +13,7 @@
>   #include "xe_guc_submit.h"
>   #include "xe_lrc.h"
>   #include "xe_migrate.h"
> +#include "xe_pm.h"
>   #include "xe_sa.h"
>   #include "xe_sriov_printk.h"
>   #include "xe_sriov_vf.h"
> @@ -376,3 +377,34 @@ int xe_sriov_vf_ccs_detach_bo(struct xe_bo *bo)
>   	}
>   	return 0;
>   }
> +
> +/**
> + * xe_sriov_vf_ccs_print - Print VF CCS details.
> + * @xe: the &xe_device
> + * @p: the &drm_printer
> + *
> + * This function is for VF use only.
> + */
> +void xe_sriov_vf_ccs_print(struct xe_device *xe, struct drm_printer *p)
> +{
> +	struct xe_sa_manager *bb_pool;
> +	enum xe_sriov_vf_ccs_rw_ctxs ctx_id;
> +
> +	if (!IS_VF_CCS_READY(xe))
> +		return;
> +
> +	xe_pm_runtime_get(xe);
> +
> +	for_each_ccs_rw_ctx(ctx_id) {
> +		bb_pool = xe->sriov.vf.ccs.contexts[ctx_id].mem.ccs_bb_pool;
> +		if (!bb_pool)
> +			break;
> +
> +		drm_printf(p, "ccs %s bb suballoc info\n", ctx_id ? "write" : "read");
> +		drm_printf(p, "-------------------------\n");
> +		drm_suballoc_dump_debug_info(&bb_pool->base, p, xe_sa_manager_gpu_addr(bb_pool));
> +		drm_puts(p, "\n");
> +	}
> +
> +	xe_pm_runtime_put(xe);
> +}
> diff --git a/drivers/gpu/drm/xe/xe_sriov_vf_ccs.h b/drivers/gpu/drm/xe/xe_sriov_vf_ccs.h
> index f0e1189b417a..0745c0ff0228 100644
> --- a/drivers/gpu/drm/xe/xe_sriov_vf_ccs.h
> +++ b/drivers/gpu/drm/xe/xe_sriov_vf_ccs.h
> @@ -10,6 +10,7 @@
>   #include "xe_sriov.h"
>   #include "xe_sriov_vf_ccs_types.h"
>   
> +struct drm_printer;
>   struct xe_device;
>   struct xe_bo;
>   
> @@ -17,6 +18,7 @@ int xe_sriov_vf_ccs_init(struct xe_device *xe);
>   int xe_sriov_vf_ccs_attach_bo(struct xe_bo *bo);
>   int xe_sriov_vf_ccs_detach_bo(struct xe_bo *bo);
>   int xe_sriov_vf_ccs_register_context(struct xe_device *xe);
> +void xe_sriov_vf_ccs_print(struct xe_device *xe, struct drm_printer *p);
>   
>   static inline bool xe_sriov_vf_ccs_ready(struct xe_device *xe)
>   {
LGTM.
Reviewed-by: Satyanarayana K V P <satyanarayana.k.v.p@intel.com>

  reply	other threads:[~2025-09-09  8:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-08 12:30 [PATCH v2 0/7] Small improvements around VF CCS Michal Wajdeczko
2025-09-08 12:30 ` [PATCH v2 1/7] drm/xe/guc: Rename xe_guc_register_exec_queue Michal Wajdeczko
2025-09-08 12:30 ` [PATCH v2 2/7] drm/xe/guc: Use proper flag definitions when registering context Michal Wajdeczko
2025-09-08 12:30 ` [PATCH v2 3/7] drm/xe/vf: Drop IS_VF_CCS_INIT_NEEDED macro Michal Wajdeczko
2025-09-08 12:30 ` [PATCH v2 4/7] drm/xe/vf: Use single check when calling VF CCS functions Michal Wajdeczko
2025-09-08 12:30 ` [PATCH v2 5/7] drm/xe/bo: Add xe_bo_has_valid_ccs_bb helper Michal Wajdeczko
2025-09-08 12:30 ` [PATCH v2 6/7] drm/xe/vf: Move VF CCS data to xe_device Michal Wajdeczko
2025-09-09  8:19   ` K V P, Satyanarayana
2025-09-08 12:30 ` [PATCH v2 7/7] drm/xe/vf: Move VF CCS debugfs attribute Michal Wajdeczko
2025-09-09  8:23   ` K V P, Satyanarayana [this message]
2025-09-08 22:53 ` ✓ CI.KUnit: success for Small improvements around VF CCS (rev2) Patchwork
2025-09-09  4:21 ` ✗ Xe.CI.Full: failure " Patchwork
2025-09-09  9:21   ` K V P, Satyanarayana

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=7ce5cf51-f075-4b8d-820a-b5fe4d45f6c6@intel.com \
    --to=satyanarayana.k.v.p@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=michal.wajdeczko@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