Commit 7704f32c authored by Michał Winiarski's avatar Michał Winiarski Committed by Rodrigo Vivi

drm/xe/uc: Extract xe_uc_sanitize_reset

Earlier GuC load will require more fine-grained control over reset.
Extract it outside of xe_uc_init_hw.
Signed-off-by: default avatarMichał Winiarski <michal.winiarski@intel.com>
Reviewed-by: default avatarMatthew Brost <matthew.brost@intel.com>
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent bf2d0d88
...@@ -542,6 +542,10 @@ static int do_gt_restart(struct xe_gt *gt) ...@@ -542,6 +542,10 @@ static int do_gt_restart(struct xe_gt *gt)
for_each_hw_engine(hwe, gt, id) for_each_hw_engine(hwe, gt, id)
xe_hw_engine_enable_ring(hwe); xe_hw_engine_enable_ring(hwe);
err = xe_uc_sanitize_reset(&gt->uc);
if (err)
return err;
err = xe_uc_init_hw(&gt->uc); err = xe_uc_init_hw(&gt->uc);
if (err) if (err)
return err; return err;
......
...@@ -80,6 +80,10 @@ int xe_uc_init_post_hwconfig(struct xe_uc *uc) ...@@ -80,6 +80,10 @@ int xe_uc_init_post_hwconfig(struct xe_uc *uc)
if (!xe_device_uc_enabled(uc_to_xe(uc))) if (!xe_device_uc_enabled(uc_to_xe(uc)))
return 0; return 0;
err = xe_uc_sanitize_reset(uc);
if (err)
return err;
err = xe_guc_init_post_hwconfig(&uc->guc); err = xe_guc_init_post_hwconfig(&uc->guc);
if (err) if (err)
return err; return err;
...@@ -101,13 +105,13 @@ static int uc_reset(struct xe_uc *uc) ...@@ -101,13 +105,13 @@ static int uc_reset(struct xe_uc *uc)
return 0; return 0;
} }
void xe_uc_sanitize(struct xe_uc *uc) static void xe_uc_sanitize(struct xe_uc *uc)
{ {
xe_huc_sanitize(&uc->huc); xe_huc_sanitize(&uc->huc);
xe_guc_sanitize(&uc->guc); xe_guc_sanitize(&uc->guc);
} }
static int xe_uc_sanitize_reset(struct xe_uc *uc) int xe_uc_sanitize_reset(struct xe_uc *uc)
{ {
xe_uc_sanitize(uc); xe_uc_sanitize(uc);
...@@ -147,10 +151,6 @@ int xe_uc_init_hw(struct xe_uc *uc) ...@@ -147,10 +151,6 @@ int xe_uc_init_hw(struct xe_uc *uc)
if (!xe_device_uc_enabled(uc_to_xe(uc))) if (!xe_device_uc_enabled(uc_to_xe(uc)))
return 0; return 0;
ret = xe_uc_sanitize_reset(uc);
if (ret)
return ret;
ret = xe_huc_upload(&uc->huc); ret = xe_huc_upload(&uc->huc);
if (ret) if (ret)
return ret; return ret;
......
...@@ -19,6 +19,6 @@ void xe_uc_stop_prepare(struct xe_uc *uc); ...@@ -19,6 +19,6 @@ void xe_uc_stop_prepare(struct xe_uc *uc);
int xe_uc_stop(struct xe_uc *uc); int xe_uc_stop(struct xe_uc *uc);
int xe_uc_start(struct xe_uc *uc); int xe_uc_start(struct xe_uc *uc);
int xe_uc_suspend(struct xe_uc *uc); int xe_uc_suspend(struct xe_uc *uc);
void xe_uc_sanitize(struct xe_uc *uc); int xe_uc_sanitize_reset(struct xe_uc *uc);
#endif #endif
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