From: Nirmoy Das <nirmoy.das@intel.com>
To: dri-devel@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org,
"Nirmoy Das" <nirmoy.das@intel.com>,
"Himal Prasad Ghimiray" <himal.prasad.ghimiray@intel.com>,
"Matthew Auld" <matthew.auld@intel.com>,
"Thomas Hellström" <thomas.hellstrom@linux.intel.com>
Subject: [PATCH v4 3/4] drm/xe/migrate: Clear CCS when clearing bo with XE_FAST_COLOR_BLT
Date: Mon, 1 Jul 2024 17:17:37 +0200 [thread overview]
Message-ID: <20240701151738.6749-3-nirmoy.das@intel.com> (raw)
In-Reply-To: <20240701151738.6749-1-nirmoy.das@intel.com>
XE_FAST_COLOR_BLT will clear out CCS meta data when clearing bo with
uncompress PTE, so skip emit_copy_ccs() when XE_FAST_COLOR_BLT is used
to clear out a bo.
Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
---
drivers/gpu/drm/xe/xe_migrate.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c
index e0a3f6921572..140afd4b1231 100644
--- a/drivers/gpu/drm/xe/xe_migrate.c
+++ b/drivers/gpu/drm/xe/xe_migrate.c
@@ -971,6 +971,13 @@ static u32 emit_clear_cmd_len(struct xe_gt *gt)
return XY_FAST_COLOR_BLT_DW;
}
+static bool can_fast_color_blt_cmd_clear_ccs(struct xe_gt *gt)
+{
+ /* On XE2 XY_FAST_COLOR_BLT can clear CCS with uncompress pte */
+ return (GRAPHICS_VERx100(gt_to_xe(gt)) >= 2000) &&
+ emit_clear_cmd_len(gt) == XY_FAST_COLOR_BLT_DW;
+}
+
static void emit_clear(struct xe_gt *gt, struct xe_bb *bb, u64 src_ofs,
u32 size, u32 pitch, bool is_vram)
{
@@ -1061,7 +1068,8 @@ struct dma_fence *xe_migrate_clear(struct xe_migrate *m,
if (clear_vram && xe_migrate_allow_identity(clear_L0, &src_it))
xe_res_next(&src_it, clear_L0);
else
- emit_pte(m, bb, clear_L0_pt, clear_vram, clear_ccs,
+ /* Use uncompressed pte so clear happens in the real memory. */
+ emit_pte(m, bb, clear_L0_pt, clear_vram, false,
&src_it, clear_L0, dst);
bb->cs[bb->len++] = MI_BATCH_BUFFER_END;
@@ -1070,7 +1078,9 @@ struct dma_fence *xe_migrate_clear(struct xe_migrate *m,
if (clear_bo_data)
emit_clear(gt, bb, clear_L0_ofs, clear_L0, XE_PAGE_SIZE, clear_vram);
- if (xe_device_has_flat_ccs(xe)) {
+ /* XY_FAST_COLOR_BLT on uncompress PTE will clear CCS metadata as well */
+ if (xe_device_has_flat_ccs(xe) && clear_ccs && !(clear_bo_data &&
+ can_fast_color_blt_cmd_clear_ccs(gt))) {
emit_copy_ccs(gt, bb, clear_L0_ofs, true,
m->cleared_mem_ofs, false, clear_L0);
flush_flags = MI_FLUSH_DW_CCS;
--
2.42.0
next prev parent reply other threads:[~2024-07-01 15:32 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-01 15:17 [PATCH v4 1/4] drm/ttm: Add a flag to allow drivers to skip clear-on-free Nirmoy Das
2024-07-01 15:17 ` [PATCH v4 2/4] drm/xe/migrate: Parameterize ccs and bo data clear in xe_migrate_clear() Nirmoy Das
2024-07-01 15:17 ` Nirmoy Das [this message]
2024-07-01 15:17 ` [PATCH v4 4/4] drm/xe/lnl: Offload system clear page activity to GPU Nirmoy Das
2024-07-01 18:54 ` ✓ CI.Patch_applied: success for series starting with [v4,1/4] drm/ttm: Add a flag to allow drivers to skip clear-on-free Patchwork
2024-07-01 18:55 ` ✗ CI.checkpatch: warning " Patchwork
2024-07-01 18:56 ` ✓ CI.KUnit: success " Patchwork
2024-07-01 19:08 ` ✓ CI.Build: " Patchwork
2024-07-01 19:10 ` ✗ CI.Hooks: failure " Patchwork
2024-07-01 19:11 ` ✗ CI.checksparse: warning " Patchwork
2024-07-01 19:34 ` ✓ CI.BAT: success " Patchwork
2024-07-01 21:20 ` ✗ CI.FULL: failure " Patchwork
2024-07-03 10:41 ` ✓ CI.Patch_applied: success for series starting with [v4,1/4] drm/ttm: Add a flag to allow drivers to skip clear-on-free (rev2) Patchwork
2024-07-03 10:42 ` ✗ CI.checkpatch: warning " Patchwork
2024-07-03 10:43 ` ✓ CI.KUnit: success " Patchwork
2024-07-03 10:55 ` ✓ CI.Build: " Patchwork
2024-07-03 10:57 ` ✗ CI.Hooks: failure " Patchwork
2024-07-03 10:58 ` ✗ CI.checksparse: warning " Patchwork
2024-07-03 11:22 ` ✓ CI.BAT: success " Patchwork
2024-07-03 12:23 ` ✓ 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=20240701151738.6749-3-nirmoy.das@intel.com \
--to=nirmoy.das@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=himal.prasad.ghimiray@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.auld@intel.com \
--cc=thomas.hellstrom@linux.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