From: Nirmoy Das <nirmoy.das@linux.intel.com>
To: Akshata Jahagirdar <akshata.jahagirdar@intel.com>,
intel-xe@lists.freedesktop.org
Cc: akshatajahagirdar6@gmail.com,
Matthew Auld <matthew.auld@intel.com>,
Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Subject: Re: [PATCH v7 5/7] drm/xe/xe_migrate: Handle migration logic for xe2+ dgfx
Date: Thu, 18 Jul 2024 09:23:01 +0200 [thread overview]
Message-ID: <b9d16806-e537-48ac-9cbf-5f1f8bed2104@linux.intel.com> (raw)
In-Reply-To: <79b3a016e686a662ae68c32b5fc7f0f2ac8043e9.1721250309.git.akshata.jahagirdar@intel.com>
On 7/17/2024 11:10 PM, Akshata Jahagirdar wrote:
> During eviction (vram->sysmem), we use compressed -> uncompressed mapping.
> During restore (sysmem->vram), we need to use mapping from
> uncompressed -> uncompressed.
> Handle logic for selecting the compressed identity map for eviction,
> and selecting uncompressed map for restore operations.
> v2: Move check of xe_migrate_ccs_emit() before calling
> xe_migrate_ccs_copy(). (Nirmoy)
>
> Signed-off-by: Akshata Jahagirdar <akshata.jahagirdar@intel.com>
> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
> Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Reviewed-by: Nirmoy Das <nirmoy.das@intel.com>
> ---
> drivers/gpu/drm/xe/xe_migrate.c | 19 +++++++++++--------
> 1 file changed, 11 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c
> index c1c751952ce8..c007f68503d4 100644
> --- a/drivers/gpu/drm/xe/xe_migrate.c
> +++ b/drivers/gpu/drm/xe/xe_migrate.c
> @@ -705,7 +705,7 @@ static u32 xe_migrate_ccs_copy(struct xe_migrate *m,
> struct xe_gt *gt = m->tile->primary_gt;
> u32 flush_flags = 0;
>
> - if (xe_device_has_flat_ccs(gt_to_xe(gt)) && !copy_ccs && dst_is_indirect) {
> + if (!copy_ccs && dst_is_indirect) {
> /*
> * If the src is already in vram, then it should already
> * have been cleared by us, or has been populated by the
> @@ -781,6 +781,7 @@ struct dma_fence *xe_migrate_copy(struct xe_migrate *m,
> bool copy_ccs = xe_device_has_flat_ccs(xe) &&
> xe_bo_needs_ccs_pages(src_bo) && xe_bo_needs_ccs_pages(dst_bo);
> bool copy_system_ccs = copy_ccs && (!src_is_vram || !dst_is_vram);
> + bool use_comp_pat = GRAPHICS_VER(xe) >= 20 && IS_DGFX(xe) && src_is_vram && !dst_is_vram;
>
> /* Copying CCS between two different BOs is not supported yet. */
> if (XE_WARN_ON(copy_ccs && src_bo != dst_bo))
> @@ -807,7 +808,7 @@ struct dma_fence *xe_migrate_copy(struct xe_migrate *m,
> u32 batch_size = 2; /* arb_clear() + MI_BATCH_BUFFER_END */
> struct xe_sched_job *job;
> struct xe_bb *bb;
> - u32 flush_flags;
> + u32 flush_flags = 0;
> u32 update_idx;
> u64 ccs_ofs, ccs_size;
> u32 ccs_pt;
> @@ -825,6 +826,7 @@ struct dma_fence *xe_migrate_copy(struct xe_migrate *m,
> src_L0 = min(src_L0, dst_L0);
>
> pte_flags = src_is_vram ? PTE_UPDATE_FLAG_IS_VRAM : 0;
> + pte_flags |= use_comp_pat ? PTE_UPDATE_FLAG_IS_COMP_PTE : 0;
> batch_size += pte_update_size(m, pte_flags, src, &src_it, &src_L0,
> &src_L0_ofs, &src_L0_pt, 0, 0,
> avail_pts);
> @@ -845,7 +847,7 @@ struct dma_fence *xe_migrate_copy(struct xe_migrate *m,
>
> /* Add copy commands size here */
> batch_size += ((copy_only_ccs) ? 0 : EMIT_COPY_DW) +
> - ((xe_device_has_flat_ccs(xe) ? EMIT_COPY_CCS_DW : 0));
> + ((xe_migrate_needs_ccs_emit(xe) ? EMIT_COPY_CCS_DW : 0));
>
> bb = xe_bb_new(gt, batch_size, usm);
> if (IS_ERR(bb)) {
> @@ -874,11 +876,12 @@ struct dma_fence *xe_migrate_copy(struct xe_migrate *m,
> if (!copy_only_ccs)
> emit_copy(gt, bb, src_L0_ofs, dst_L0_ofs, src_L0, XE_PAGE_SIZE);
>
> - flush_flags = xe_migrate_ccs_copy(m, bb, src_L0_ofs,
> - IS_DGFX(xe) ? src_is_vram : src_is_pltt,
> - dst_L0_ofs,
> - IS_DGFX(xe) ? dst_is_vram : dst_is_pltt,
> - src_L0, ccs_ofs, copy_ccs);
> + if (xe_migrate_needs_ccs_emit(xe))
> + flush_flags = xe_migrate_ccs_copy(m, bb, src_L0_ofs,
> + IS_DGFX(xe) ? src_is_vram : src_is_pltt,
> + dst_L0_ofs,
> + IS_DGFX(xe) ? dst_is_vram : dst_is_pltt,
> + src_L0, ccs_ofs, copy_ccs);
>
> job = xe_bb_create_migration_job(m->q, bb,
> xe_migrate_batch_base(m, usm),
next prev parent reply other threads:[~2024-07-18 7:23 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-17 21:10 [PATCH v7 0/7] Implement Compression Support on BMG Akshata Jahagirdar
2024-07-17 21:10 ` [PATCH v7 1/7] drm/xe/migrate: Handle clear ccs logic for xe2 dgfx Akshata Jahagirdar
2024-07-17 21:10 ` [PATCH v7 2/7] drm/xe/migrate: Add kunit to test clear functionality Akshata Jahagirdar
2024-07-17 21:10 ` [PATCH v7 3/7] drm/xe/migrate: Add helper function to program identity map Akshata Jahagirdar
2024-07-17 21:10 ` [PATCH v7 4/7] drm/xe/xe2: Introduce identity map for compressed pat for vram Akshata Jahagirdar
2024-07-17 21:10 ` [PATCH v7 5/7] drm/xe/xe_migrate: Handle migration logic for xe2+ dgfx Akshata Jahagirdar
2024-07-18 7:23 ` Nirmoy Das [this message]
2024-07-17 21:10 ` [PATCH v7 6/7] drm/xe/migrate: Add kunit to test migration functionality for BMG Akshata Jahagirdar
2024-07-17 21:10 ` [PATCH v7 7/7] drm/xe/xe2: Do not run xe_bo_test for xe2+ dgfx Akshata Jahagirdar
2024-07-17 21:16 ` ✓ CI.Patch_applied: success for Implement Compression Support on BMG Patchwork
2024-07-17 21:16 ` ✓ CI.checkpatch: " Patchwork
2024-07-17 21:17 ` ✓ CI.KUnit: " Patchwork
2024-07-17 21:29 ` ✓ CI.Build: " Patchwork
2024-07-17 21:32 ` ✓ CI.Hooks: " Patchwork
2024-07-17 21:33 ` ✓ CI.checksparse: " Patchwork
2024-07-17 21:53 ` ✓ CI.BAT: " Patchwork
2024-07-18 0:05 ` [PATCH v7 0/7] " Matt Roper
2024-07-18 3:15 ` ✗ CI.FULL: failure for " 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=b9d16806-e537-48ac-9cbf-5f1f8bed2104@linux.intel.com \
--to=nirmoy.das@linux.intel.com \
--cc=akshata.jahagirdar@intel.com \
--cc=akshatajahagirdar6@gmail.com \
--cc=himal.prasad.ghimiray@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.auld@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