Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Nirmoy Das <nirmoy.das@intel.com>
To: intel-xe@lists.freedesktop.org
Subject: [CI 3/4] drm/xe/migrate: Clear CCS when clearing bo with XE_FAST_COLOR_BLT
Date: Fri, 28 Jun 2024 21:38:45 +0200	[thread overview]
Message-ID: <20240628193846.26326-3-nirmoy.das@intel.com> (raw)
In-Reply-To: <20240628193846.26326-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.

Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
---
 drivers/gpu/drm/xe/xe_migrate.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c
index e0a3f6921572..9a3f32e90bfc 100644
--- a/drivers/gpu/drm/xe/xe_migrate.c
+++ b/drivers/gpu/drm/xe/xe_migrate.c
@@ -971,6 +971,11 @@ static u32 emit_clear_cmd_len(struct xe_gt *gt)
 		return XY_FAST_COLOR_BLT_DW;
 }
 
+static bool is_fast_color_blt_cmd_for_clear(struct xe_gt *gt)
+{
+	return 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 +1066,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 +1076,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 &&
+		    !is_fast_color_blt_cmd_for_clear(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


  parent reply	other threads:[~2024-06-28 19:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-28 19:38 [CI 1/4] drm/ttm: Add a flag to allow drivers to skip clear-on-free Nirmoy Das
2024-06-28 19:38 ` [CI 2/4] drm/xe/migrate: Parameterize ccs and bo data clear in xe_migrate_clear() Nirmoy Das
2024-06-28 19:38 ` Nirmoy Das [this message]
2024-06-28 19:38 ` [CI 4/4] drm/xe/lnl: Offload system clear page activity to GPU Nirmoy Das
2024-06-29 20:35 ` ✓ CI.Patch_applied: success for series starting with [CI,1/4] drm/ttm: Add a flag to allow drivers to skip clear-on-free (rev2) Patchwork
2024-06-29 20:35 ` ✗ CI.checkpatch: warning " Patchwork
2024-06-29 20:36 ` ✓ CI.KUnit: success " Patchwork
2024-06-29 20:48 ` ✓ CI.Build: " Patchwork
2024-06-29 20:50 ` ✗ CI.Hooks: failure " Patchwork
2024-06-29 20:52 ` ✗ CI.checksparse: warning " Patchwork
2024-06-29 21:15 ` ✓ CI.BAT: success " Patchwork
2024-06-29 22:16 ` ✗ CI.FULL: 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=20240628193846.26326-3-nirmoy.das@intel.com \
    --to=nirmoy.das@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