drm/i915: Move GT powersaving init to i915_gem_init()
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 10 Nov 2017 14:26:29 +0000 (14:26 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 10 Nov 2017 17:20:26 +0000 (17:20 +0000)
GT powersaving is tightly coupled to the request infrastructure. To
avoid complications with the order of initialisation in the next patch
(where we want to send requests to hw during GEM init) move the
powersaving initialisation into the purview of i915_gem_init().

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171110142634.10551-3-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_pm.c

index 824515556733b70de173fa0688f85695a1a7ceea..37586f703c1e28ab75481396e900e02784d0cbe0 100644 (file)
@@ -5021,6 +5021,8 @@ int i915_gem_init(struct drm_i915_private *dev_priv)
        if (ret)
                goto out_unlock;
 
+       intel_init_gt_powersave(dev_priv);
+
        ret = i915_gem_init_hw(dev_priv);
        if (ret == -EIO) {
                /* Allow engine initialisation to fail by marking the GPU as
index 435dc18aa23945365721eab6c70374fc1d4a3e52..da11ba8986217eceaa202d3fdf145a32ea5d0e5a 100644 (file)
@@ -15198,8 +15198,6 @@ void intel_modeset_gem_init(struct drm_device *dev)
 {
        struct drm_i915_private *dev_priv = to_i915(dev);
 
-       intel_init_gt_powersave(dev_priv);
-
        intel_init_clock_gating(dev_priv);
 
        intel_setup_overlay(dev_priv);
index e09377df590d8b7042b92ffaea11fede0d57ad7b..48a127ac6de5397051fef222a12039de287a8419 100644 (file)
@@ -7918,7 +7918,6 @@ void intel_init_gt_powersave(struct drm_i915_private *dev_priv)
                intel_runtime_pm_get(dev_priv);
        }
 
-       mutex_lock(&dev_priv->drm.struct_mutex);
        mutex_lock(&dev_priv->pcu_lock);
 
        /* Initialize RPS limits (for userspace) */
@@ -7960,7 +7959,6 @@ void intel_init_gt_powersave(struct drm_i915_private *dev_priv)
        rps->boost_freq = rps->max_freq;
 
        mutex_unlock(&dev_priv->pcu_lock);
-       mutex_unlock(&dev_priv->drm.struct_mutex);
 
        intel_autoenable_gt_powersave(dev_priv);
 }