[PATCH v2 06/13] drm/xe/pf: Don't reprovision policies if already default

Michal Wajdeczko
2026-04-02T19:18:17Z

There is no need to send policy updates to the GuC if policies
were not changed from the default settings (usually zero value).

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Piotr Piórkowski <piotr.piorkowski@intel.com>
---
drivers/gpu/drm/xe/xe_gt_sriov_pf_policy.c | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_pf_policy.c b/drivers/gpu/drm/xe/xe_gt_sriov_pf_policy.c
index aa80b4abd42f..0007ed7e0d38 100644
--- a/drivers/gpu/drm/xe/xe_gt_sriov_pf_policy.c
+++ b/drivers/gpu/drm/xe/xe_gt_sriov_pf_policy.c
@@ -177,6 +177,9 @@ static int pf_reprovision_sched_if_idle(struct xe_gt *gt)
xe_gt_assert(gt, IS_SRIOV_PF(gt_to_xe(gt)));
lockdep_assert_held(xe_gt_sriov_pf_master_mutex(gt));

+ if (!gt->sriov.pf.policy.guc.sched_if_idle)
+ return 0;
+
return pf_provision_sched_if_idle(gt, gt->sriov.pf.policy.guc.sched_if_idle);
}

@@ -255,6 +258,9 @@ static int pf_reprovision_reset_engine(struct xe_gt *gt)
xe_gt_assert(gt, IS_SRIOV_PF(gt_to_xe(gt)));
lockdep_assert_held(xe_gt_sriov_pf_master_mutex(gt));

+ if (!gt->sriov.pf.policy.guc.reset_engine)
+ return 0;
+
return pf_provision_reset_engine(gt, gt->sriov.pf.policy.guc.reset_engine);
}

@@ -321,6 +327,9 @@ static int pf_reprovision_sample_period(struct xe_gt *gt)
xe_gt_assert(gt, IS_SRIOV_PF(gt_to_xe(gt)));
lockdep_assert_held(xe_gt_sriov_pf_master_mutex(gt));

+ if (!gt->sriov.pf.policy.guc.sample_period)
+ return 0;
+
return pf_provision_sample_period(gt, gt->sriov.pf.policy.guc.sample_period);
}

--
2.47.1