drm/i915: split power well 'set' handler to separate enable/disable/sync_hw
[deliverable/linux.git] / drivers / gpu / drm / i915 / i915_drv.h
index 857871b7630571ed182b9ddc88170b19e53e28f0..9e26103af07aa673247322f198a430b4f96bc896 100644 (file)
@@ -1014,6 +1014,36 @@ struct intel_ilk_power_mgmt {
        struct drm_i915_gem_object *renderctx;
 };
 
+struct drm_i915_private;
+struct i915_power_well;
+
+struct i915_power_well_ops {
+       /*
+        * Synchronize the well's hw state to match the current sw state, for
+        * example enable/disable it based on the current refcount. Called
+        * during driver init and resume time, possibly after first calling
+        * the enable/disable handlers.
+        */
+       void (*sync_hw)(struct drm_i915_private *dev_priv,
+                       struct i915_power_well *power_well);
+       /*
+        * Enable the well and resources that depend on it (for example
+        * interrupts located on the well). Called after the 0->1 refcount
+        * transition.
+        */
+       void (*enable)(struct drm_i915_private *dev_priv,
+                      struct i915_power_well *power_well);
+       /*
+        * Disable the well and resources that depend on it. Called after
+        * the 1->0 refcount transition.
+        */
+       void (*disable)(struct drm_i915_private *dev_priv,
+                       struct i915_power_well *power_well);
+       /* Returns the hw enabled state. */
+       bool (*is_enabled)(struct drm_i915_private *dev_priv,
+                          struct i915_power_well *power_well);
+};
+
 /* Power well structure for haswell */
 struct i915_power_well {
        const char *name;
@@ -1022,10 +1052,7 @@ struct i915_power_well {
        int count;
        unsigned long domains;
        void *data;
-       void (*set)(struct drm_i915_private *dev_priv, struct i915_power_well *power_well,
-                   bool enable);
-       bool (*is_enabled)(struct drm_i915_private *dev_priv,
-                          struct i915_power_well *power_well);
+       const struct i915_power_well_ops *ops;
 };
 
 struct i915_power_domains {
This page took 0.026537 seconds and 5 git commands to generate.