Lines Matching refs:bb
559 struct xe_bb *bb, u32 at_pt, in emit_pte() argument
583 bb->cs[bb->len++] = MI_STORE_DATA_IMM | MI_SDI_NUM_QW(chunk); in emit_pte()
584 bb->cs[bb->len++] = ofs; in emit_pte()
585 bb->cs[bb->len++] = 0; in emit_pte()
613 bb->cs[bb->len++] = lower_32_bits(addr); in emit_pte()
614 bb->cs[bb->len++] = upper_32_bits(addr); in emit_pte()
623 static void emit_copy_ccs(struct xe_gt *gt, struct xe_bb *bb, in emit_copy_ccs() argument
629 u32 *cs = bb->cs + bb->len; in emit_copy_ccs()
660 bb->len = cs - bb->cs; in emit_copy_ccs()
664 static void emit_copy(struct xe_gt *gt, struct xe_bb *bb, in emit_copy() argument
683 bb->cs[bb->len++] = XY_FAST_COPY_BLT_CMD | (10 - 2); in emit_copy()
684 bb->cs[bb->len++] = XY_FAST_COPY_BLT_DEPTH_32 | pitch | tile_y | mocs; in emit_copy()
685 bb->cs[bb->len++] = 0; in emit_copy()
686 bb->cs[bb->len++] = (size / pitch) << 16 | pitch / 4; in emit_copy()
687 bb->cs[bb->len++] = lower_32_bits(dst_ofs); in emit_copy()
688 bb->cs[bb->len++] = upper_32_bits(dst_ofs); in emit_copy()
689 bb->cs[bb->len++] = 0; in emit_copy()
690 bb->cs[bb->len++] = pitch | mocs; in emit_copy()
691 bb->cs[bb->len++] = lower_32_bits(src_ofs); in emit_copy()
692 bb->cs[bb->len++] = upper_32_bits(src_ofs); in emit_copy()
701 struct xe_bb *bb, in xe_migrate_ccs_copy() argument
720 emit_copy_ccs(gt, bb, in xe_migrate_ccs_copy()
733 emit_copy_ccs(gt, bb, dst_ofs, dst_is_indirect, src_ofs, in xe_migrate_ccs_copy()
814 struct xe_bb *bb; in xe_migrate_copy() local
857 bb = xe_bb_new(gt, batch_size, usm); in xe_migrate_copy()
858 if (IS_ERR(bb)) { in xe_migrate_copy()
859 err = PTR_ERR(bb); in xe_migrate_copy()
866 emit_pte(m, bb, src_L0_pt, src_is_vram, copy_system_ccs || use_comp_pat, in xe_migrate_copy()
872 emit_pte(m, bb, dst_L0_pt, dst_is_vram, copy_system_ccs, in xe_migrate_copy()
876 emit_pte(m, bb, ccs_pt, false, false, &ccs_it, ccs_size, src); in xe_migrate_copy()
878 bb->cs[bb->len++] = MI_BATCH_BUFFER_END; in xe_migrate_copy()
879 update_idx = bb->len; in xe_migrate_copy()
882 emit_copy(gt, bb, src_L0_ofs, dst_L0_ofs, src_L0, XE_PAGE_SIZE); in xe_migrate_copy()
885 flush_flags = xe_migrate_ccs_copy(m, bb, src_L0_ofs, in xe_migrate_copy()
891 job = xe_bb_create_migration_job(m->q, bb, in xe_migrate_copy()
921 xe_bb_free(bb, fence); in xe_migrate_copy()
928 xe_bb_free(bb, NULL); in xe_migrate_copy()
943 static void emit_clear_link_copy(struct xe_gt *gt, struct xe_bb *bb, u64 src_ofs, in emit_clear_link_copy() argument
947 u32 *cs = bb->cs + bb->len; in emit_clear_link_copy()
961 xe_gt_assert(gt, cs - bb->cs == len + bb->len); in emit_clear_link_copy()
963 bb->len += len; in emit_clear_link_copy()
966 static void emit_clear_main_copy(struct xe_gt *gt, struct xe_bb *bb, in emit_clear_main_copy() argument
970 u32 *cs = bb->cs + bb->len; in emit_clear_main_copy()
1002 xe_gt_assert(gt, cs - bb->cs == len + bb->len); in emit_clear_main_copy()
1004 bb->len += len; in emit_clear_main_copy()
1029 static void emit_clear(struct xe_gt *gt, struct xe_bb *bb, u64 src_ofs, in emit_clear() argument
1033 emit_clear_link_copy(gt, bb, src_ofs, size, pitch); in emit_clear()
1035 emit_clear_main_copy(gt, bb, src_ofs, size, pitch, in emit_clear()
1089 struct xe_bb *bb; in xe_migrate_clear() local
1114 bb = xe_bb_new(gt, batch_size, usm); in xe_migrate_clear()
1115 if (IS_ERR(bb)) { in xe_migrate_clear()
1116 err = PTR_ERR(bb); in xe_migrate_clear()
1125 emit_pte(m, bb, clear_L0_pt, clear_vram, clear_only_system_ccs, in xe_migrate_clear()
1128 bb->cs[bb->len++] = MI_BATCH_BUFFER_END; in xe_migrate_clear()
1129 update_idx = bb->len; in xe_migrate_clear()
1132 emit_clear(gt, bb, clear_L0_ofs, clear_L0, XE_PAGE_SIZE, clear_vram); in xe_migrate_clear()
1135 emit_copy_ccs(gt, bb, clear_L0_ofs, true, in xe_migrate_clear()
1140 job = xe_bb_create_migration_job(m->q, bb, in xe_migrate_clear()
1173 xe_bb_free(bb, fence); in xe_migrate_clear()
1179 xe_bb_free(bb, NULL); in xe_migrate_clear()
1196 static void write_pgtable(struct xe_tile *tile, struct xe_bb *bb, u64 ppgtt_ofs, in write_pgtable() argument
1226 if (!(bb->len & 1)) in write_pgtable()
1227 bb->cs[bb->len++] = MI_NOOP; in write_pgtable()
1229 bb->cs[bb->len++] = MI_STORE_DATA_IMM | MI_SDI_NUM_QW(chunk); in write_pgtable()
1230 bb->cs[bb->len++] = lower_32_bits(addr); in write_pgtable()
1231 bb->cs[bb->len++] = upper_32_bits(addr); in write_pgtable()
1233 ops->populate(pt_update, tile, NULL, bb->cs + bb->len, in write_pgtable()
1236 ops->clear(pt_update, tile, NULL, bb->cs + bb->len, in write_pgtable()
1239 bb->len += chunk * 2; in write_pgtable()
1322 struct xe_bb *bb; in __xe_migrate_update_pgtables() local
1351 bb = xe_bb_new(gt, batch_size, usm); in __xe_migrate_update_pgtables()
1352 if (IS_ERR(bb)) in __xe_migrate_update_pgtables()
1353 return ERR_CAST(bb); in __xe_migrate_update_pgtables()
1393 bb->cs[bb->len++] = MI_STORE_DATA_IMM | in __xe_migrate_update_pgtables()
1395 bb->cs[bb->len++] = ofs; in __xe_migrate_update_pgtables()
1396 bb->cs[bb->len++] = 0; /* upper_32_bits */ in __xe_migrate_update_pgtables()
1418 bb->cs[bb->len++] = lower_32_bits(addr); in __xe_migrate_update_pgtables()
1419 bb->cs[bb->len++] = upper_32_bits(addr); in __xe_migrate_update_pgtables()
1430 bb->cs[bb->len++] = MI_BATCH_BUFFER_END; in __xe_migrate_update_pgtables()
1431 update_idx = bb->len; in __xe_migrate_update_pgtables()
1443 write_pgtable(tile, bb, addr + in __xe_migrate_update_pgtables()
1450 bb->cs[bb->len++] = MI_BATCH_BUFFER_END; in __xe_migrate_update_pgtables()
1451 update_idx = bb->len; in __xe_migrate_update_pgtables()
1459 write_pgtable(tile, bb, 0, pt_op, &updates[j], in __xe_migrate_update_pgtables()
1464 job = xe_bb_create_migration_job(pt_update_ops->q, bb, in __xe_migrate_update_pgtables()
1488 xe_bb_free(bb, fence); in __xe_migrate_update_pgtables()
1498 xe_bb_free(bb, NULL); in __xe_migrate_update_pgtables()
1573 struct xe_bb *bb, u32 pt_offset, in build_pt_update_batch_sram() argument
1584 bb->cs[bb->len++] = MI_STORE_DATA_IMM | MI_SDI_NUM_QW(chunk); in build_pt_update_batch_sram()
1585 bb->cs[bb->len++] = pt_offset; in build_pt_update_batch_sram()
1586 bb->cs[bb->len++] = 0; in build_pt_update_batch_sram()
1598 bb->cs[bb->len++] = lower_32_bits(addr); in build_pt_update_batch_sram()
1599 bb->cs[bb->len++] = upper_32_bits(addr); in build_pt_update_batch_sram()
1625 struct xe_bb *bb; in xe_migrate_vram() local
1641 bb = xe_bb_new(gt, batch_size, use_usm_batch); in xe_migrate_vram()
1642 if (IS_ERR(bb)) { in xe_migrate_vram()
1643 err = PTR_ERR(bb); in xe_migrate_vram()
1647 build_pt_update_batch_sram(m, bb, pt_slot * XE_PAGE_SIZE, in xe_migrate_vram()
1659 bb->cs[bb->len++] = MI_BATCH_BUFFER_END; in xe_migrate_vram()
1660 update_idx = bb->len; in xe_migrate_vram()
1662 emit_copy(gt, bb, src_L0_ofs, dst_L0_ofs, len, pitch); in xe_migrate_vram()
1664 job = xe_bb_create_migration_job(m->q, bb, in xe_migrate_vram()
1683 xe_bb_free(bb, fence); in xe_migrate_vram()
1688 xe_bb_free(bb, NULL); in xe_migrate_vram()