summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/xe_migrate.c
diff options
context:
space:
mode:
authorHaridhar Kalvala <haridhar.kalvala@intel.com>2023-09-30 00:36:37 +0300
committerRodrigo Vivi <rodrigo.vivi@intel.com>2023-12-21 19:42:03 +0300
commit2c0ac321d9975d670541eb3da19064f67b3f995b (patch)
tree4bd725e24e3b255a5d88e18066534999be32b80c /drivers/gpu/drm/xe/xe_migrate.c
parent0dcac63649e37e176224f11f69a3c85653d0d887 (diff)
downloadlinux-2c0ac321d9975d670541eb3da19064f67b3f995b.tar.xz
drm/xe: Adjust mocs field mask definitions
Instead of using xe_mocs_index_to_value(), simply define the bitmask with the shift left applied. This will make it easier to adapt to new platforms that simply use the index. This also fixes PVC bug in emit_clear_link_copy() where the MOCS was getting shifted both by PVC_MS_MOCS_INDEX_MASK definition and by the xe_moc_index_to_value function. Bspec: 44509 Cc: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Haridhar Kalvala <haridhar.kalvala@intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Link: https://lore.kernel.org/r/20230929213640.3189912-2-lucas.demarchi@intel.com Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/xe_migrate.c')
-rw-r--r--drivers/gpu/drm/xe/xe_migrate.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c
index 77a2468ca85c..52c3a040c606 100644
--- a/drivers/gpu/drm/xe/xe_migrate.c
+++ b/drivers/gpu/drm/xe/xe_migrate.c
@@ -519,7 +519,7 @@ static void emit_copy_ccs(struct xe_gt *gt, struct xe_bb *bb,
{
u32 *cs = bb->cs + bb->len;
u32 num_ccs_blks;
- u32 mocs = xe_mocs_index_to_value(gt->mocs.uc_index);
+ u32 mocs = gt->mocs.uc_index;
num_ccs_blks = DIV_ROUND_UP(xe_device_ccs_bytes(gt_to_xe(gt), size),
NUM_CCS_BYTES_PER_BLOCK);
@@ -806,7 +806,7 @@ static void emit_clear_link_copy(struct xe_gt *gt, struct xe_bb *bb, u64 src_ofs
u32 size, u32 pitch)
{
u32 *cs = bb->cs + bb->len;
- u32 mocs = xe_mocs_index_to_value(gt->mocs.uc_index);
+ u32 mocs = gt->mocs.uc_index;
u32 len = PVC_MEM_SET_CMD_LEN_DW;
*cs++ = PVC_MEM_SET_CMD | PVC_MS_MATRIX | (len - 2);
@@ -828,7 +828,7 @@ static void emit_clear_main_copy(struct xe_gt *gt, struct xe_bb *bb,
struct xe_device *xe = gt_to_xe(gt);
u32 *cs = bb->cs + bb->len;
u32 len = XY_FAST_COLOR_BLT_DW;
- u32 mocs = xe_mocs_index_to_value(gt->mocs.uc_index);
+ u32 mocs = gt->mocs.uc_index;
if (GRAPHICS_VERx100(xe) < 1250)
len = 11;