#include <linux/debugfs.h>
#include <linux/string_helpers.h>
#include "gt/intel_gt.h"
#include "i915_drv.h"
#include "i915_irq.h"
#include "i915_memcpy.h"
#include "intel_guc_capture.h"
#include "intel_guc_log.h"
#include "intel_guc_print.h"
#if defined(CONFIG_DRM_I915_DEBUG_GUC)
#define GUC_LOG_DEFAULT_CRASH_BUFFER_SIZE …
#define GUC_LOG_DEFAULT_DEBUG_BUFFER_SIZE …
#define GUC_LOG_DEFAULT_CAPTURE_BUFFER_SIZE …
#elif defined(CONFIG_DRM_I915_DEBUG_GEM)
#define GUC_LOG_DEFAULT_CRASH_BUFFER_SIZE …
#define GUC_LOG_DEFAULT_DEBUG_BUFFER_SIZE …
#define GUC_LOG_DEFAULT_CAPTURE_BUFFER_SIZE …
#else
#define GUC_LOG_DEFAULT_CRASH_BUFFER_SIZE …
#define GUC_LOG_DEFAULT_DEBUG_BUFFER_SIZE …
#define GUC_LOG_DEFAULT_CAPTURE_BUFFER_SIZE …
#endif
static void guc_log_copy_debuglogs_for_relay(struct intel_guc_log *log);
struct guc_log_section { … };
static void _guc_log_init_sizes(struct intel_guc_log *log)
{ … }
static void guc_log_init_sizes(struct intel_guc_log *log)
{ … }
static u32 intel_guc_log_section_size_crash(struct intel_guc_log *log)
{ … }
static u32 intel_guc_log_section_size_debug(struct intel_guc_log *log)
{ … }
u32 intel_guc_log_section_size_capture(struct intel_guc_log *log)
{ … }
static u32 intel_guc_log_size(struct intel_guc_log *log)
{ … }
static int guc_action_flush_log_complete(struct intel_guc *guc)
{ … }
static int guc_action_flush_log(struct intel_guc *guc)
{ … }
static int guc_action_control_log(struct intel_guc *guc, bool enable,
bool default_logging, u32 verbosity)
{ … }
static int subbuf_start_callback(struct rchan_buf *buf,
void *subbuf,
void *prev_subbuf,
size_t prev_padding)
{ … }
static struct dentry *create_buf_file_callback(const char *filename,
struct dentry *parent,
umode_t mode,
struct rchan_buf *buf,
int *is_global)
{ … }
static int remove_buf_file_callback(struct dentry *dentry)
{ … }
static const struct rchan_callbacks relay_callbacks = …;
static void guc_move_to_next_buf(struct intel_guc_log *log)
{ … }
static void *guc_get_write_buffer(struct intel_guc_log *log)
{ … }
bool intel_guc_check_log_buf_overflow(struct intel_guc_log *log,
enum guc_log_buffer_type type,
unsigned int full_cnt)
{ … }
unsigned int intel_guc_get_log_buffer_size(struct intel_guc_log *log,
enum guc_log_buffer_type type)
{ … }
size_t intel_guc_get_log_buffer_offset(struct intel_guc_log *log,
enum guc_log_buffer_type type)
{ … }
static void _guc_log_copy_debuglogs_for_relay(struct intel_guc_log *log)
{ … }
static void copy_debug_logs_work(struct work_struct *work)
{ … }
static int guc_log_relay_map(struct intel_guc_log *log)
{ … }
static void guc_log_relay_unmap(struct intel_guc_log *log)
{ … }
void intel_guc_log_init_early(struct intel_guc_log *log)
{ … }
static int guc_log_relay_create(struct intel_guc_log *log)
{ … }
static void guc_log_relay_destroy(struct intel_guc_log *log)
{ … }
static void guc_log_copy_debuglogs_for_relay(struct intel_guc_log *log)
{ … }
static u32 __get_default_log_level(struct intel_guc_log *log)
{ … }
int intel_guc_log_create(struct intel_guc_log *log)
{ … }
void intel_guc_log_destroy(struct intel_guc_log *log)
{ … }
int intel_guc_log_set_level(struct intel_guc_log *log, u32 level)
{ … }
bool intel_guc_log_relay_created(const struct intel_guc_log *log)
{ … }
int intel_guc_log_relay_open(struct intel_guc_log *log)
{ … }
int intel_guc_log_relay_start(struct intel_guc_log *log)
{ … }
void intel_guc_log_relay_flush(struct intel_guc_log *log)
{ … }
static void guc_log_relay_stop(struct intel_guc_log *log)
{ … }
void intel_guc_log_relay_close(struct intel_guc_log *log)
{ … }
void intel_guc_log_handle_flush_event(struct intel_guc_log *log)
{ … }
static const char *
stringify_guc_log_type(enum guc_log_buffer_type type)
{ … }
void intel_guc_log_info(struct intel_guc_log *log, struct drm_printer *p)
{ … }
int intel_guc_log_dump(struct intel_guc_log *log, struct drm_printer *p,
bool dump_load_err)
{ … }