From: "Ghimiray, Himal Prasad" <himal.prasad.ghimiray@intel.com>
To: Matt Roper <matthew.d.roper@intel.com>
Cc: intel-xe@lists.freedesktop.org, Matthew Auld <matthew.auld@intel.com>
Subject: Re: [Intel-xe] [PATCH v4 6/9] drm/xe/xe2: Update emit_pte to use compression enabled PAT index
Date: Fri, 8 Dec 2023 10:31:29 +0530 [thread overview]
Message-ID: <d6bfe9c9-3f46-4c4d-8677-4b1d6bc05b8c@intel.com> (raw)
In-Reply-To: <20231207001437.GU1327160@mdroper-desk1.amr.corp.intel.com>
On 07-12-2023 05:44, Matt Roper wrote:
> On Wed, Dec 06, 2023 at 10:01:23AM +0530, Himal Prasad Ghimiray wrote:
>> For indirect accessed buffer use compression enabled PAT index.
>>
>> v2:
>> - Fix parameter name.
>>
>> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
>> Cc: Matthew Auld <matthew.auld@intel.com>
>> Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
>> ---
>> drivers/gpu/drm/xe/tests/xe_migrate.c | 2 +-
>> drivers/gpu/drm/xe/xe_migrate.c | 20 ++++++++++++++------
>> 2 files changed, 15 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/xe/tests/xe_migrate.c b/drivers/gpu/drm/xe/tests/xe_migrate.c
>> index 83d6a66ed369..f77477f7e9fa 100644
>> --- a/drivers/gpu/drm/xe/tests/xe_migrate.c
>> +++ b/drivers/gpu/drm/xe/tests/xe_migrate.c
>> @@ -330,7 +330,7 @@ static void xe_migrate_sanity_test(struct xe_migrate *m, struct kunit *test)
>> else
>> xe_res_first_sg(xe_bo_sg(pt), 0, pt->size, &src_it);
>>
>> - emit_pte(m, bb, NUM_KERNEL_PDE - 1, xe_bo_is_vram(pt),
>> + emit_pte(m, bb, NUM_KERNEL_PDE - 1, xe_bo_is_vram(pt), false,
>> &src_it, XE_PAGE_SIZE, pt);
>>
>> run_sanity_job(m, xe, bb, bb->len, "Writing PTE for our fake PT", test);
>> diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c
>> index 98dca906a023..1bfb249680f4 100644
>> --- a/drivers/gpu/drm/xe/xe_migrate.c
>> +++ b/drivers/gpu/drm/xe/xe_migrate.c
>> @@ -416,15 +416,23 @@ static u32 pte_update_size(struct xe_migrate *m,
>>
>> static void emit_pte(struct xe_migrate *m,
>> struct xe_bb *bb, u32 at_pt,
>> - bool is_vram,
>> + bool is_vram, bool is_comp_pte,
>> struct xe_res_cursor *cur,
>> u32 size, struct xe_bo *bo)
>> {
>> - u16 pat_index = tile_to_xe(m->tile)->pat.idx[XE_CACHE_WB];
>> + struct xe_device *xe = tile_to_xe(m->tile);
>> +
>> + u16 pat_index;
>> u32 ptes;
>> u64 ofs = at_pt * XE_PAGE_SIZE;
>> u64 cur_ofs;
>>
>> + /* Indirect access needs compression enabled uncached PAT index */
>> + if (GRAPHICS_VERx100(xe) >= 2000)
>> + pat_index = is_comp_pte ? 12 : xe->pat.idx[XE_CACHE_NONE];
> We should always select the PAT properly for the platform; we really
> don't want a magic number like "12" here.
Sure.
>
> Also, how do we know we want to always use compression here? Is there a
> reason we select uncached? Do we need to worry that we're now using a
> non-coherent mapping and may miss updates to the buffer that are sitting
> in the CPU cache?
>
In case of uncompressed PAT hardware is returning always ccs read as 0.
Have already started discussion on this, will come back with updates.
> Matt
>
>> + else
>> + pat_index = xe->pat.idx[XE_CACHE_WB];
>> +
>> /*
>> * FIXME: Emitting VRAM PTEs to L0 PTs is forbidden. Currently
>> * we're only emitting VRAM PTEs during sanity tests, so when
>> @@ -722,19 +730,19 @@ struct dma_fence *xe_migrate_copy(struct xe_migrate *m,
>> }
>>
>> if (!src_is_vram)
>> - emit_pte(m, bb, src_L0_pt, src_is_vram, &src_it, src_L0,
>> + emit_pte(m, bb, src_L0_pt, src_is_vram, true, &src_it, src_L0,
>> src_bo);
>> else
>> xe_res_next(&src_it, src_L0);
>>
>> if (!dst_is_vram)
>> - emit_pte(m, bb, dst_L0_pt, dst_is_vram, &dst_it, src_L0,
>> + emit_pte(m, bb, dst_L0_pt, dst_is_vram, true, &dst_it, src_L0,
>> dst_bo);
>> else
>> xe_res_next(&dst_it, src_L0);
>>
>> if (copy_system_ccs)
>> - emit_pte(m, bb, ccs_pt, false, &ccs_it, ccs_size, src_bo);
>> + emit_pte(m, bb, ccs_pt, false, false, &ccs_it, ccs_size, src_bo);
>>
>> bb->cs[bb->len++] = MI_BATCH_BUFFER_END;
>> update_idx = bb->len;
>> @@ -975,7 +983,7 @@ struct dma_fence *xe_migrate_clear(struct xe_migrate *m,
>>
>> /* Preemption is enabled again by the ring ops. */
>> if (!clear_vram) {
>> - emit_pte(m, bb, clear_L0_pt, clear_vram, &src_it, clear_L0,
>> + emit_pte(m, bb, clear_L0_pt, clear_vram, true, &src_it, clear_L0,
>> bo);
>> } else {
>> xe_res_next(&src_it, clear_L0);
>> --
>> 2.25.1
>>
next prev parent reply other threads:[~2023-12-08 5:01 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-06 4:31 [Intel-xe] [PATCH v4 0/9] Enable compression handling on LNL Himal Prasad Ghimiray
2023-12-06 4:31 ` [Intel-xe] [PATCH v4 1/9] drm/xe/xe2: Determine bios enablement for flat ccs on igfx Himal Prasad Ghimiray
2023-12-06 22:14 ` Matt Roper
2023-12-06 4:31 ` [Intel-xe] [PATCH v4 2/9] drm/xe/xe2: Allocate extra pages for ccs during bo create Himal Prasad Ghimiray
2023-12-06 22:27 ` Matt Roper
2023-12-08 3:59 ` Ghimiray, Himal Prasad
2023-12-06 4:31 ` [Intel-xe] [PATCH v4 3/9] drm/xe/xe2: Updates on XY_CTRL_SURF_COPY_BLT Himal Prasad Ghimiray
2023-12-06 23:22 ` Matt Roper
2023-12-08 4:01 ` Ghimiray, Himal Prasad
2023-12-06 4:31 ` [Intel-xe] [PATCH v4 4/9] drm/xe/xe_migrate: Use NULL 1G PTE mapped at 255GiB VA for ccs clear Himal Prasad Ghimiray
2023-12-06 23:37 ` Matt Roper
2023-12-08 4:10 ` Ghimiray, Himal Prasad
2023-12-06 4:31 ` [Intel-xe] [PATCH v4 5/9] drm/xe/xe2: Update chunk size for each iteration of ccs copy Himal Prasad Ghimiray
2023-12-07 0:01 ` Matt Roper
2023-12-08 4:22 ` Ghimiray, Himal Prasad
2023-12-06 4:31 ` [Intel-xe] [PATCH v4 6/9] drm/xe/xe2: Update emit_pte to use compression enabled PAT index Himal Prasad Ghimiray
2023-12-07 0:14 ` Matt Roper
2023-12-08 5:01 ` Ghimiray, Himal Prasad [this message]
2023-12-06 4:31 ` [Intel-xe] [PATCH v4 7/9] drm/xe/xe2: Handle flat ccs move for igfx Himal Prasad Ghimiray
2023-12-07 0:17 ` Matt Roper
2023-12-08 4:32 ` Ghimiray, Himal Prasad
2023-12-06 4:31 ` [Intel-xe] [PATCH v4 8/9] drm/xe/xe2: Modify xe_bo_test for system memory Himal Prasad Ghimiray
2023-12-07 0:23 ` Matt Roper
2023-12-08 4:35 ` Ghimiray, Himal Prasad
2023-12-06 4:31 ` [Intel-xe] [PATCH v4 9/9] drm/xe/xe2: Support flat ccs Himal Prasad Ghimiray
2023-12-06 8:23 ` [Intel-xe] ✓ CI.Patch_applied: success for Enable compression handling on LNL. (rev5) Patchwork
2023-12-06 8:23 ` [Intel-xe] ✓ CI.checkpatch: " Patchwork
2023-12-06 8:24 ` [Intel-xe] ✓ CI.KUnit: " Patchwork
2023-12-06 8:32 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-12-06 8:32 ` [Intel-xe] ✓ CI.Hooks: " Patchwork
2023-12-06 8:33 ` [Intel-xe] ✓ CI.checksparse: " Patchwork
2023-12-06 9:07 ` [Intel-xe] ✗ CI.BAT: 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=d6bfe9c9-3f46-4c4d-8677-4b1d6bc05b8c@intel.com \
--to=himal.prasad.ghimiray@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.auld@intel.com \
--cc=matthew.d.roper@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