Commit 2d3789e3 authored by Michal Wajdeczko's avatar Michal Wajdeczko

drm/xe: Split MCR initialization

The initialization order of GT topology, MCR, PAT and GuC HWconfig
as done today by native/PF driver, can't be followed as-is by the
VF driver, since fuse registers used in GT topology discovery will
be obtained by the VF driver from the GuC in HWconfig step.

While native/PF drivers need to program the HW PAT table prior to
loading the GuC, this requires only multicast writes support from
the MCR code, which could be initialized separately from the full
MCR support that requires the GT topology to setup steering data.

Split MCR initialization into two steps to avoid introducing VF
specific code paths. This also fixes duplicated spin_lock inits.
Signed-off-by: default avatarMichal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Matt Roper <matthew.d.roper@intel.com>
Cc: Michał Winiarski <michal.winiarski@intel.com>
Cc: Zhanjun Dong <zhanjun.dong@intel.com>
Reviewed-by: default avatarMatt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240530115814.1284-1-michal.wajdeczko@intel.com
parent 9d85821a
...@@ -504,8 +504,7 @@ int xe_gt_init_hwconfig(struct xe_gt *gt) ...@@ -504,8 +504,7 @@ int xe_gt_init_hwconfig(struct xe_gt *gt)
if (err) if (err)
goto out; goto out;
xe_gt_topology_init(gt); xe_gt_mcr_init_early(gt);
xe_gt_mcr_init(gt);
xe_pat_init(gt); xe_pat_init(gt);
err = xe_uc_init(&gt->uc); err = xe_uc_init(&gt->uc);
...@@ -516,6 +515,9 @@ int xe_gt_init_hwconfig(struct xe_gt *gt) ...@@ -516,6 +515,9 @@ int xe_gt_init_hwconfig(struct xe_gt *gt)
if (err) if (err)
goto out_fw; goto out_fw;
xe_gt_topology_init(gt);
xe_gt_mcr_init(gt);
out_fw: out_fw:
xe_force_wake_put(gt_to_fw(gt), XE_FW_GT); xe_force_wake_put(gt_to_fw(gt), XE_FW_GT);
out: out:
......
...@@ -375,18 +375,35 @@ static const struct { ...@@ -375,18 +375,35 @@ static const struct {
[IMPLICIT_STEERING] = { "IMPLICIT", NULL }, [IMPLICIT_STEERING] = { "IMPLICIT", NULL },
}; };
void xe_gt_mcr_init(struct xe_gt *gt) /**
* xe_gt_mcr_init_early - Early initialization of the MCR support
* @gt: GT structure
*
* Perform early software only initialization of the MCR lock to allow
* the synchronization on accessing the STEER_SEMAPHORE register and
* use the xe_gt_mcr_multicast_write() function.
*/
void xe_gt_mcr_init_early(struct xe_gt *gt)
{ {
struct xe_device *xe = gt_to_xe(gt);
BUILD_BUG_ON(IMPLICIT_STEERING + 1 != NUM_STEERING_TYPES); BUILD_BUG_ON(IMPLICIT_STEERING + 1 != NUM_STEERING_TYPES);
BUILD_BUG_ON(ARRAY_SIZE(xe_steering_types) != NUM_STEERING_TYPES); BUILD_BUG_ON(ARRAY_SIZE(xe_steering_types) != NUM_STEERING_TYPES);
spin_lock_init(&gt->mcr_lock);
}
/**
* xe_gt_mcr_init - Normal initialization of the MCR support
* @gt: GT structure
*
* Perform normal initialization of the MCR for all usages.
*/
void xe_gt_mcr_init(struct xe_gt *gt)
{
struct xe_device *xe = gt_to_xe(gt);
if (IS_SRIOV_VF(xe)) if (IS_SRIOV_VF(xe))
return; return;
spin_lock_init(&gt->mcr_lock);
if (gt->info.type == XE_GT_TYPE_MEDIA) { if (gt->info.type == XE_GT_TYPE_MEDIA) {
drm_WARN_ON(&xe->drm, MEDIA_VER(xe) < 13); drm_WARN_ON(&xe->drm, MEDIA_VER(xe) < 13);
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
struct drm_printer; struct drm_printer;
struct xe_gt; struct xe_gt;
void xe_gt_mcr_init_early(struct xe_gt *gt);
void xe_gt_mcr_init(struct xe_gt *gt); void xe_gt_mcr_init(struct xe_gt *gt);
void xe_gt_mcr_set_implicit_defaults(struct xe_gt *gt); void xe_gt_mcr_set_implicit_defaults(struct xe_gt *gt);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment