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

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

#include <linux/bsearch.h>

#include "gem/i915_gem_lmem.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 "gt/shmem_utils.h"
#include "intel_guc_ads.h"
#include "intel_guc_capture.h"
#include "intel_guc_fwif.h"
#include "intel_guc_print.h"
#include "intel_uc.h"
#include "i915_drv.h"

/*
 * The Additional Data Struct (ADS) has pointers for different buffers used by
 * the GuC. One single gem object contains the ADS struct itself (guc_ads) and
 * all the extra buffers indirectly linked via the ADS struct's entries.
 *
 * Layout of the ADS blob allocated for the GuC:
 *
 *      +---------------------------------------+ <== base
 *      | guc_ads                               |
 *      +---------------------------------------+
 *      | guc_policies                          |
 *      +---------------------------------------+
 *      | guc_gt_system_info                    |
 *      +---------------------------------------+
 *      | guc_engine_usage                      |
 *      +---------------------------------------+ <== static
 *      | guc_mmio_reg[countA] (engine 0.0)     |
 *      | guc_mmio_reg[countB] (engine 0.1)     |
 *      | guc_mmio_reg[countC] (engine 1.0)     |
 *      |   ...                                 |
 *      +---------------------------------------+ <== dynamic
 *      | padding                               |
 *      +---------------------------------------+ <== 4K aligned
 *      | golden contexts                       |
 *      +---------------------------------------+
 *      | padding                               |
 *      +---------------------------------------+ <== 4K aligned
 *      | w/a KLVs                              |
 *      +---------------------------------------+
 *      | padding                               |
 *      +---------------------------------------+ <== 4K aligned
 *      | capture lists                         |
 *      +---------------------------------------+
 *      | padding                               |
 *      +---------------------------------------+ <== 4K aligned
 *      | private data                          |
 *      +---------------------------------------+
 *      | padding                               |
 *      +---------------------------------------+ <== 4K aligned
 */
struct __guc_ads_blob {} __packed;

#define ads_blob_read(guc_, field_)

#define ads_blob_write(guc_, field_, val_)

#define info_map_write(map_, field_, val_)

#define info_map_read(map_, field_)

static u32 guc_ads_regset_size(struct intel_guc *guc)
{}

static u32 guc_ads_golden_ctxt_size(struct intel_guc *guc)
{}

static u32 guc_ads_waklv_size(struct intel_guc *guc)
{}

static u32 guc_ads_capture_size(struct intel_guc *guc)
{}

static u32 guc_ads_private_data_size(struct intel_guc *guc)
{}

static u32 guc_ads_regset_offset(struct intel_guc *guc)
{}

static u32 guc_ads_golden_ctxt_offset(struct intel_guc *guc)
{}

static u32 guc_ads_waklv_offset(struct intel_guc *guc)
{}

static u32 guc_ads_capture_offset(struct intel_guc *guc)
{}

static u32 guc_ads_private_data_offset(struct intel_guc *guc)
{}

static u32 guc_ads_blob_size(struct intel_guc *guc)
{}

static void guc_policies_init(struct intel_guc *guc)
{}

void intel_guc_ads_print_policy_info(struct intel_guc *guc,
				     struct drm_printer *dp)
{}

static int guc_action_policies_update(struct intel_guc *guc, u32 policy_offset)
{}

int intel_guc_global_policies_update(struct intel_guc *guc)
{}

static void guc_mapping_table_init(struct intel_gt *gt,
				   struct iosys_map *info_map)
{}

/*
 * The save/restore register list must be pre-calculated to a temporary
 * buffer before it can be copied inside the ADS.
 */
struct temp_regset {};

static int guc_mmio_reg_cmp(const void *a, const void *b)
{}

static struct guc_mmio_reg * __must_check
__mmio_reg_add(struct temp_regset *regset, struct guc_mmio_reg *reg)
{}

static long __must_check guc_mmio_reg_add(struct intel_gt *gt,
					  struct temp_regset *regset,
					  u32 offset, u32 flags)
{}

#define GUC_MMIO_REG_ADD(gt, regset, reg, masked)

#define GUC_REGSET_STEERING(group, instance)

static long __must_check guc_mcr_reg_add(struct intel_gt *gt,
					 struct temp_regset *regset,
					 i915_mcr_reg_t reg, u32 flags)
{}

#define GUC_MCR_REG_ADD(gt, regset, reg, masked)

static int guc_mmio_regset_init(struct temp_regset *regset,
				struct intel_engine_cs *engine)
{}

static long guc_mmio_reg_state_create(struct intel_guc *guc)
{}

static void guc_mmio_reg_state_init(struct intel_guc *guc)
{}

static void fill_engine_enable_masks(struct intel_gt *gt,
				     struct iosys_map *info_map)
{}

#define LR_HW_CONTEXT_SIZE
#define XEHP_LR_HW_CONTEXT_SIZE
#define LR_HW_CONTEXT_SZ(i915)
#define LRC_SKIP_SIZE(i915)
static int guc_prep_golden_context(struct intel_guc *guc)
{}

static struct intel_engine_cs *find_engine_state(struct intel_gt *gt, u8 engine_class)
{}

static void guc_init_golden_context(struct intel_guc *guc)
{}

static u32 guc_get_capture_engine_mask(struct iosys_map *info_map, u32 capture_class)
{}

static int
guc_capture_prep_lists(struct intel_guc *guc)
{}

static void guc_waklv_enable_simple(struct intel_guc *guc, u32 *offset, u32 *remain, u32 klv_id)
{}

static void guc_waklv_init(struct intel_guc *guc)
{}

static int guc_prep_waklv(struct intel_guc *guc)
{}

static void __guc_ads_init(struct intel_guc *guc)
{}

/**
 * intel_guc_ads_create() - allocates and initializes GuC ADS.
 * @guc: intel_guc struct
 *
 * GuC needs memory block (Additional Data Struct), where it will store
 * some data. Allocate and initialize such memory block for GuC use.
 */
int intel_guc_ads_create(struct intel_guc *guc)
{}

void intel_guc_ads_init_late(struct intel_guc *guc)
{}

void intel_guc_ads_destroy(struct intel_guc *guc)
{}

static void guc_ads_private_data_reset(struct intel_guc *guc)
{}

/**
 * intel_guc_ads_reset() - prepares GuC Additional Data Struct for reuse
 * @guc: intel_guc struct
 *
 * GuC stores some data in ADS, which might be stale after a reset.
 * Reinitialize whole ADS in case any part of it was corrupted during
 * previous GuC run.
 */
void intel_guc_ads_reset(struct intel_guc *guc)
{}

u32 intel_guc_engine_usage_offset(struct intel_guc *guc)
{}

struct iosys_map intel_guc_engine_usage_record_map(struct intel_engine_cs *engine)
{}