From: "Ghimiray, Himal Prasad" <himal.prasad.ghimiray@intel.com>
To: <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH 3/6] drm/xe: Add xe_ttm_vram_get_avail
Date: Mon, 15 Apr 2024 10:21:07 +0530 [thread overview]
Message-ID: <a14d8893-3726-4e56-ab0a-7be9385a2a72@intel.com> (raw)
In-Reply-To: <20240414190137.1243-4-michal.wajdeczko@intel.com>
On 15-04-2024 00:31, Michal Wajdeczko wrote:
> The PF driver will need to know size of the remaining available
> VRAM to estimate fair VRAM allocations that could be used across
> all VFs in automatic VFs provisioning mode. Add helper function
> for that. We will use it in upcoming patch.
>
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> ---
> drivers/gpu/drm/xe/xe_ttm_vram_mgr.c | 12 ++++++++++++
> drivers/gpu/drm/xe/xe_ttm_vram_mgr.h | 1 +
> 2 files changed, 13 insertions(+)
>
> diff --git a/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c b/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
> index 0678faf83212..8a1f460ff20b 100644
> --- a/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
> +++ b/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
> @@ -478,3 +478,15 @@ void xe_ttm_vram_get_used(struct ttm_resource_manager *man,
> *used_visible = mgr->visible_size - mgr->visible_avail;
> mutex_unlock(&mgr->lock);
> }
> +
> +u64 xe_ttm_vram_get_avail(struct ttm_resource_manager *man)
> +{
> + struct xe_ttm_vram_mgr *mgr = to_xe_ttm_vram_mgr(man);
> + u64 avail;
> +
> + mutex_lock(&mgr->lock);
> + avail = mgr->mm.avail;
> + mutex_unlock(&mgr->lock);
> +
> + return avail;
> +}
LGTM.
Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
> diff --git a/drivers/gpu/drm/xe/xe_ttm_vram_mgr.h b/drivers/gpu/drm/xe/xe_ttm_vram_mgr.h
> index d184e19a9230..cc76050e376d 100644
> --- a/drivers/gpu/drm/xe/xe_ttm_vram_mgr.h
> +++ b/drivers/gpu/drm/xe/xe_ttm_vram_mgr.h
> @@ -25,6 +25,7 @@ int xe_ttm_vram_mgr_alloc_sgt(struct xe_device *xe,
> void xe_ttm_vram_mgr_free_sgt(struct device *dev, enum dma_data_direction dir,
> struct sg_table *sgt);
>
> +u64 xe_ttm_vram_get_avail(struct ttm_resource_manager *man);
> u64 xe_ttm_vram_get_cpu_visible_size(struct ttm_resource_manager *man);
> void xe_ttm_vram_get_used(struct ttm_resource_manager *man,
> u64 *used, u64 *used_visible);
next prev parent reply other threads:[~2024-04-15 4:51 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-14 19:01 [PATCH 0/6] PF: Add support to configure SR-IOV VFs Michal Wajdeczko
2024-04-14 19:01 ` [PATCH 1/6] drm/xe: Add helper to format SR-IOV function name Michal Wajdeczko
2024-04-15 3:47 ` Ghimiray, Himal Prasad
2024-04-15 7:56 ` Piotr Piórkowski
2024-04-15 8:30 ` Michal Wajdeczko
2024-04-14 19:01 ` [PATCH 2/6] drm/xe: Allow to assign GGTT region to the VF Michal Wajdeczko
2024-04-15 4:49 ` Ghimiray, Himal Prasad
2024-04-15 9:01 ` Michal Wajdeczko
2024-04-15 9:10 ` Piotr Piórkowski
2024-04-15 9:12 ` Ghimiray, Himal Prasad
2024-04-14 19:01 ` [PATCH 3/6] drm/xe: Add xe_ttm_vram_get_avail Michal Wajdeczko
2024-04-15 4:51 ` Ghimiray, Himal Prasad [this message]
2024-04-14 19:01 ` [PATCH 4/6] drm/xe/guc: Add PF2GUC_UPDATE_VF_CFG to ABI Michal Wajdeczko
2024-04-15 9:29 ` Piotr Piórkowski
2024-04-14 19:01 ` [PATCH 5/6] drm/xe/pf: Add SR-IOV PF specific early GT initialization Michal Wajdeczko
2024-04-15 5:19 ` Ghimiray, Himal Prasad
2024-04-15 8:14 ` Michal Wajdeczko
2024-04-14 19:01 ` [PATCH 6/6] drm/xe/pf: Add support to configure SR-IOV VFs Michal Wajdeczko
2024-04-15 14:29 ` Piotr Piórkowski
2024-04-15 17:06 ` Michal Wajdeczko
2024-04-15 17:15 ` ✓ CI.Patch_applied: success for PF: " Patchwork
2024-04-15 17:15 ` ✗ CI.checkpatch: warning " Patchwork
2024-04-15 17:16 ` ✓ CI.KUnit: success " Patchwork
2024-04-15 17:27 ` ✓ CI.Build: " Patchwork
2024-04-15 17:30 ` ✓ CI.Hooks: " Patchwork
2024-04-15 17:31 ` ✓ CI.checksparse: " Patchwork
2024-04-15 17:57 ` ✓ CI.BAT: " Patchwork
2024-04-16 3:44 ` ✓ CI.FULL: " 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=a14d8893-3726-4e56-ab0a-7be9385a2a72@intel.com \
--to=himal.prasad.ghimiray@intel.com \
--cc=intel-xe@lists.freedesktop.org \
/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