VSEC¶
Some GPUs support the PMT feature. For those that do, this API provides probe, discovery and usage (control and access) for GPUs that have PMT.
PMT is usually accessed through a PCI function. However, that is not always
available, so the PMT intel_vsec_register() function can be used to set up
PMT usage.
Internal API¶
-
int xe_pmt_telem_read(struct device *dev, u32 guid, u64 *data, loff_t user_offset, u32 count)¶
Given a device and a PMT GUID, read data into a buffer
Parameters
struct device *devvalid Xe device
u32 guidPMT GUID (from the PMT discovery struct)
u64 *databuffer to place data in
loff_t user_offseta user offset relative to the beginning of the data to read
u32 countbytes to read
Description
This is a callback API. I.e this can be accessed external to the XE driver
(PMT driver scope). Because of this, DRM hotplug needs to be verified
(drm_dev_enter()).
Return
-ENODEV device is not available (hotplug)
-EAGAIN base_offset has not been set, so init path has not yet been done.
-ENODATA for incorrect power state
-EINVAL for unsupported PMT feature
count number of bytes read on success
-
int xe_pmt_discovery_read(struct device *dev, unsigned long cap_id, u32 element, u32 *disc_data)¶
Given a device and an index, read discovery data into a buffer
Parameters
struct device *devvalid Xe device
unsigned long cap_idPMT type
u32 elementelement to access
u32 *disc_databuffer for discovery data
Description
This is a callback API. I.e this can be accessed external to the XE driver
(PMT driver scope). Because of this, DRM hotplug needs to be verified
(drm_dev_enter()).
Runtime is required to be active. Calling this out of that scope is not a correct use case (probe, late-bind probe).
Return
-ENODEV device is not available (hotplug)
-EINVAL for unsupported device or PMT feature
-ENODATA incorrect power state
0 on success
Parameters
struct device *devthe xe device that registered the callback
u32 guidPMT guid of the crashlog instance
u32 *regdata read from the PMT data structure
u32 offsetwhich data to read from the PMT data structure
Description
Read the requested PMT register based on the pcie device and guid. The
supported struct is the Crashlog Type1 Version2.
Currently this is for CRI only.
Return
-ENODEV device is not available (hotplug)
-EINVAL invalid guid
0 success
-
int xe_vsec_get_guid(struct xe_device *xe, u32 *guid)¶
Get and cache the PUNIT guid value
Parameters
struct xe_device *xevalid xe device
u32 *guidreturned guid
Return
-ENODATA device is not active
-EINVAL unsupported platform
0 success
-
void xe_vsec_init(struct xe_device *xe)¶
Initialize resources and add intel_vsec auxiliary interface
Parameters
struct xe_device *xevalid xe instance
-
void xe_vsec_remove(struct xe_device *xe)¶
cleanup any outstanding resources
Parameters
struct xe_device *xevalid xe instance