aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaridhar Kalvala <[email protected]>2023-09-29 14:36:39 -0700
committerRodrigo Vivi <[email protected]>2023-12-21 11:42:04 -0500
commit4bdd8c2ed9572b757521e981cfb35a3581c112c8 (patch)
tree1e3d621d4c88b1a6771ec4ff6698aae36eb97327
parentc690f0e6b7e61826535eb91a28bf99197345faf2 (diff)
drm/xe/xe2: Set tile y type in XY_FAST_COPY_BLT to Tile4
Set bits 30 and 31 of XY_FAST_COPY_BLT's dword1 for XeHP and above. Destination or source being Y-Major is selected on dword0 and there's nothing to set on dword1. According to the bspec for Xe2, "Behavior is undefined when programmed the value 0". Also for XeHP, the only value allowed in those bits is 0b11, not being possible to select "Legacy Tile-Y" anymore, only the newer Tile4. So, unconditionally set those bits for graphics IP 12.50 and above. v2: Reword commit message and extend it to graphics version >= 12.50 (Matt Roper) Bspec: 57567 Cc: Matt Roper <[email protected]> Signed-off-by: Haridhar Kalvala <[email protected]> Reviewed-by: Matt Roper <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lucas De Marchi <[email protected]> Signed-off-by: Rodrigo Vivi <[email protected]>
-rw-r--r--drivers/gpu/drm/xe/regs/xe_gpu_commands.h2
-rw-r--r--drivers/gpu/drm/xe/xe_migrate.c9
2 files changed, 10 insertions, 1 deletions
diff --git a/drivers/gpu/drm/xe/regs/xe_gpu_commands.h b/drivers/gpu/drm/xe/regs/xe_gpu_commands.h
index 1fdf2e4f1c9f..cc7b56763f10 100644
--- a/drivers/gpu/drm/xe/regs/xe_gpu_commands.h
+++ b/drivers/gpu/drm/xe/regs/xe_gpu_commands.h
@@ -57,6 +57,8 @@
#define XY_FAST_COPY_BLT_CMD (2 << 29 | 0x42 << 22)
#define XY_FAST_COPY_BLT_DEPTH_32 (3<<24)
+#define XY_FAST_COPY_BLT_D1_SRC_TILE4 REG_BIT(31)
+#define XY_FAST_COPY_BLT_D1_DST_TILE4 REG_BIT(30)
#define PVC_MEM_SET_CMD (2 << 29 | 0x5b << 22)
#define PVC_MEM_SET_CMD_LEN_DW 7
diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c
index 313e3c0a6e90..69488a0fada4 100644
--- a/drivers/gpu/drm/xe/xe_migrate.c
+++ b/drivers/gpu/drm/xe/xe_migrate.c
@@ -543,12 +543,19 @@ static void emit_copy(struct xe_gt *gt, struct xe_bb *bb,
u64 src_ofs, u64 dst_ofs, unsigned int size,
unsigned int pitch)
{
+ struct xe_device *xe = gt_to_xe(gt);
+
xe_gt_assert(gt, size / pitch <= S16_MAX);
xe_gt_assert(gt, pitch / 4 <= S16_MAX);
xe_gt_assert(gt, pitch <= U16_MAX);
bb->cs[bb->len++] = XY_FAST_COPY_BLT_CMD | (10 - 2);
- bb->cs[bb->len++] = XY_FAST_COPY_BLT_DEPTH_32 | pitch;
+ if (GRAPHICS_VERx100(xe) >= 1250)
+ bb->cs[bb->len++] = XY_FAST_COPY_BLT_DEPTH_32 | pitch |
+ XY_FAST_COPY_BLT_D1_SRC_TILE4 |
+ XY_FAST_COPY_BLT_D1_DST_TILE4;
+ else
+ bb->cs[bb->len++] = XY_FAST_COPY_BLT_DEPTH_32 | pitch;
bb->cs[bb->len++] = 0;
bb->cs[bb->len++] = (size / pitch) << 16 | pitch / 4;
bb->cs[bb->len++] = lower_32_bits(dst_ofs);