From: "Piotr Piórkowski" <piotr.piorkowski@intel.com>
To: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH v2 01/10] drm/xe/pf: Expose LMTT page size
Date: Fri, 20 Feb 2026 09:22:22 +0100 [thread overview]
Message-ID: <20260220082222.ppefcfjsr4a2spuq@intel.com> (raw)
In-Reply-To: <20260218205553.3561-2-michal.wajdeczko@intel.com>
Michal Wajdeczko <michal.wajdeczko@intel.com> wrote on śro [2026-lut-18 21:55:43 +0100]:
> The underlying LMTT implementation already provides the info about
> the page size it is using. There is no need to have a separate
> helper function that is making assumption about the required size.
>
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Piotr Piórkowski <piotr.piorkowski@intel.com>
> ---
> drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c | 3 +--
> drivers/gpu/drm/xe/xe_lmtt.c | 17 +++++++++++++++++
> drivers/gpu/drm/xe/xe_lmtt.h | 1 +
> 3 files changed, 19 insertions(+), 2 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 888193e1d2c5..e06baf12e108 100644
> --- a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
> +++ b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
> @@ -1451,8 +1451,7 @@ int xe_gt_sriov_pf_config_set_fair_dbs(struct xe_gt *gt, unsigned int vfid,
>
> static u64 pf_get_lmem_alignment(struct xe_gt *gt)
> {
> - /* this might be platform dependent */
> - return SZ_2M;
> + return xe_lmtt_page_size(>->tile->sriov.pf.lmtt);
> }
>
> static u64 pf_get_min_spare_lmem(struct xe_gt *gt)
> diff --git a/drivers/gpu/drm/xe/xe_lmtt.c b/drivers/gpu/drm/xe/xe_lmtt.c
> index 2077e1ef8b43..b583e0f20183 100644
> --- a/drivers/gpu/drm/xe/xe_lmtt.c
> +++ b/drivers/gpu/drm/xe/xe_lmtt.c
> @@ -57,6 +57,23 @@ static u64 lmtt_page_size(struct xe_lmtt *lmtt)
> return BIT_ULL(lmtt->ops->lmtt_pte_shift(0));
> }
>
> +/**
> + * xe_lmtt_page_size() - Get LMTT page size.
> + * @lmtt: the &xe_lmtt
> + *
> + * This function shall be called only by PF.
> + *
> + * Return: LMTT page size.
> + */
> +u64 xe_lmtt_page_size(struct xe_lmtt *lmtt)
> +{
> + lmtt_assert(lmtt, IS_SRIOV_PF(lmtt_to_xe(lmtt)));
> + lmtt_assert(lmtt, xe_device_has_lmtt(lmtt_to_xe(lmtt)));
> + lmtt_assert(lmtt, lmtt->ops);
> +
> + return lmtt_page_size(lmtt);
> +}
> +
> static struct xe_lmtt_pt *lmtt_pt_alloc(struct xe_lmtt *lmtt, unsigned int level)
> {
> unsigned int num_entries = level ? lmtt->ops->lmtt_pte_num(level) : 0;
> diff --git a/drivers/gpu/drm/xe/xe_lmtt.h b/drivers/gpu/drm/xe/xe_lmtt.h
> index 75a234fbf367..8fa387b38c52 100644
> --- a/drivers/gpu/drm/xe/xe_lmtt.h
> +++ b/drivers/gpu/drm/xe/xe_lmtt.h
> @@ -20,6 +20,7 @@ int xe_lmtt_prepare_pages(struct xe_lmtt *lmtt, unsigned int vfid, u64 range);
> int xe_lmtt_populate_pages(struct xe_lmtt *lmtt, unsigned int vfid, struct xe_bo *bo, u64 offset);
> void xe_lmtt_drop_pages(struct xe_lmtt *lmtt, unsigned int vfid);
> u64 xe_lmtt_estimate_pt_size(struct xe_lmtt *lmtt, u64 size);
> +u64 xe_lmtt_page_size(struct xe_lmtt *lmtt);
> #else
> static inline int xe_lmtt_init(struct xe_lmtt *lmtt) { return 0; }
> static inline void xe_lmtt_init_hw(struct xe_lmtt *lmtt) { }
> --
LGTM:
Reviewed-by: Piotr Piórkowski <piotr.piorkowski@intel.com>
> 2.47.1
>
--
next prev parent reply other threads:[~2026-02-20 8:23 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-18 20:55 [PATCH v2 00/10] drm/xe/pf: Allow to change VFs VRAM quota using sysfs Michal Wajdeczko
2026-02-18 20:55 ` [PATCH v2 01/10] drm/xe/pf: Expose LMTT page size Michal Wajdeczko
2026-02-20 8:22 ` Piotr Piórkowski [this message]
2026-02-18 20:55 ` [PATCH v2 02/10] drm/xe/pf: Add locked variants of VRAM configuration functions Michal Wajdeczko
2026-02-18 20:55 ` [PATCH v2 03/10] drm/xe/pf: Add functions for VRAM provisioning Michal Wajdeczko
2026-02-18 20:55 ` [PATCH v2 04/10] drm/xe/pf: Allow to change VFs VRAM quota using sysfs Michal Wajdeczko
2026-02-18 21:21 ` Rodrigo Vivi
2026-02-18 20:55 ` [PATCH v2 05/10] drm/xe/pf: Use migration-friendly VRAM auto-provisioning Michal Wajdeczko
2026-02-18 20:55 ` [PATCH v2 06/10] drm/xe/tests: Add KUnit tests for new VRAM fair provisioning Michal Wajdeczko
2026-02-27 1:16 ` Nathan Chancellor
2026-02-18 20:55 ` [PATCH v2 07/10] drm/xe/pf: Don't check for empty config Michal Wajdeczko
2026-02-18 20:55 ` [PATCH v2 08/10] drm/xe/pf: Prefer guard(mutex) when doing fair LMEM provisioning Michal Wajdeczko
2026-02-18 20:55 ` [PATCH v2 09/10] drm/xe/pf: Skip VRAM auto-provisioning if already provisioned Michal Wajdeczko
2026-02-18 20:55 ` [PATCH v2 10/10] drm/xe/pf: Add documentation for vram_quota Michal Wajdeczko
2026-02-18 21:21 ` Rodrigo Vivi
2026-02-18 21:01 ` ✗ CI.checkpatch: warning for drm/xe/pf: Allow to change VFs VRAM quota using sysfs (rev2) Patchwork
2026-02-18 21:03 ` ✓ CI.KUnit: success " Patchwork
2026-02-18 21:47 ` ✗ Xe.CI.BAT: failure " Patchwork
2026-02-20 10:35 ` Michal Wajdeczko
2026-02-18 23:19 ` ✗ Xe.CI.FULL: " Patchwork
2026-02-20 10:37 ` Michal Wajdeczko
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=20260220082222.ppefcfjsr4a2spuq@intel.com \
--to=piotr.piorkowski@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.