/* * GuC has a blob containing hardware configuration information (HWConfig). * This is formatted as a simple and flexible KLV (Key/Length/Value) table. * * For example, a minimal version could be: * enum device_attr { * ATTR_SOME_VALUE = 0, * ATTR_SOME_MASK = 1, * }; * * static const u32 hwconfig[] = { * ATTR_SOME_VALUE, * 1, // Value Length in DWords * 8, // Value * * ATTR_SOME_MASK, * 3, * 0x00FFFFFFFF, 0xFFFFFFFF, 0xFF000000, * }; * * The attribute ids are defined in a hardware spec.
*/
staticint guc_hwconfig_discover_size(struct intel_guc *guc, struct intel_hwconfig *hwconfig)
{ int ret;
/* * Sending a query with zero offset and size will return the * size of the blob.
*/
ret = __guc_action_get_hwconfig(guc, 0, 0); if (ret < 0) return ret;
staticbool has_table(struct drm_i915_private *i915)
{ if (IS_ALDERLAKE_P(i915) && !IS_ALDERLAKE_P_N(i915)) returntrue; if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 55)) returntrue;
returnfalse;
}
/* * intel_guc_hwconfig_init - Initialize the HWConfig * * Retrieve the HWConfig table from the GuC and save it locally. * It can then be queried on demand by other users later on.
*/ staticint guc_hwconfig_init(struct intel_gt *gt)
{ struct intel_hwconfig *hwconfig = >->info.hwconfig; struct intel_guc *guc = gt_to_guc(gt); int ret;
if (!has_table(gt->i915)) return 0;
ret = guc_hwconfig_discover_size(guc, hwconfig); if (ret) return ret;
ret = guc_hwconfig_fill_buffer(guc, hwconfig); if (ret < 0) {
intel_gt_fini_hwconfig(gt); return ret;
}
return 0;
}
/* * intel_gt_init_hwconfig - Initialize the HWConfig if available * * Retrieve the HWConfig table if available on the current platform.
*/ int intel_gt_init_hwconfig(struct intel_gt *gt)
{ if (!intel_uc_uses_guc(>->uc)) return 0;
return guc_hwconfig_init(gt);
}
/* * intel_gt_fini_hwconfig - Finalize the HWConfig * * Free up the memory allocation holding the table.
*/ void intel_gt_fini_hwconfig(struct intel_gt *gt)
{ struct intel_hwconfig *hwconfig = >->info.hwconfig;
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.