linux/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c

// SPDX-License-Identifier: MIT
/*
 * Copyright © 2014-2019 Intel Corporation
 */

#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)
{}

/**
 * DOC: GuC firmware log
 *
 * Firmware log is enabled by setting i915.guc_log_level to the positive level.
 * Log data is printed out via reading debugfs i915_guc_log_dump. Reading from
 * i915_guc_load_status will print out firmware loading status and scratch
 * registers value.
 */

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)
{}

/*
 * Sub buffer switch callback. Called whenever relay has to switch to a new
 * sub buffer, relay stays on the same sub buffer if 0 is returned.
 */
static int subbuf_start_callback(struct rchan_buf *buf,
				 void *subbuf,
				 void *prev_subbuf,
				 size_t prev_padding)
{}

/*
 * file_create() callback. Creates relay file in debugfs.
 */
static struct dentry *create_buf_file_callback(const char *filename,
					       struct dentry *parent,
					       umode_t mode,
					       struct rchan_buf *buf,
					       int *is_global)
{}

/*
 * file_remove() default callback. Removes relay file in debugfs.
 */
static int remove_buf_file_callback(struct dentry *dentry)
{}

/* relay channel callbacks */
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)
{}

/*
 * Stops the relay log. Called from intel_guc_log_relay_close(), so no
 * possibility of race with start/flush since relay_write cannot race
 * relay_close.
 */
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)
{}

/**
 * intel_guc_log_info - dump information about GuC log relay
 * @log: the GuC log
 * @p: the &drm_printer
 *
 * Pretty printer for GuC log info
 */
void intel_guc_log_info(struct intel_guc_log *log, struct drm_printer *p)
{}

/**
 * intel_guc_log_dump - dump the contents of the GuC log
 * @log: the GuC log
 * @p: the &drm_printer
 * @dump_load_err: dump the log saved on GuC load error
 *
 * Pretty printer for the GuC log
 */
int intel_guc_log_dump(struct intel_guc_log *log, struct drm_printer *p,
		       bool dump_load_err)
{}