From: Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: Matt Roper <matthew.d.roper@intel.com>,
Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com>
Subject: [PATCH v2 2/3] drm/xe: Refactor emit_clear_link_copy
Date: Mon, 11 May 2026 18:07:49 +0530 [thread overview]
Message-ID: <20260511123746.616662-7-balasubramani.vivekanandan@intel.com> (raw)
In-Reply-To: <20260511123746.616662-5-balasubramani.vivekanandan@intel.com>
Implement a function to return the length of the MEM_SET instruction.
This is to prepare for future platforms where the length of MEM_SET
instruction is expected to change.
Signed-off-by: Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com>
---
drivers/gpu/drm/xe/instructions/xe_gpu_commands.h | 1 -
drivers/gpu/drm/xe/xe_migrate.c | 9 +++++++--
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/xe/instructions/xe_gpu_commands.h b/drivers/gpu/drm/xe/instructions/xe_gpu_commands.h
index 4546c8f10516..edd204b8dfe5 100644
--- a/drivers/gpu/drm/xe/instructions/xe_gpu_commands.h
+++ b/drivers/gpu/drm/xe/instructions/xe_gpu_commands.h
@@ -37,7 +37,6 @@
#define MEM_COPY_DST_MOCS_INDEX_MASK GENMASK(6, 3)
#define PVC_MEM_SET_CMD (2 << 29 | 0x5b << 22)
-#define PVC_MEM_SET_CMD_LEN_DW 7
#define PVC_MEM_SET_MATRIX REG_BIT(17)
#define PVC_MEM_SET_DATA_FIELD GENMASK(31, 24)
/* Bspec lists field as [6:0], but index alone is from [6:1] */
diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c
index 6ffd50050e3e..4f9be41b2f64 100644
--- a/drivers/gpu/drm/xe/xe_migrate.c
+++ b/drivers/gpu/drm/xe/xe_migrate.c
@@ -1461,12 +1461,17 @@ struct dma_fence *xe_migrate_vram_copy_chunk(struct xe_bo *vram_bo, u64 vram_off
return fence;
}
+static u32 blt_mem_set_cmd_len(struct xe_device *xe)
+{
+ return 7;
+}
+
static void emit_clear_link_copy(struct xe_gt *gt, struct xe_bb *bb, u64 src_ofs,
u32 size, u32 pitch)
{
struct xe_device *xe = gt_to_xe(gt);
u32 *cs = bb->cs + bb->len;
- u32 len = PVC_MEM_SET_CMD_LEN_DW;
+ u32 len = blt_mem_set_cmd_len(xe);
*cs++ = PVC_MEM_SET_CMD | PVC_MEM_SET_MATRIX | (len - 2);
*cs++ = pitch - 1;
@@ -1536,7 +1541,7 @@ static u32 emit_clear_cmd_len(struct xe_gt *gt)
struct xe_device *xe = gt_to_xe(gt);
if (gt->info.has_xe2_blt_instructions)
- return PVC_MEM_SET_CMD_LEN_DW;
+ return blt_mem_set_cmd_len(xe);
else
return blt_fast_color_cmd_len(xe);
}
--
2.43.0
next prev parent reply other threads:[~2026-05-11 12:32 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-11 12:37 [PATCH v2 0/3] Refactor functions implementing the blt batch buffer Balasubramani Vivekanandan
2026-05-11 12:37 ` [PATCH v2 1/3] drm/xe: Refactor emit_clear_main_copy Balasubramani Vivekanandan
2026-05-11 19:30 ` Matt Roper
2026-05-11 12:37 ` Balasubramani Vivekanandan [this message]
2026-05-11 19:34 ` [PATCH v2 2/3] drm/xe: Refactor emit_clear_link_copy Matt Roper
2026-05-11 12:37 ` [PATCH v2 3/3] drm/xe: Refactor emit_xy_fast_copy and emit_mem_copy functions Balasubramani Vivekanandan
2026-05-11 19:45 ` Matt Roper
2026-05-11 17:25 ` ✓ CI.KUnit: success for Refactor functions implementing the blt batch buffer (rev2) Patchwork
2026-05-11 18:16 ` ✓ Xe.CI.BAT: " Patchwork
2026-05-11 20:29 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-05-12 5:27 ` Vivekanandan, Balasubramani
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=20260511123746.616662-7-balasubramani.vivekanandan@intel.com \
--to=balasubramani.vivekanandan@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--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