Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Wajdeczko <michal.wajdeczko@intel.com>
To: Tomasz Lis <tomasz.lis@intel.com>, <intel-xe@lists.freedesktop.org>
Cc: "Michał Winiarski" <michal.winiarski@intel.com>,
	"Piotr Piórkowski" <piotr.piorkowski@intel.com>,
	"Matthew Brost" <matthew.brost@intel.com>,
	"Satyanarayana K V P" <satyanarayana.k.v.p@intel.com>
Subject: Re: [PATCH v3 1/5] drm/xe/vf: Helper for telling whether CCS migration BBs are needed
Date: Thu, 16 Oct 2025 21:57:58 +0200	[thread overview]
Message-ID: <8f905d60-23c0-4d49-8a94-7bc800d82baa@intel.com> (raw)
In-Reply-To: <20251016120511.856792-2-tomasz.lis@intel.com>



On 10/16/2025 2:05 PM, Tomasz Lis wrote:
> To avoid having duplicated checks, and also provide clear
> documentation of what are we checking for, the conditions
> for initing CCS BBs for VF migration are closed into a function.

I would drop "BBs" from title and commit message, as this is
just an implementation detail of the "VF CCS migration" feature
that doesn't need to be exposed right now.

> 
> Signed-off-by: Tomasz Lis <tomasz.lis@intel.com>
> ---
>  drivers/gpu/drm/xe/xe_sriov_vf_ccs.c | 15 ++++++++++++++-
>  drivers/gpu/drm/xe/xe_sriov_vf_ccs.h |  2 ++
>  2 files changed, 16 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_sriov_vf_ccs.c b/drivers/gpu/drm/xe/xe_sriov_vf_ccs.c
> index 790249801364..7688d1baf42f 100644
> --- a/drivers/gpu/drm/xe/xe_sriov_vf_ccs.c
> +++ b/drivers/gpu/drm/xe/xe_sriov_vf_ccs.c
> @@ -260,6 +260,19 @@ int xe_sriov_vf_ccs_register_context(struct xe_device *xe)
>  	return err;
>  }
>  
> +/**
> + * xe_sriov_vf_ccs_migration_bb_needed - Whether GuC requires CCS copy BBs for VF migration.

all functions in xe_sriov_vf_ccs.c are related to "migration"
but only this one mention it in its name, either rename other
functions to match this one, or name this one simply as:

      xe_sriov_vf_ccs_is_needed()

> + * @xe: the &xe_device instance.
> + *
> + * Only selected platforms require VF KMD to maintain CCS copy BBs and linked LRCAs.
> + *
> + * Return: true if the BBs are needed, false otherwise.

"true if VF driver must participate in the CCS migration"

> + */
> +bool xe_sriov_vf_ccs_migration_bb_needed(struct xe_device *xe)
> +{

this should be always called from VF code, so even if not strictly required:

	xe_assert(xe, IS_SRIOV(xe))

> +	return !IS_DGFX(xe) && xe_device_has_flat_ccs(xe);
> +}
> +
>  static void xe_sriov_vf_ccs_fini(void *arg)
>  {
>  	struct xe_sriov_vf_ccs_ctx *ctx = arg;
> @@ -294,7 +307,7 @@ int xe_sriov_vf_ccs_init(struct xe_device *xe)
>  	xe_assert(xe, IS_SRIOV_VF(xe));
>  	xe_assert(xe, xe_sriov_vf_migration_supported(xe));
>  
> -	if (IS_DGFX(xe) || !xe_device_has_flat_ccs(xe))
> +	if (!xe_sriov_vf_ccs_migration_bb_needed(xe))
>  		return 0;
>  
>  	for_each_ccs_rw_ctx(ctx_id) {
> diff --git a/drivers/gpu/drm/xe/xe_sriov_vf_ccs.h b/drivers/gpu/drm/xe/xe_sriov_vf_ccs.h
> index f8ca6efce9ee..dcba4173c712 100644
> --- a/drivers/gpu/drm/xe/xe_sriov_vf_ccs.h
> +++ b/drivers/gpu/drm/xe/xe_sriov_vf_ccs.h
> @@ -14,6 +14,8 @@ struct drm_printer;
>  struct xe_device;
>  struct xe_bo;
>  
> +bool xe_sriov_vf_ccs_migration_bb_needed(struct xe_device *xe);
> +
>  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);


  reply	other threads:[~2025-10-16 19:58 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-16 12:05 [PATCH v3 0/5] drm/xe/vf: Minor fixes to post-migration recovery Tomasz Lis
2025-10-16 12:05 ` [PATCH v3 1/5] drm/xe/vf: Helper for telling whether CCS migration BBs are needed Tomasz Lis
2025-10-16 19:57   ` Michal Wajdeczko [this message]
2025-10-16 21:51     ` Lis, Tomasz
2025-10-16 12:05 ` [PATCH v3 2/5] drm/xe/vf: Fix GuC FW check for VF migration support Tomasz Lis
2025-10-16 21:55   ` Michal Wajdeczko
2025-10-17 15:31     ` Lis, Tomasz
2025-10-17 15:40       ` Michal Wajdeczko
2025-10-16 12:05 ` [PATCH v3 3/5] drm/xe/vf: Skip fixups on VF migration before getting GGTT info Tomasz Lis
2025-10-16 22:20   ` Michal Wajdeczko
2025-10-20 19:30     ` Lis, Tomasz
2025-10-16 12:05 ` [PATCH v3 4/5] drm/xe: Assert that VF will never use fixed placement of BOs Tomasz Lis
2025-10-16 12:05 ` [PATCH v3 5/5] drm/xe/vf: Do not disable VF migration on ATS-M Tomasz Lis
2025-10-16 22:25   ` Michal Wajdeczko
2025-10-20 19:22     ` Lis, Tomasz
2025-10-16 12:11 ` ✓ CI.KUnit: success for drm/xe/vf: Minor fixes to post-migration recovery (rev3) Patchwork
2025-10-16 12:57 ` ✓ Xe.CI.BAT: " Patchwork
2025-10-17  8:23 ` ✗ Xe.CI.Full: failure " Patchwork

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=8f905d60-23c0-4d49-8a94-7bc800d82baa@intel.com \
    --to=michal.wajdeczko@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.brost@intel.com \
    --cc=michal.winiarski@intel.com \
    --cc=piotr.piorkowski@intel.com \
    --cc=satyanarayana.k.v.p@intel.com \
    --cc=tomasz.lis@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