#include <drm/drm_managed.h>
#include "abi/guc_actions_sriov_abi.h"
#include "abi/guc_relay_actions_abi.h"
#include "regs/xe_gt_regs.h"
#include "regs/xe_guc_regs.h"
#include "regs/xe_regs.h"
#include "xe_mmio.h"
#include "xe_gt_sriov_printk.h"
#include "xe_gt_sriov_pf_helpers.h"
#include "xe_gt_sriov_pf_service.h"
#include "xe_gt_sriov_pf_service_types.h"
#include "xe_guc_ct.h"
#include "xe_guc_hxg_helpers.h"
static void pf_init_versions(struct xe_gt *gt)
{ … }
static int pf_negotiate_version(struct xe_gt *gt,
u32 wanted_major, u32 wanted_minor,
u32 *major, u32 *minor)
{ … }
static void pf_connect(struct xe_gt *gt, u32 vfid, u32 major, u32 minor)
{ … }
static void pf_disconnect(struct xe_gt *gt, u32 vfid)
{ … }
static bool pf_is_negotiated(struct xe_gt *gt, u32 vfid, u32 major, u32 minor)
{ … }
static const struct xe_reg tgl_runtime_regs[] = …;
static const struct xe_reg ats_m_runtime_regs[] = …;
static const struct xe_reg pvc_runtime_regs[] = …;
static const struct xe_reg ver_1270_runtime_regs[] = …;
static const struct xe_reg ver_2000_runtime_regs[] = …;
static const struct xe_reg *pick_runtime_regs(struct xe_device *xe, unsigned int *count)
{ … }
static int pf_alloc_runtime_info(struct xe_gt *gt)
{ … }
static void read_many(struct xe_gt *gt, unsigned int count,
const struct xe_reg *regs, u32 *values)
{ … }
static void pf_prepare_runtime_info(struct xe_gt *gt)
{ … }
int xe_gt_sriov_pf_service_init(struct xe_gt *gt)
{ … }
void xe_gt_sriov_pf_service_update(struct xe_gt *gt)
{ … }
void xe_gt_sriov_pf_service_reset(struct xe_gt *gt, unsigned int vfid)
{ … }
static int pf_process_handshake(struct xe_gt *gt, u32 vfid,
u32 wanted_major, u32 wanted_minor,
u32 *major, u32 *minor)
{ … }
static int pf_process_handshake_msg(struct xe_gt *gt, u32 origin,
const u32 *request, u32 len, u32 *response, u32 size)
{ … }
struct reg_data { … } __packed;
static_assert(…);
static int pf_service_runtime_query(struct xe_gt *gt, u32 start, u32 limit,
struct reg_data *data, u32 *remaining)
{ … }
static int pf_process_runtime_query_msg(struct xe_gt *gt, u32 origin,
const u32 *msg, u32 msg_len, u32 *response, u32 resp_size)
{ … }
int xe_gt_sriov_pf_service_process_request(struct xe_gt *gt, u32 origin,
const u32 *msg, u32 msg_len,
u32 *response, u32 resp_size)
{ … }
int xe_gt_sriov_pf_service_print_runtime(struct xe_gt *gt, struct drm_printer *p)
{ … }
int xe_gt_sriov_pf_service_print_version(struct xe_gt *gt, struct drm_printer *p)
{ … }
#if IS_BUILTIN(CONFIG_DRM_XE_KUNIT_TEST)
#include "tests/xe_gt_sriov_pf_service_test.c"
#endif