Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Bernatowicz, Marcin" <marcin.bernatowicz@linux.intel.com>
To: "Piórkowski, Piotr" <piotr.piorkowski@intel.com>,
	intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v1 1/4] drm/xe/pf: Share SR-IOV config unit helpers
Date: Wed, 2 Dec 2026 18:10:47 +0100	[thread overview]
Message-ID: <63b4382f-bb02-4b60-a501-92aca1d6ad5e@linux.intel.com> (raw)
In-Reply-To: <20261201162219.22723-2-piotr.piorkowski@intel.com>


On 12/1/2026 5:22 PM, Piórkowski, Piotr wrote:
> From: Piotr Piórkowski <piotr.piorkowski@intel.com>
>
> The helpers that return the unit or description printed next to the
> execution quantum, preemption timeout and scheduling priority values
> are private to the GT config code. We will need them also to print
> the VGPU profiles, so move them to the PF helpers header instead of
> duplicating them.
>
> Signed-off-by: Piotr Piórkowski <piotr.piorkowski@intel.com>
> ---
>   drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c | 35 ++++++--------------
>   drivers/gpu/drm/xe/xe_sriov_pf_helpers.h   | 37 ++++++++++++++++++++++
>   2 files changed, 46 insertions(+), 26 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
> index ee8054cca1839..4935936fff946 100644
> --- a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
> +++ b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
> @@ -31,6 +31,7 @@
>   #include "xe_lmtt.h"
>   #include "xe_migrate.h"
>   #include "xe_sriov.h"
> +#include "xe_sriov_pf_helpers.h"
>   #include "xe_ttm_vram_mgr.h"
>   #include "xe_vram_types.h"
>   
> @@ -2141,11 +2142,6 @@ int xe_gt_sriov_pf_config_set_fair_locked(struct xe_gt *gt, unsigned int vfid,
>   	return result;
>   }
>   
> -static const char *exec_quantum_unit(u32 exec_quantum)
> -{
> -	return exec_quantum ? "ms" : "(infinity)";
> -}
> -
>   static int pf_provision_exec_quantum(struct xe_gt *gt, unsigned int vfid,
>   				     u32 exec_quantum)
>   {
> @@ -2203,7 +2199,7 @@ int xe_gt_sriov_pf_config_set_exec_quantum_locked(struct xe_gt *gt, unsigned int
>   
>   	return pf_config_set_u32_done(gt, vfid, exec_quantum,
>   				      pf_get_exec_quantum(gt, vfid),
> -				      "execution quantum", exec_quantum_unit, err);
> +				      "execution quantum", xe_sriov_pf_exec_quantum_unit, err);
>   }
>   
>   /**
> @@ -2273,7 +2269,7 @@ static int pf_bulk_set_exec_quantum(struct xe_gt *gt, u32 exec_quantum,
>   
>   	return pf_config_bulk_set_u32_done(gt, first_vf, num_vfs, exec_quantum,
>   					   pf_get_exec_quantum, "execution quantum",
> -					   exec_quantum_unit, n, err);
> +					   xe_sriov_pf_exec_quantum_unit, n, err);
>   }
>   
>   /**
> @@ -2352,7 +2348,7 @@ int xe_gt_sriov_pf_config_set_groups_exec_quantums(struct xe_gt *gt, unsigned in
>   	return pf_groups_cfg_set_u32_done(gt, vfid, exec_quantums, count,
>   					  pf_get_groups_exec_quantums,
>   					  "execution quantum",
> -					  exec_quantum_unit, err);
> +					  xe_sriov_pf_exec_quantum_unit, err);
>   }
>   
>   /**
> @@ -2374,11 +2370,6 @@ void xe_gt_sriov_pf_config_get_groups_exec_quantums(struct xe_gt *gt, unsigned i
>   	pf_get_groups_exec_quantums(gt, vfid, exec_quantums, count);
>   }
>   
> -static const char *preempt_timeout_unit(u32 preempt_timeout)
> -{
> -	return preempt_timeout ? "us" : "(infinity)";
> -}
> -
>   static int pf_provision_preempt_timeout(struct xe_gt *gt, unsigned int vfid,
>   					u32 preempt_timeout)
>   {
> @@ -2436,7 +2427,7 @@ int xe_gt_sriov_pf_config_set_preempt_timeout_locked(struct xe_gt *gt, unsigned
>   
>   	return pf_config_set_u32_done(gt, vfid, preempt_timeout,
>   				      pf_get_preempt_timeout(gt, vfid),
> -				      "preemption timeout", preempt_timeout_unit, err);
> +				      "preemption timeout", xe_sriov_pf_preempt_timeout_unit, err);
>   }
>   
>   /**
> @@ -2505,7 +2496,7 @@ static int pf_bulk_set_preempt_timeout(struct xe_gt *gt, u32 preempt_timeout,
>   
>   	return pf_config_bulk_set_u32_done(gt, first_vf, num_vfs, preempt_timeout,
>   					   pf_get_preempt_timeout, "preemption timeout",
> -					   preempt_timeout_unit, n, err);
> +					   xe_sriov_pf_preempt_timeout_unit, n, err);
>   }
>   
>   /**
> @@ -2585,7 +2576,7 @@ int xe_gt_sriov_pf_config_set_groups_preempt_timeouts(struct xe_gt *gt, unsigned
>   	return pf_groups_cfg_set_u32_done(gt, vfid, preempt_timeouts, count,
>   					  pf_get_groups_preempt_timeouts,
>   					  "preempt_timeout",
> -					  preempt_timeout_unit, err);
> +					  xe_sriov_pf_preempt_timeout_unit, err);
>   }
>   
>   /**
> @@ -2607,14 +2598,6 @@ void xe_gt_sriov_pf_config_get_groups_preempt_timeouts(struct xe_gt *gt, unsigne
>   	pf_get_groups_preempt_timeouts(gt, vfid, preempt_timeouts, count);
>   }
>   
> -static const char *sched_priority_unit(u32 priority)
> -{
> -	return priority == GUC_SCHED_PRIORITY_LOW ? "(low)" :
> -		priority == GUC_SCHED_PRIORITY_NORMAL ? "(normal)" :
> -		priority == GUC_SCHED_PRIORITY_HIGH ? "(high)" :
> -		"(?)";
> -}
> -
>   static int pf_provision_sched_priority(struct xe_gt *gt, unsigned int vfid, u32 priority)
>   {
>   	struct xe_gt_sriov_config *config = pf_pick_vf_config(gt, vfid);
> @@ -2656,7 +2639,7 @@ int xe_gt_sriov_pf_config_set_sched_priority_locked(struct xe_gt *gt, unsigned i
>   
>   	return pf_config_set_u32_done(gt, vfid, priority,
>   				      pf_get_sched_priority(gt, vfid),
> -				      "scheduling priority", sched_priority_unit, err);
> +				      "scheduling priority", xe_sriov_pf_sched_priority_unit, err);
>   }
>   
>   /**
> @@ -2722,7 +2705,7 @@ void xe_gt_sriov_pf_config_force_sched_priority_locked(struct xe_gt *gt, u32 pri
>   
>   	pf_config_bulk_set_u32_done(gt, PFID, 1 + total_vfs, priority,
>   				    pf_get_sched_priority, "scheduling priority",
> -				    sched_priority_unit, n, 0);
> +				    xe_sriov_pf_sched_priority_unit, n, 0);
>   }
>   
>   static void pf_reset_config_sched(struct xe_gt *gt, struct xe_gt_sriov_config *config)
> diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_helpers.h b/drivers/gpu/drm/xe/xe_sriov_pf_helpers.h
> index 19f6f8331c8df..edee89cd823fa 100644
> --- a/drivers/gpu/drm/xe/xe_sriov_pf_helpers.h
> +++ b/drivers/gpu/drm/xe/xe_sriov_pf_helpers.h
> @@ -6,6 +6,7 @@
>   #ifndef _XE_SRIOV_PF_HELPERS_H_
>   #define _XE_SRIOV_PF_HELPERS_H_
>   
> +#include "abi/guc_klvs_abi.h"
>   #include "xe_assert.h"
>   #include "xe_device.h"
>   #include "xe_device_types.h"
> @@ -61,6 +62,42 @@ static inline bool xe_sriov_pf_admin_only(const struct xe_device *xe)
>   	return xe_device_is_admin_only(xe);
>   }
>   
> +/**
> + * xe_sriov_pf_exec_quantum_unit() - Get the unit of the execution quantum.
> + * @exec_quantum: the execution quantum value
> + *
> + * Return: the unit to be printed after the execution quantum value.
> + */
> +static inline const char *xe_sriov_pf_exec_quantum_unit(u32 exec_quantum)
> +{
> +	return exec_quantum ? "ms" : "(infinity)";
> +}
> +
> +/**
> + * xe_sriov_pf_preempt_timeout_unit() - Get the unit of the preemption timeout.
> + * @preempt_timeout: the preemption timeout value
> + *
> + * Return: the unit to be printed after the preemption timeout value.
> + */
> +static inline const char *xe_sriov_pf_preempt_timeout_unit(u32 preempt_timeout)
> +{
> +	return preempt_timeout ? "us" : "(infinity)";
> +}
> +
> +/**
> + * xe_sriov_pf_sched_priority_unit() - Get the description of the scheduling priority.
> + * @priority: the scheduling priority value
> + *
> + * Return: the description to be printed after the scheduling priority value.
> + */
> +static inline const char *xe_sriov_pf_sched_priority_unit(u32 priority)
> +{
> +	return priority == GUC_SCHED_PRIORITY_LOW ? "(low)" :
> +		priority == GUC_SCHED_PRIORITY_NORMAL ? "(normal)" :
> +		priority == GUC_SCHED_PRIORITY_HIGH ? "(high)" :
> +		"(?)";
> +}
> +
>   static inline struct mutex *xe_sriov_pf_master_mutex(struct xe_device *xe)
>   {
>   	xe_assert(xe, IS_SRIOV_PF(xe));

LGTM,

Reviewed-by: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>


  reply	other threads:[~2026-12-02 17:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01 16:22 [PATCH v1 0/4] Add helpers for VGPU profiles provisioning Piórkowski, Piotr
2026-12-01 16:22 ` [PATCH v1 1/4] drm/xe/pf: Share SR-IOV config unit helpers Piórkowski, Piotr
2026-12-02 17:10   ` Bernatowicz, Marcin [this message]
2026-12-01 16:22 ` [PATCH v1 2/4] drm/xe/pf: Allow to configure execution quantum for range of VFs Piórkowski, Piotr
2026-12-01 16:22 ` [PATCH v1 3/4] drm/xe/pf: Allow to configure preemption timeout " Piórkowski, Piotr
2026-12-01 16:22 ` [PATCH v1 4/4] drm/xe/pf: Extract helper to reset VFs provisioning Piórkowski, Piotr
2026-12-02 17:10   ` Bernatowicz, Marcin
2026-12-01 16:50 ` ✓ CI.KUnit: success for Add helpers for VGPU profiles provisioning Patchwork
2026-12-01 17:28 ` ✗ Xe.CI.BAT: failure " Patchwork
2026-12-02 10:59 ` ✓ Xe.CI.FULL: success " 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=63b4382f-bb02-4b60-a501-92aca1d6ad5e@linux.intel.com \
    --to=marcin.bernatowicz@linux.intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=piotr.piorkowski@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