Lines Matching full:snapshot
135 return >->sriov.pf.vfs[vfid].snapshot; in pf_pick_vf_snapshot()
138 static unsigned int pf_snapshot_index(struct xe_gt *gt, struct xe_gt_sriov_state_snapshot *snapshot) in pf_snapshot_index() argument
140 return container_of(snapshot, struct xe_gt_sriov_metadata, snapshot) - gt->sriov.pf.vfs; in pf_snapshot_index()
143 static void pf_free_guc_state(struct xe_gt *gt, struct xe_gt_sriov_state_snapshot *snapshot) in pf_free_guc_state() argument
147 drmm_kfree(&xe->drm, snapshot->guc.buff); in pf_free_guc_state()
148 snapshot->guc.buff = NULL; in pf_free_guc_state()
149 snapshot->guc.size = 0; in pf_free_guc_state()
153 struct xe_gt_sriov_state_snapshot *snapshot, in pf_alloc_guc_state() argument
159 pf_free_guc_state(gt, snapshot); in pf_alloc_guc_state()
174 snapshot->guc.buff = p; in pf_alloc_guc_state()
175 snapshot->guc.size = size; in pf_alloc_guc_state()
179 static void pf_dump_guc_state(struct xe_gt *gt, struct xe_gt_sriov_state_snapshot *snapshot) in pf_dump_guc_state() argument
182 unsigned int vfid __maybe_unused = pf_snapshot_index(gt, snapshot); in pf_dump_guc_state()
185 vfid, snapshot->guc.size / sizeof(u32)); in pf_dump_guc_state()
187 snapshot->guc.buff, min(SZ_64, snapshot->guc.size)); in pf_dump_guc_state()
193 struct xe_gt_sriov_state_snapshot *snapshot = pf_pick_vf_snapshot(gt, vfid); in pf_save_vf_guc_state() local
203 ret = pf_alloc_guc_state(gt, snapshot, size); in pf_save_vf_guc_state()
207 ret = pf_send_guc_save_vf_state(gt, vfid, snapshot->guc.buff, size); in pf_save_vf_guc_state()
212 xe_gt_assert(gt, size <= snapshot->guc.size); in pf_save_vf_guc_state()
213 snapshot->guc.size = size; in pf_save_vf_guc_state()
215 pf_dump_guc_state(gt, snapshot); in pf_save_vf_guc_state()
220 pf_free_guc_state(gt, snapshot); in pf_save_vf_guc_state()
225 * xe_gt_sriov_pf_migration_save_guc_state() - Take a GuC VF state snapshot.
253 struct xe_gt_sriov_state_snapshot *snapshot = pf_pick_vf_snapshot(gt, vfid); in pf_restore_vf_guc_state() local
256 if (!snapshot->guc.size) in pf_restore_vf_guc_state()
260 snapshot->guc.size / sizeof(u32), vfid); in pf_restore_vf_guc_state()
261 ret = pf_send_guc_restore_vf_state(gt, vfid, snapshot->guc.buff, snapshot->guc.size); in pf_restore_vf_guc_state()
319 struct xe_gt_sriov_state_snapshot *snapshot; in xe_gt_sriov_pf_migration_read_guc_state() local
330 snapshot = pf_pick_vf_snapshot(gt, vfid); in xe_gt_sriov_pf_migration_read_guc_state()
331 if (snapshot->guc.size) in xe_gt_sriov_pf_migration_read_guc_state()
332 ret = simple_read_from_buffer(buf, count, pos, snapshot->guc.buff, in xe_gt_sriov_pf_migration_read_guc_state()
333 snapshot->guc.size); in xe_gt_sriov_pf_migration_read_guc_state()
358 struct xe_gt_sriov_state_snapshot *snapshot; in xe_gt_sriov_pf_migration_write_guc_state() local
370 snapshot = pf_pick_vf_snapshot(gt, vfid); in xe_gt_sriov_pf_migration_write_guc_state()
371 ret = pf_alloc_guc_state(gt, snapshot, size); in xe_gt_sriov_pf_migration_write_guc_state()
373 ret = simple_write_to_buffer(snapshot->guc.buff, size, &pos, buf, size); in xe_gt_sriov_pf_migration_write_guc_state()
375 pf_free_guc_state(gt, snapshot); in xe_gt_sriov_pf_migration_write_guc_state()
377 pf_dump_guc_state(gt, snapshot); in xe_gt_sriov_pf_migration_write_guc_state()