/* * Copyright 2016 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Author: Monk.liu@amd.com
*/ #ifndef AMDGPU_VIRT_H #define AMDGPU_VIRT_H
#include"amdgv_sriovmsg.h"
#define AMDGPU_SRIOV_CAPS_SRIOV_VBIOS (1 << 0) /* vBIOS is sr-iov ready */ #define AMDGPU_SRIOV_CAPS_ENABLE_IOV (1 << 1) /* sr-iov is enabled on this GPU */ #define AMDGPU_SRIOV_CAPS_IS_VF (1 << 2) /* this GPU is a virtual function */ #define AMDGPU_PASSTHROUGH_MODE (1 << 3) /* thw whole GPU is pass through for VM */ #define AMDGPU_SRIOV_CAPS_RUNTIME (1 << 4) /* is out of full access mode */ #define AMDGPU_VF_MMIO_ACCESS_PROTECT (1 << 5) /* MMIO write access is not allowed in sriov runtime */
/* all asic after AI use this offset */ #define mmRCC_IOV_FUNC_IDENTIFIER 0xDE5 /* tonga/fiji use this offset */ #define mmBIF_IOV_FUNC_IDENTIFIER 0x1503
/* * Legacy GIM header * * Defination between PF and VF * Structures forcibly aligned to 4 to keep the same style as PF.
*/ #define AMDGIM_DATAEXCHANGE_OFFSET (64 * 1024)
enum AMDGIM_REG_ACCESS_FLAG { /* Use PSP to program IH_RB_CNTL */
AMDGIM_FEATURE_IH_REG_PSP_EN = (1 << 0), /* Use RLC to program MMHUB regs */
AMDGIM_FEATURE_MMHUB_REG_RLC_EN = (1 << 1), /* Use RLC to program GC regs */
AMDGIM_FEATURE_GC_REG_RLC_EN = (1 << 2), /* Use PSP to program L1_TLB_CNTL */
AMDGIM_FEATURE_L1_TLB_CNTL_PSP_EN = (1 << 3), /* Use RLCG to program SQ_CONFIG1 */
AMDGIM_FEATURE_REG_ACCESS_SQ_CONFIG = (1 << 4),
};
struct amdgim_pf2vf_info_v1 { /* header contains size and version */ struct amd_sriov_msg_pf2vf_info_header header; /* max_width * max_height */ unsignedint uvd_enc_max_pixels_count; /* 16x16 pixels/sec, codec independent */ unsignedint uvd_enc_max_bandwidth; /* max_width * max_height */ unsignedint vce_enc_max_pixels_count; /* 16x16 pixels/sec, codec independent */ unsignedint vce_enc_max_bandwidth; /* MEC FW position in kb from the start of visible frame buffer */ unsignedint mecfw_kboffset; /* The features flags of the GIM driver supports. */ unsignedint feature_flags; /* use private key from mailbox 2 to create chueksum */ unsignedint checksum;
} __aligned(4);
struct amdgim_vf2pf_info_v1 { /* header contains size and version */ struct amd_sriov_msg_vf2pf_info_header header; /* driver version */ char driver_version[64]; /* driver certification, 1=WHQL, 0=None */ unsignedint driver_cert; /* guest OS type and version: need a define */ unsignedint os_info; /* in the unit of 1M */ unsignedint fb_usage; /* guest gfx engine usage percentage */ unsignedint gfx_usage; /* guest gfx engine health percentage */ unsignedint gfx_health; /* guest compute engine usage percentage */ unsignedint compute_usage; /* guest compute engine health percentage */ unsignedint compute_health; /* guest vce engine usage percentage. 0xffff means N/A. */ unsignedint vce_enc_usage; /* guest vce engine health percentage. 0xffff means N/A. */ unsignedint vce_enc_health; /* guest uvd engine usage percentage. 0xffff means N/A. */ unsignedint uvd_enc_usage; /* guest uvd engine usage percentage. 0xffff means N/A. */ unsignedint uvd_enc_health; unsignedint checksum;
} __aligned(4);
struct amdgim_vf2pf_info_v2 { /* header contains size and version */ struct amd_sriov_msg_vf2pf_info_header header;
uint32_t checksum; /* driver version */
uint8_t driver_version[64]; /* driver certification, 1=WHQL, 0=None */
uint32_t driver_cert; /* guest OS type and version: need a define */
uint32_t os_info; /* in the unit of 1M */
uint32_t fb_usage; /* guest gfx engine usage percentage */
uint32_t gfx_usage; /* guest gfx engine health percentage */
uint32_t gfx_health; /* guest compute engine usage percentage */
uint32_t compute_usage; /* guest compute engine health percentage */
uint32_t compute_health; /* guest vce engine usage percentage. 0xffff means N/A. */
uint32_t vce_enc_usage; /* guest vce engine health percentage. 0xffff means N/A. */
uint32_t vce_enc_health; /* guest uvd engine usage percentage. 0xffff means N/A. */
uint32_t uvd_enc_usage; /* guest uvd engine usage percentage. 0xffff means N/A. */
uint32_t uvd_enc_health;
uint32_t reserved[AMDGIM_GET_STRUCTURE_RESERVED_SIZE(256, 64, 0, (12 + sizeof(struct amd_sriov_msg_vf2pf_info_header)/sizeof(uint32_t)), 0)];
} __aligned(4);
struct amdgpu_virt_ras_err_handler_data { /* point to bad page records array */ struct eeprom_table_record *bps; /* point to reserved bo array */ struct amdgpu_bo **bps_bo; /* the count of entries */ int count; /* last reserved entry's index + 1 */ int last_reserved;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.