Commit 4605bb73 authored by Chris Wilson's avatar Chris Wilson

drm/i915/gt: Pull timeline initialise to intel_gt_init_early

Our timelines are currently contained within an intel_gt, and we only
need to perform list/spinlock initialisation, so we can pull the
intel_timelines_init() into our intel_gt_init_early().
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191101130406.4142-1-chris@chris-wilson.co.uk
parent 1f594b20
......@@ -25,6 +25,7 @@ void intel_gt_init_early(struct intel_gt *gt, struct drm_i915_private *i915)
intel_gt_init_reset(gt);
intel_gt_init_requests(gt);
intel_gt_init_timelines(gt);
intel_gt_pm_init_early(gt);
intel_rps_init_early(&gt->rps);
......@@ -395,4 +396,5 @@ void intel_gt_driver_late_release(struct intel_gt *gt)
{
intel_uc_driver_late_release(&gt->uc);
intel_gt_fini_reset(gt);
intel_gt_fini_timelines(gt);
}
......@@ -262,7 +262,7 @@ int intel_timeline_init(struct intel_timeline *timeline,
return 0;
}
static void timelines_init(struct intel_gt *gt)
void intel_gt_init_timelines(struct intel_gt *gt)
{
struct intel_gt_timelines *timelines = &gt->timelines;
......@@ -273,11 +273,6 @@ static void timelines_init(struct intel_gt *gt)
INIT_LIST_HEAD(&timelines->hwsp_free_list);
}
void intel_timelines_init(struct drm_i915_private *i915)
{
timelines_init(&i915->gt);
}
void intel_timeline_fini(struct intel_timeline *timeline)
{
GEM_BUG_ON(atomic_read(&timeline->pin_count));
......@@ -562,7 +557,7 @@ void __intel_timeline_free(struct kref *kref)
kfree_rcu(timeline, rcu);
}
static void timelines_fini(struct intel_gt *gt)
void intel_gt_fini_timelines(struct intel_gt *gt)
{
struct intel_gt_timelines *timelines = &gt->timelines;
......@@ -570,11 +565,6 @@ static void timelines_fini(struct intel_gt *gt)
GEM_BUG_ON(!list_empty(&timelines->hwsp_free_list));
}
void intel_timelines_fini(struct drm_i915_private *i915)
{
timelines_fini(&i915->gt);
}
#if IS_ENABLED(CONFIG_DRM_I915_SELFTEST)
#include "gt/selftests/mock_timeline.c"
#include "gt/selftest_timeline.c"
......
......@@ -88,7 +88,7 @@ int intel_timeline_read_hwsp(struct i915_request *from,
struct i915_request *until,
u32 *hwsp_offset);
void intel_timelines_init(struct drm_i915_private *i915);
void intel_timelines_fini(struct drm_i915_private *i915);
void intel_gt_init_timelines(struct intel_gt *gt);
void intel_gt_fini_timelines(struct intel_gt *gt);
#endif
......@@ -1227,8 +1227,6 @@ int i915_gem_init(struct drm_i915_private *dev_priv)
mkwrite_device_info(dev_priv)->page_sizes =
I915_GTT_PAGE_SIZE_4K;
intel_timelines_init(dev_priv);
ret = i915_gem_init_userptr(dev_priv);
if (ret)
return ret;
......@@ -1342,7 +1340,6 @@ int i915_gem_init(struct drm_i915_private *dev_priv)
if (ret != -EIO) {
intel_uc_cleanup_firmwares(&dev_priv->gt.uc);
i915_gem_cleanup_userptr(dev_priv);
intel_timelines_fini(dev_priv);
}
if (ret == -EIO) {
......@@ -1406,7 +1403,6 @@ void i915_gem_driver_release(struct drm_i915_private *dev_priv)
intel_uc_cleanup_firmwares(&dev_priv->gt.uc);
i915_gem_cleanup_userptr(dev_priv);
intel_timelines_fini(dev_priv);
i915_gem_drain_freed_objects(dev_priv);
......
......@@ -65,8 +65,6 @@ static void mock_device_release(struct drm_device *dev)
mock_engine_free(engine);
i915_gem_driver_release__contexts(i915);
intel_timelines_fini(i915);
drain_workqueue(i915->wq);
i915_gem_drain_freed_objects(i915);
......@@ -180,8 +178,6 @@ struct drm_i915_private *mock_gem_device(void)
mock_init_contexts(i915);
intel_timelines_init(i915);
mock_init_ggtt(i915, &i915->ggtt);
i915->gt.ggtt = &i915->ggtt;
......@@ -207,7 +203,6 @@ struct drm_i915_private *mock_gem_device(void)
err_engine:
mock_engine_free(i915->engine[RCS0]);
err_unlock:
intel_timelines_fini(i915);
destroy_workqueue(i915->wq);
err_drv:
intel_memory_regions_driver_release(i915);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment