Lines Matching full:snapshot
1150 struct guc_ctb_snapshot *snapshot, in guc_ctb_snapshot_capture() argument
1155 xe_map_memcpy_from(xe, &snapshot->desc, &ctb->desc, 0, in guc_ctb_snapshot_capture()
1157 memcpy(&snapshot->info, &ctb->info, sizeof(struct guc_ctb_info)); in guc_ctb_snapshot_capture()
1159 snapshot->cmds = kmalloc_array(ctb->info.size, sizeof(u32), in guc_ctb_snapshot_capture()
1162 if (!snapshot->cmds) { in guc_ctb_snapshot_capture()
1163 drm_err(&xe->drm, "Skipping CTB commands snapshot. Only CTB info will be available.\n"); in guc_ctb_snapshot_capture()
1167 head = snapshot->desc.head; in guc_ctb_snapshot_capture()
1168 tail = snapshot->desc.tail; in guc_ctb_snapshot_capture()
1175 snapshot->cmds[head] = xe_map_rd(xe, &map, 0, u32); in guc_ctb_snapshot_capture()
1187 static void guc_ctb_snapshot_print(struct guc_ctb_snapshot *snapshot, in guc_ctb_snapshot_print() argument
1192 drm_printf(p, "\tsize: %d\n", snapshot->info.size); in guc_ctb_snapshot_print()
1193 drm_printf(p, "\tresv_space: %d\n", snapshot->info.resv_space); in guc_ctb_snapshot_print()
1194 drm_printf(p, "\thead: %d\n", snapshot->info.head); in guc_ctb_snapshot_print()
1195 drm_printf(p, "\ttail: %d\n", snapshot->info.tail); in guc_ctb_snapshot_print()
1196 drm_printf(p, "\tspace: %d\n", snapshot->info.space); in guc_ctb_snapshot_print()
1197 drm_printf(p, "\tbroken: %d\n", snapshot->info.broken); in guc_ctb_snapshot_print()
1198 drm_printf(p, "\thead (memory): %d\n", snapshot->desc.head); in guc_ctb_snapshot_print()
1199 drm_printf(p, "\ttail (memory): %d\n", snapshot->desc.tail); in guc_ctb_snapshot_print()
1200 drm_printf(p, "\tstatus (memory): 0x%x\n", snapshot->desc.status); in guc_ctb_snapshot_print()
1202 if (!snapshot->cmds) in guc_ctb_snapshot_print()
1205 head = snapshot->desc.head; in guc_ctb_snapshot_print()
1206 tail = snapshot->desc.tail; in guc_ctb_snapshot_print()
1210 snapshot->cmds[head]); in guc_ctb_snapshot_print()
1212 if (head == snapshot->info.size) in guc_ctb_snapshot_print()
1217 static void guc_ctb_snapshot_free(struct guc_ctb_snapshot *snapshot) in guc_ctb_snapshot_free() argument
1219 kfree(snapshot->cmds); in guc_ctb_snapshot_free()
1223 * xe_guc_ct_snapshot_capture - Take a quick snapshot of the CT state.
1231 * Returns: a GuC CT snapshot object that must be freed by the caller
1238 struct xe_guc_ct_snapshot *snapshot; in xe_guc_ct_snapshot_capture() local
1240 snapshot = kzalloc(sizeof(*snapshot), in xe_guc_ct_snapshot_capture()
1243 if (!snapshot) { in xe_guc_ct_snapshot_capture()
1244 drm_err(&xe->drm, "Skipping CTB snapshot entirely.\n"); in xe_guc_ct_snapshot_capture()
1249 snapshot->ct_enabled = true; in xe_guc_ct_snapshot_capture()
1250 snapshot->g2h_outstanding = READ_ONCE(ct->g2h_outstanding); in xe_guc_ct_snapshot_capture()
1252 &snapshot->h2g, atomic); in xe_guc_ct_snapshot_capture()
1254 &snapshot->g2h, atomic); in xe_guc_ct_snapshot_capture()
1257 return snapshot; in xe_guc_ct_snapshot_capture()
1261 * xe_guc_ct_snapshot_print - Print out a given GuC CT snapshot.
1262 * @snapshot: GuC CT snapshot object.
1265 * This function prints out a given GuC CT snapshot object.
1267 void xe_guc_ct_snapshot_print(struct xe_guc_ct_snapshot *snapshot, in xe_guc_ct_snapshot_print() argument
1270 if (!snapshot) in xe_guc_ct_snapshot_print()
1273 if (snapshot->ct_enabled) { in xe_guc_ct_snapshot_print()
1275 guc_ctb_snapshot_print(&snapshot->h2g, p); in xe_guc_ct_snapshot_print()
1278 guc_ctb_snapshot_print(&snapshot->g2h, p); in xe_guc_ct_snapshot_print()
1281 snapshot->g2h_outstanding); in xe_guc_ct_snapshot_print()
1288 * xe_guc_ct_snapshot_free - Free all allocated objects for a given snapshot.
1289 * @snapshot: GuC CT snapshot object.
1294 void xe_guc_ct_snapshot_free(struct xe_guc_ct_snapshot *snapshot) in xe_guc_ct_snapshot_free() argument
1296 if (!snapshot) in xe_guc_ct_snapshot_free()
1299 guc_ctb_snapshot_free(&snapshot->h2g); in xe_guc_ct_snapshot_free()
1300 guc_ctb_snapshot_free(&snapshot->g2h); in xe_guc_ct_snapshot_free()
1301 kfree(snapshot); in xe_guc_ct_snapshot_free()
1311 * This function quickly capture a snapshot and immediately print it out.
1315 struct xe_guc_ct_snapshot *snapshot; in xe_guc_ct_print() local
1317 snapshot = xe_guc_ct_snapshot_capture(ct, atomic); in xe_guc_ct_print()
1318 xe_guc_ct_snapshot_print(snapshot, p); in xe_guc_ct_print()
1319 xe_guc_ct_snapshot_free(snapshot); in xe_guc_ct_print()