#include <linux/types.h>
#include <drm/drm_print.h>
#include "gt/intel_engine_regs.h"
#include "gt/intel_gt.h"
#include "gt/intel_gt_mcr.h"
#include "gt/intel_gt_regs.h"
#include "gt/intel_lrc.h"
#include "guc_capture_fwif.h"
#include "intel_guc_capture.h"
#include "intel_guc_fwif.h"
#include "intel_guc_print.h"
#include "i915_drv.h"
#include "i915_gpu_error.h"
#include "i915_irq.h"
#include "i915_memcpy.h"
#include "i915_reg.h"
#define COMMON_BASE_GLOBAL …
#define COMMON_GEN8BASE_GLOBAL …
#define GEN8_GLOBAL …
#define COMMON_GEN12BASE_GLOBAL …
#define COMMON_BASE_ENGINE_INSTANCE …
#define COMMON_BASE_RENDER …
#define COMMON_GEN12BASE_RENDER …
#define COMMON_GEN12BASE_VEC …
static const struct __guc_mmio_reg_descr xe_lp_global_regs[] = …;
static const struct __guc_mmio_reg_descr xe_lp_rc_class_regs[] = …;
static const struct __guc_mmio_reg_descr gen8_rc_inst_regs[] = …;
static const struct __guc_mmio_reg_descr gen8_vd_inst_regs[] = …;
static const struct __guc_mmio_reg_descr xe_lp_vec_class_regs[] = …;
static const struct __guc_mmio_reg_descr gen8_vec_inst_regs[] = …;
static const struct __guc_mmio_reg_descr gen8_blt_inst_regs[] = …;
static const struct __guc_mmio_reg_descr xe_lp_gsc_inst_regs[] = …;
static const struct __guc_mmio_reg_descr gen8_global_regs[] = …;
static const struct __guc_mmio_reg_descr gen8_rc_class_regs[] = …;
static const struct __guc_mmio_reg_descr empty_regs_list[] = …;
#define TO_GCAP_DEF_OWNER(x) …
#define TO_GCAP_DEF_TYPE(x) …
#define MAKE_REGLIST(regslist, regsowner, regstype, class) …
static const struct __guc_mmio_reg_descr_group gen8_lists[] = …;
static const struct __guc_mmio_reg_descr_group xe_lp_lists[] = …;
static const struct __guc_mmio_reg_descr_group *
guc_capture_get_one_list(const struct __guc_mmio_reg_descr_group *reglists,
u32 owner, u32 type, u32 id)
{ … }
static struct __guc_mmio_reg_descr_group *
guc_capture_get_one_ext_list(struct __guc_mmio_reg_descr_group *reglists,
u32 owner, u32 type, u32 id)
{ … }
static void guc_capture_free_extlists(struct __guc_mmio_reg_descr_group *reglists)
{ … }
struct __ext_steer_reg { … };
static const struct __ext_steer_reg gen8_extregs[] = …;
static const struct __ext_steer_reg xehpg_extregs[] = …;
static void __fill_ext_reg(struct __guc_mmio_reg_descr *ext,
const struct __ext_steer_reg *extlist,
int slice_id, int subslice_id)
{ … }
static int
__alloc_ext_regs(struct __guc_mmio_reg_descr_group *newlist,
const struct __guc_mmio_reg_descr_group *rootlist, int num_regs)
{ … }
static void
guc_capture_alloc_steered_lists(struct intel_guc *guc,
const struct __guc_mmio_reg_descr_group *lists)
{ … }
static const struct __guc_mmio_reg_descr_group *
guc_capture_get_device_reglist(struct intel_guc *guc)
{ … }
static const char *
__stringify_type(u32 type)
{ … }
static const char *
__stringify_engclass(u32 class)
{ … }
static int
guc_capture_list_init(struct intel_guc *guc, u32 owner, u32 type, u32 classid,
struct guc_mmio_reg *ptr, u16 num_entries)
{ … }
static int
guc_cap_list_num_regs(struct intel_guc_state_capture *gc, u32 owner, u32 type, u32 classid)
{ … }
static int
guc_capture_getlistsize(struct intel_guc *guc, u32 owner, u32 type, u32 classid,
size_t *size, bool is_purpose_est)
{ … }
int
intel_guc_capture_getlistsize(struct intel_guc *guc, u32 owner, u32 type, u32 classid,
size_t *size)
{ … }
static void guc_capture_create_prealloc_nodes(struct intel_guc *guc);
int
intel_guc_capture_getlist(struct intel_guc *guc, u32 owner, u32 type, u32 classid,
void **outptr)
{ … }
int
intel_guc_capture_getnullheader(struct intel_guc *guc,
void **outptr, size_t *size)
{ … }
static int
guc_capture_output_min_size_est(struct intel_guc *guc)
{ … }
#define GUC_CAPTURE_OVERBUFFER_MULTIPLIER …
static void check_guc_capture_size(struct intel_guc *guc)
{ … }
static int guc_capture_buf_cnt(struct __guc_capture_bufstate *buf)
{ … }
static int guc_capture_buf_cnt_to_end(struct __guc_capture_bufstate *buf)
{ … }
static int
guc_capture_log_remove_dw(struct intel_guc *guc, struct __guc_capture_bufstate *buf,
u32 *dw)
{ … }
static bool
guc_capture_data_extracted(struct __guc_capture_bufstate *b,
int size, void *dest)
{ … }
static int
guc_capture_log_get_group_hdr(struct intel_guc *guc, struct __guc_capture_bufstate *buf,
struct guc_state_capture_group_header_t *ghdr)
{ … }
static int
guc_capture_log_get_data_hdr(struct intel_guc *guc, struct __guc_capture_bufstate *buf,
struct guc_state_capture_header_t *hdr)
{ … }
static int
guc_capture_log_get_register(struct intel_guc *guc, struct __guc_capture_bufstate *buf,
struct guc_mmio_reg *reg)
{ … }
static void
guc_capture_delete_one_node(struct intel_guc *guc, struct __guc_capture_parsed_output *node)
{ … }
static void
guc_capture_delete_prealloc_nodes(struct intel_guc *guc)
{ … }
static void
guc_capture_add_node_to_list(struct __guc_capture_parsed_output *node,
struct list_head *list)
{ … }
static void
guc_capture_add_node_to_outlist(struct intel_guc_state_capture *gc,
struct __guc_capture_parsed_output *node)
{ … }
static void
guc_capture_add_node_to_cachelist(struct intel_guc_state_capture *gc,
struct __guc_capture_parsed_output *node)
{ … }
static void
guc_capture_init_node(struct intel_guc *guc, struct __guc_capture_parsed_output *node)
{ … }
static struct __guc_capture_parsed_output *
guc_capture_get_prealloc_node(struct intel_guc *guc)
{ … }
static struct __guc_capture_parsed_output *
guc_capture_alloc_one_node(struct intel_guc *guc)
{ … }
static struct __guc_capture_parsed_output *
guc_capture_clone_node(struct intel_guc *guc, struct __guc_capture_parsed_output *original,
u32 keep_reglist_mask)
{ … }
static void
__guc_capture_create_prealloc_nodes(struct intel_guc *guc)
{ … }
static int
guc_get_max_reglist_count(struct intel_guc *guc)
{ … }
static void
guc_capture_create_prealloc_nodes(struct intel_guc *guc)
{ … }
static int
guc_capture_extract_reglists(struct intel_guc *guc, struct __guc_capture_bufstate *buf)
{ … }
static int __guc_capture_flushlog_complete(struct intel_guc *guc)
{ … }
static void __guc_capture_process_output(struct intel_guc *guc)
{ … }
#if IS_ENABLED(CONFIG_DRM_I915_CAPTURE_ERROR)
static const char *
guc_capture_reg_to_str(const struct intel_guc *guc, u32 owner, u32 type,
u32 class, u32 id, u32 offset, u32 *is_ext)
{ … }
#define GCAP_PRINT_INTEL_ENG_INFO(ebuf, eng) …
#define GCAP_PRINT_GUC_INST_INFO(ebuf, node) …
int intel_guc_capture_print_engine_node(struct drm_i915_error_state_buf *ebuf,
const struct intel_engine_coredump *ee)
{ … }
#endif
static void guc_capture_find_ecode(struct intel_engine_coredump *ee)
{ … }
void intel_guc_capture_free_node(struct intel_engine_coredump *ee)
{ … }
bool intel_guc_capture_is_matching_engine(struct intel_gt *gt,
struct intel_context *ce,
struct intel_engine_cs *engine)
{ … }
void intel_guc_capture_get_matching_node(struct intel_gt *gt,
struct intel_engine_coredump *ee,
struct intel_context *ce)
{ … }
void intel_guc_capture_process(struct intel_guc *guc)
{ … }
static void
guc_capture_free_ads_cache(struct intel_guc_state_capture *gc)
{ … }
void intel_guc_capture_destroy(struct intel_guc *guc)
{ … }
int intel_guc_capture_init(struct intel_guc *guc)
{ … }