[Intel-gfx] [PATCH 3/8] drm/i915: Extend rpm in intel_guc_global_policies_update

tilak.tangudu at intel.com tilak.tangudu at intel.com
Thu Jul 21 09:59:50 UTC 2022


From: Tilak Tangudu <tilak.tangudu at intel.com>

intel_guc_is_ready need to be guarded with rpm
helpers as it needs guc interaction.

Signed-off-by: Tilak Tangudu <tilak.tangudu at intel.com>
---
 drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c
index ba7541f3ca61..1d3b3559420d 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c
@@ -195,11 +195,14 @@ int intel_guc_global_policies_update(struct intel_guc *guc)
 
 	guc_policies_init(guc);
 
-	if (!intel_guc_is_ready(guc))
+	wakeref = intel_runtime_pm_get(&gt->i915->runtime_pm);
+	if (!intel_guc_is_ready(guc)) {
+		intel_runtime_pm_put(&gt->i915->runtime_pm, wakeref);
 		return 0;
+	}
 
-	with_intel_runtime_pm(&gt->i915->runtime_pm, wakeref)
-		ret = guc_action_policies_update(guc, scheduler_policies);
+	ret = guc_action_policies_update(guc, scheduler_policies);
+	intel_runtime_pm_put(&gt->i915->runtime_pm, wakeref);
 
 	return ret;
 }
-- 
2.25.1



More information about the Intel-gfx mailing list