Lines Matching refs:guc

292 guc_capture_alloc_steered_lists(struct intel_guc *guc,  in guc_capture_alloc_steered_lists()  argument
295 struct intel_gt *gt = guc_to_gt(guc); in guc_capture_alloc_steered_lists()
307 if (!list || guc->capture->extlists) in guc_capture_alloc_steered_lists()
347 guc_dbg(guc, "capture found %d ext-regs.\n", num_tot_regs); in guc_capture_alloc_steered_lists()
348 guc->capture->extlists = extlists; in guc_capture_alloc_steered_lists()
352 guc_capture_get_device_reglist(struct intel_guc *guc) in guc_capture_get_device_reglist() argument
354 struct drm_i915_private *i915 = guc_to_i915(guc); in guc_capture_get_device_reglist()
368 guc_capture_alloc_steered_lists(guc, lists); in guc_capture_get_device_reglist()
412 guc_capture_list_init(struct intel_guc *guc, u32 owner, u32 type, u32 classid, in guc_capture_list_init() argument
416 const struct __guc_mmio_reg_descr_group *reglists = guc->capture->reglists; in guc_capture_list_init()
417 struct __guc_mmio_reg_descr_group *extlists = guc->capture->extlists; in guc_capture_list_init()
447 guc_dbg(guc, "Got short capture reglist init: %d out %d.\n", i, num_entries); in guc_capture_list_init()
473 guc_capture_getlistsize(struct intel_guc *guc, u32 owner, u32 type, u32 classid, in guc_capture_getlistsize() argument
476 struct intel_guc_state_capture *gc = guc->capture; in guc_capture_getlistsize()
481 guc_warn(guc, "No capture reglist for this device\n"); in guc_capture_getlistsize()
493 guc_warn(guc, "Missing capture reglist: global!\n"); in guc_capture_getlistsize()
495 guc_warn(guc, "Missing capture reglist: %s(%u):%s(%u)!\n", in guc_capture_getlistsize()
514 intel_guc_capture_getlistsize(struct intel_guc *guc, u32 owner, u32 type, u32 classid, in intel_guc_capture_getlistsize() argument
517 return guc_capture_getlistsize(guc, owner, type, classid, size, false); in intel_guc_capture_getlistsize()
520 static void guc_capture_create_prealloc_nodes(struct intel_guc *guc);
523 intel_guc_capture_getlist(struct intel_guc *guc, u32 owner, u32 type, u32 classid, in intel_guc_capture_getlist() argument
526 struct intel_guc_state_capture *gc = guc->capture; in intel_guc_capture_getlist()
545 guc_capture_create_prealloc_nodes(guc); in intel_guc_capture_getlist()
547 ret = intel_guc_capture_getlistsize(guc, owner, type, classid, &size); in intel_guc_capture_getlist()
558 guc_dbg(guc, "Failed to alloc cached register capture list"); in intel_guc_capture_getlist()
564 num_regs = guc_cap_list_num_regs(guc->capture, owner, type, classid); in intel_guc_capture_getlist()
570 guc_capture_list_init(guc, owner, type, classid, (struct guc_mmio_reg *)tmp, num_regs); in intel_guc_capture_getlist()
584 intel_guc_capture_getnullheader(struct intel_guc *guc, in intel_guc_capture_getnullheader() argument
587 struct intel_guc_state_capture *gc = guc->capture; in intel_guc_capture_getnullheader()
599 guc_dbg(guc, "Failed to alloc cached register capture null list"); in intel_guc_capture_getnullheader()
611 guc_capture_output_min_size_est(struct intel_guc *guc) in guc_capture_output_min_size_est() argument
613 struct intel_gt *gt = guc_to_gt(guc); in guc_capture_output_min_size_est()
619 if (!guc->capture) in guc_capture_output_min_size_est()
637 if (!guc_capture_getlistsize(guc, 0, GUC_CAPTURE_LIST_TYPE_GLOBAL, 0, &tmp, true)) in guc_capture_output_min_size_est()
640 if (!guc_capture_getlistsize(guc, 0, GUC_CAPTURE_LIST_TYPE_ENGINE_CLASS, in guc_capture_output_min_size_est()
644 if (!guc_capture_getlistsize(guc, 0, GUC_CAPTURE_LIST_TYPE_ENGINE_INSTANCE, in guc_capture_output_min_size_est()
659 static void check_guc_capture_size(struct intel_guc *guc) in check_guc_capture_size() argument
661 int min_size = guc_capture_output_min_size_est(guc); in check_guc_capture_size()
663 u32 buffer_size = intel_guc_log_section_size_capture(&guc->log); in check_guc_capture_size()
674 guc_warn(guc, "Failed to calculate error state capture buffer minimum size: %d!\n", in check_guc_capture_size()
677 guc_warn(guc, "Error state capture buffer maybe small: %d < %d\n", in check_guc_capture_size()
680 guc_dbg(guc, "Error state capture buffer lacks spare size: %d < %d (min = %d)\n", in check_guc_capture_size()
778 guc_capture_log_remove_dw(struct intel_guc *guc, struct __guc_capture_bufstate *buf, in guc_capture_log_remove_dw() argument
797 guc_dbg(guc, "Register capture log not dword aligned, skipping.\n"); in guc_capture_log_remove_dw()
817 guc_capture_log_get_group_hdr(struct intel_guc *guc, struct __guc_capture_bufstate *buf, in guc_capture_log_get_group_hdr() argument
829 read += guc_capture_log_remove_dw(guc, buf, &ghdr->owner); in guc_capture_log_get_group_hdr()
830 read += guc_capture_log_remove_dw(guc, buf, &ghdr->info); in guc_capture_log_get_group_hdr()
838 guc_capture_log_get_data_hdr(struct intel_guc *guc, struct __guc_capture_bufstate *buf, in guc_capture_log_get_data_hdr() argument
850 read += guc_capture_log_remove_dw(guc, buf, &hdr->owner); in guc_capture_log_get_data_hdr()
851 read += guc_capture_log_remove_dw(guc, buf, &hdr->info); in guc_capture_log_get_data_hdr()
852 read += guc_capture_log_remove_dw(guc, buf, &hdr->lrca); in guc_capture_log_get_data_hdr()
853 read += guc_capture_log_remove_dw(guc, buf, &hdr->guc_id); in guc_capture_log_get_data_hdr()
854 read += guc_capture_log_remove_dw(guc, buf, &hdr->num_mmios); in guc_capture_log_get_data_hdr()
862 guc_capture_log_get_register(struct intel_guc *guc, struct __guc_capture_bufstate *buf, in guc_capture_log_get_register() argument
874 read += guc_capture_log_remove_dw(guc, buf, &reg->offset); in guc_capture_log_get_register()
875 read += guc_capture_log_remove_dw(guc, buf, &reg->value); in guc_capture_log_get_register()
876 read += guc_capture_log_remove_dw(guc, buf, &reg->flags); in guc_capture_log_get_register()
877 read += guc_capture_log_remove_dw(guc, buf, &reg->mask); in guc_capture_log_get_register()
885 guc_capture_delete_one_node(struct intel_guc *guc, struct __guc_capture_parsed_output *node) in guc_capture_delete_one_node() argument
896 guc_capture_delete_prealloc_nodes(struct intel_guc *guc) in guc_capture_delete_prealloc_nodes() argument
905 list_for_each_entry_safe(n, ntmp, &guc->capture->outlist, link) in guc_capture_delete_prealloc_nodes()
906 guc_capture_delete_one_node(guc, n); in guc_capture_delete_prealloc_nodes()
908 list_for_each_entry_safe(n, ntmp, &guc->capture->cachelist, link) in guc_capture_delete_prealloc_nodes()
909 guc_capture_delete_one_node(guc, n); in guc_capture_delete_prealloc_nodes()
934 guc_capture_init_node(struct intel_guc *guc, struct __guc_capture_parsed_output *node) in guc_capture_init_node() argument
942 guc->capture->max_mmio_per_node); in guc_capture_init_node()
952 guc_capture_get_prealloc_node(struct intel_guc *guc) in guc_capture_get_prealloc_node() argument
956 if (!list_empty(&guc->capture->cachelist)) { in guc_capture_get_prealloc_node()
960 list_for_each_entry_safe(n, ntmp, &guc->capture->cachelist, link) { in guc_capture_get_prealloc_node()
969 list_for_each_entry_safe(n, ntmp, &guc->capture->outlist, link) { in guc_capture_get_prealloc_node()
976 guc_capture_init_node(guc, found); in guc_capture_get_prealloc_node()
982 guc_capture_alloc_one_node(struct intel_guc *guc) in guc_capture_alloc_one_node() argument
992 new->reginfo[i].regs = kcalloc(guc->capture->max_mmio_per_node, in guc_capture_alloc_one_node()
1001 guc_capture_init_node(guc, new); in guc_capture_alloc_one_node()
1007 guc_capture_clone_node(struct intel_guc *guc, struct __guc_capture_parsed_output *original, in guc_capture_clone_node() argument
1013 new = guc_capture_get_prealloc_node(guc); in guc_capture_clone_node()
1025 guc->capture->max_mmio_per_node); in guc_capture_clone_node()
1047 __guc_capture_create_prealloc_nodes(struct intel_guc *guc) in __guc_capture_create_prealloc_nodes() argument
1053 node = guc_capture_alloc_one_node(guc); in __guc_capture_create_prealloc_nodes()
1055 guc_warn(guc, "Register capture pre-alloc-cache failure\n"); in __guc_capture_create_prealloc_nodes()
1059 guc_capture_add_node_to_cachelist(guc->capture, node); in __guc_capture_create_prealloc_nodes()
1064 guc_get_max_reglist_count(struct intel_guc *guc) in guc_get_max_reglist_count() argument
1074 tmp = guc_cap_list_num_regs(guc->capture, i, j, k); in guc_get_max_reglist_count()
1087 guc_capture_create_prealloc_nodes(struct intel_guc *guc) in guc_capture_create_prealloc_nodes() argument
1090 if (guc->capture->max_mmio_per_node) in guc_capture_create_prealloc_nodes()
1093 guc->capture->max_mmio_per_node = guc_get_max_reglist_count(guc); in guc_capture_create_prealloc_nodes()
1094 __guc_capture_create_prealloc_nodes(guc); in guc_capture_create_prealloc_nodes()
1098 guc_capture_extract_reglists(struct intel_guc *guc, struct __guc_capture_bufstate *buf) in guc_capture_extract_reglists() argument
1113 guc_warn(guc, "Got mis-aligned register capture entries\n"); in guc_capture_extract_reglists()
1119 if (guc_capture_log_get_group_hdr(guc, buf, &ghdr)) { in guc_capture_extract_reglists()
1179 if (guc_capture_log_get_data_hdr(guc, buf, &hdr)) { in guc_capture_extract_reglists()
1189 if (guc_capture_log_get_register(guc, buf, &tmp)) { in guc_capture_extract_reglists()
1206 guc_capture_add_node_to_outlist(guc->capture, node); in guc_capture_extract_reglists()
1211 guc_capture_add_node_to_outlist(guc->capture, node); in guc_capture_extract_reglists()
1212 node = guc_capture_clone_node(guc, node, in guc_capture_extract_reglists()
1217 guc_capture_add_node_to_outlist(guc->capture, node); in guc_capture_extract_reglists()
1218 node = guc_capture_clone_node(guc, node, in guc_capture_extract_reglists()
1225 node = guc_capture_get_prealloc_node(guc); in guc_capture_extract_reglists()
1231 guc_dbg(guc, "Register capture missing global dump: %08x!\n", in guc_capture_extract_reglists()
1251 if (numregs > guc->capture->max_mmio_per_node) { in guc_capture_extract_reglists()
1252 guc_dbg(guc, "Register capture list extraction clipped by prealloc!\n"); in guc_capture_extract_reglists()
1253 numregs = guc->capture->max_mmio_per_node; in guc_capture_extract_reglists()
1259 if (guc_capture_log_get_register(guc, buf, &regs[i++])) { in guc_capture_extract_reglists()
1271 guc_capture_add_node_to_outlist(guc->capture, node); in guc_capture_extract_reglists()
1277 guc_capture_add_node_to_cachelist(guc->capture, node); in guc_capture_extract_reglists()
1282 static int __guc_capture_flushlog_complete(struct intel_guc *guc) in __guc_capture_flushlog_complete() argument
1289 return intel_guc_send_nb(guc, action, ARRAY_SIZE(action), 0); in __guc_capture_flushlog_complete()
1293 static void __guc_capture_process_output(struct intel_guc *guc) in __guc_capture_process_output() argument
1296 struct intel_uc *uc = container_of(guc, typeof(*uc), guc); in __guc_capture_process_output()
1304 log_buf_state = guc->log.buf_addr + in __guc_capture_process_output()
1306 src_data = guc->log.buf_addr + in __guc_capture_process_output()
1307 intel_guc_get_log_buffer_offset(&guc->log, GUC_CAPTURE_LOG_BUFFER); in __guc_capture_process_output()
1315 buffer_size = intel_guc_get_log_buffer_size(&guc->log, GUC_CAPTURE_LOG_BUFFER); in __guc_capture_process_output()
1321 guc->log.stats[GUC_CAPTURE_LOG_BUFFER].flush += log_buf_state_local.flush_to_file; in __guc_capture_process_output()
1322 new_overflow = intel_guc_check_log_buf_overflow(&guc->log, GUC_CAPTURE_LOG_BUFFER, in __guc_capture_process_output()
1332 guc_err(guc, "Register capture buffer in invalid state: read = 0x%X, size = 0x%X!\n", in __guc_capture_process_output()
1346 ret = guc_capture_extract_reglists(guc, &buf); in __guc_capture_process_output()
1353 __guc_capture_flushlog_complete(guc); in __guc_capture_process_output()
1359 guc_capture_reg_to_str(const struct intel_guc *guc, u32 owner, u32 type, in guc_capture_reg_to_str() argument
1362 const struct __guc_mmio_reg_descr_group *reglists = guc->capture->reglists; in guc_capture_reg_to_str()
1363 struct __guc_mmio_reg_descr_group *extlists = guc->capture->extlists; in guc_capture_reg_to_str()
1429 struct intel_guc *guc; in intel_guc_capture_print_engine_node() local
1440 guc = gt_to_guc(ee->engine->gt); in intel_guc_capture_print_engine_node()
1468 eng = intel_guc_lookup_engine(guc, node->eng_class, node->eng_inst); in intel_guc_capture_print_engine_node()
1482 str = guc_capture_reg_to_str(guc, GUC_CAPTURE_LIST_INDEX_PF, i, in intel_guc_capture_print_engine_node()
1537 struct intel_guc *guc; in intel_guc_capture_is_matching_engine() local
1542 guc = gt_to_guc(gt); in intel_guc_capture_is_matching_engine()
1543 if (!guc->capture) in intel_guc_capture_is_matching_engine()
1551 list_for_each_entry(n, &guc->capture->outlist, link) { in intel_guc_capture_is_matching_engine()
1567 struct intel_guc *guc; in intel_guc_capture_get_matching_node() local
1572 guc = gt_to_guc(gt); in intel_guc_capture_get_matching_node()
1573 if (!guc->capture) in intel_guc_capture_get_matching_node()
1583 list_for_each_entry_safe(n, ntmp, &guc->capture->outlist, link) { in intel_guc_capture_get_matching_node()
1590 ee->guc_capture = guc->capture; in intel_guc_capture_get_matching_node()
1596 guc_warn(guc, "No register capture node found for 0x%04X / 0x%08X\n", in intel_guc_capture_get_matching_node()
1600 void intel_guc_capture_process(struct intel_guc *guc) in intel_guc_capture_process() argument
1602 if (guc->capture) in intel_guc_capture_process()
1603 __guc_capture_process_output(guc); in intel_guc_capture_process()
1624 void intel_guc_capture_destroy(struct intel_guc *guc) in intel_guc_capture_destroy() argument
1626 if (!guc->capture) in intel_guc_capture_destroy()
1629 guc_capture_free_ads_cache(guc->capture); in intel_guc_capture_destroy()
1631 guc_capture_delete_prealloc_nodes(guc); in intel_guc_capture_destroy()
1633 guc_capture_free_extlists(guc->capture->extlists); in intel_guc_capture_destroy()
1634 kfree(guc->capture->extlists); in intel_guc_capture_destroy()
1636 kfree(guc->capture); in intel_guc_capture_destroy()
1637 guc->capture = NULL; in intel_guc_capture_destroy()
1640 int intel_guc_capture_init(struct intel_guc *guc) in intel_guc_capture_init() argument
1642 guc->capture = kzalloc(sizeof(*guc->capture), GFP_KERNEL); in intel_guc_capture_init()
1643 if (!guc->capture) in intel_guc_capture_init()
1646 guc->capture->reglists = guc_capture_get_device_reglist(guc); in intel_guc_capture_init()
1648 INIT_LIST_HEAD(&guc->capture->outlist); in intel_guc_capture_init()
1649 INIT_LIST_HEAD(&guc->capture->cachelist); in intel_guc_capture_init()
1651 check_guc_capture_size(guc); in intel_guc_capture_init()