]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915: Move intel_gt_pm_init under intel_gt_init_early
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>
Fri, 21 Jun 2019 07:07:43 +0000 (08:07 +0100)
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>
Fri, 21 Jun 2019 12:48:18 +0000 (13:48 +0100)
And also rename to intel_gt_pm_init_early and make it operate on gt.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20190621070811.7006-5-tvrtko.ursulin@linux.intel.com
drivers/gpu/drm/i915/gt/intel_gt.c
drivers/gpu/drm/i915/gt/intel_gt_pm.c
drivers/gpu/drm/i915/gt/intel_gt_pm.h
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/selftests/mock_gem_device.c

index eccb52cf37b60f541a96d157f7a303e45ad2164f..f760c2e0253e85baa9dc919cb4117c515ac59a53 100644 (file)
@@ -6,6 +6,7 @@
 #include "i915_drv.h"
 
 #include "intel_gt.h"
+#include "intel_gt_pm.h"
 
 void intel_gt_init_early(struct intel_gt *gt, struct drm_i915_private *i915)
 {
@@ -16,4 +17,6 @@ void intel_gt_init_early(struct intel_gt *gt, struct drm_i915_private *i915)
        INIT_LIST_HEAD(&gt->closed_vma);
 
        spin_lock_init(&gt->closed_lock);
+
+       intel_gt_pm_init_early(gt);
 }
index 7b59677517629278341981ebdfd71aeb3a75353e..6062840b5b46e52d2fb5e8d9362cd66e8b2ab633 100644 (file)
@@ -80,10 +80,10 @@ void intel_gt_pm_put(struct drm_i915_private *i915)
        intel_wakeref_put(&i915->runtime_pm, &i915->gt.wakeref, intel_gt_park);
 }
 
-void intel_gt_pm_init(struct drm_i915_private *i915)
+void intel_gt_pm_init_early(struct intel_gt *gt)
 {
-       intel_wakeref_init(&i915->gt.wakeref);
-       BLOCKING_INIT_NOTIFIER_HEAD(&i915->gt.pm_notifications);
+       intel_wakeref_init(&gt->wakeref);
+       BLOCKING_INIT_NOTIFIER_HEAD(&gt->pm_notifications);
 }
 
 static bool reset_engines(struct drm_i915_private *i915)
index 7dd1130a19a480ce02b07d99afb2d2358ec32709..b6049a9078908f9ebd01548b9f89dc7f6a089b0c 100644 (file)
@@ -10,6 +10,7 @@
 #include <linux/types.h>
 
 struct drm_i915_private;
+struct intel_gt;
 
 enum {
        INTEL_GT_UNPARK,
@@ -19,7 +20,7 @@ enum {
 void intel_gt_pm_get(struct drm_i915_private *i915);
 void intel_gt_pm_put(struct drm_i915_private *i915);
 
-void intel_gt_pm_init(struct drm_i915_private *i915);
+void intel_gt_pm_init_early(struct intel_gt *gt);
 
 void intel_gt_sanitize(struct drm_i915_private *i915, bool force);
 void intel_gt_resume(struct drm_i915_private *i915);
index fc8fd41dd32e71bedda11e5f5b463f54165521b0..9de1b1e889495f9f6c7a98d75b7bde7fefb05a6f 100644 (file)
@@ -1746,8 +1746,6 @@ int i915_gem_init_early(struct drm_i915_private *dev_priv)
 {
        int err;
 
-       intel_gt_pm_init(dev_priv);
-
        i915_gem_init__mm(dev_priv);
        i915_gem_init__pm(dev_priv);
 
index 2b87200477f693ef373141d783636efa3c42b4c0..021ba42a3a008bc3b596b7a8e25c00011bf14897 100644 (file)
@@ -181,7 +181,6 @@ struct drm_i915_private *mock_gem_device(void)
        mock_uncore_init(&i915->uncore);
        i915_gem_init__mm(i915);
        intel_gt_init_early(&i915->gt, i915);
-       intel_gt_pm_init(i915);
        atomic_inc(&i915->gt.wakeref.count); /* disable; no hw support */
 
        init_waitqueue_head(&i915->gpu_error.wait_queue);