]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
drm/i915: Add function to call a power well's sync_hw() hook
authorImre Deak <imre.deak@intel.com>
Tue, 22 Feb 2022 16:51:35 +0000 (18:51 +0200)
committerImre Deak <imre.deak@intel.com>
Mon, 28 Feb 2022 15:03:33 +0000 (17:03 +0200)
Add a function to call a power well's sync_hw() hook, instead of
open-coding the same, as a step towards making the low-level
power well internals (i915_power_well_ops/desc structs) hidden.

The cached-enable state should be always up-to-date, so update it
whenever sync_hw() is called.

No functional change.

Suggested-by: Jani Nikula <jani.nikula@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220222165137.1004194-7-imre.deak@intel.com
drivers/gpu/drm/i915/display/intel_display_power.c
drivers/gpu/drm/i915/display/intel_display_power_well.c
drivers/gpu/drm/i915/display/intel_display_power_well.h

index a18895a9aa42f0a48ccd78b5650e03da82d0cb31..b8b914d8f0b562a67a71e0d3b6065463e45c66bf 100644 (file)
@@ -5016,11 +5016,8 @@ static void intel_power_domains_sync_hw(struct drm_i915_private *dev_priv)
        struct i915_power_well *power_well;
 
        mutex_lock(&power_domains->lock);
-       for_each_power_well(dev_priv, power_well) {
-               power_well->desc->ops->sync_hw(dev_priv, power_well);
-               power_well->hw_enabled =
-                       power_well->desc->ops->is_enabled(dev_priv, power_well);
-       }
+       for_each_power_well(dev_priv, power_well)
+               intel_power_well_sync_hw(dev_priv, power_well);
        mutex_unlock(&power_domains->lock);
 }
 
index e21190854fa0f02105c540d6dbee444b3134b069..63b97bcc64bc3327f6c43d0c7e1eacb2607c5c71 100644 (file)
@@ -22,6 +22,14 @@ void intel_power_well_disable(struct drm_i915_private *i915,
        power_well->desc->ops->disable(i915, power_well);
 }
 
+void intel_power_well_sync_hw(struct drm_i915_private *i915,
+                             struct i915_power_well *power_well)
+{
+       power_well->desc->ops->sync_hw(i915, power_well);
+       power_well->hw_enabled =
+               power_well->desc->ops->is_enabled(i915, power_well);
+}
+
 void intel_power_well_get(struct drm_i915_private *i915,
                          struct i915_power_well *power_well)
 {
index bc77de3a8d4fc75204eb15f51f543fd4a53b5948..ba5bbd36f7fc0c5b3c0d1669af3b84845e1b0b4e 100644 (file)
@@ -107,6 +107,8 @@ void intel_power_well_enable(struct drm_i915_private *i915,
                             struct i915_power_well *power_well);
 void intel_power_well_disable(struct drm_i915_private *i915,
                              struct i915_power_well *power_well);
+void intel_power_well_sync_hw(struct drm_i915_private *i915,
+                             struct i915_power_well *power_well);
 void intel_power_well_get(struct drm_i915_private *i915,
                          struct i915_power_well *power_well);
 void intel_power_well_put(struct drm_i915_private *i915,