Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 24635c51 authored by Tvrtko Ursulin's avatar Tvrtko Ursulin
Browse files

drm/i915: Move intel_gt initialization to a separate file



As it will grow in a following patch make a new home for it.

v2:
 * Convert mock_gem_device as well. (Chris)

v3:
 * Rename to intel_gt_init_early and move call site to i915_drv.c. (Chris)

v4:
 * Adjust SPDX tags.
 * No need to gt/ path when including intel_gt_types.h. (Chris)

Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20190621070811.7006-3-tvrtko.ursulin@linux.intel.com
parent e5be5c7a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@ gt-y += \
	gt/intel_context.o \
	gt/intel_engine_cs.o \
	gt/intel_engine_pm.o \
	gt/intel_gt.o \
	gt/intel_gt_pm.o \
	gt/intel_hangcheck.o \
	gt/intel_lrc.o \
+14 −0
Original line number Diff line number Diff line
// SPDX-License-Identifier: MIT
/*
 * Copyright © 2019 Intel Corporation
 */

#include "intel_gt.h"

void intel_gt_init_early(struct intel_gt *gt)
{
	INIT_LIST_HEAD(&gt->active_rings);
	INIT_LIST_HEAD(&gt->closed_vma);

	spin_lock_init(&gt->closed_lock);
}
+13 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: MIT */
/*
 * Copyright © 2019 Intel Corporation
 */

#ifndef __INTEL_GT__
#define __INTEL_GT__

#include "intel_gt_types.h"

void intel_gt_init_early(struct intel_gt *gt);

#endif /* __INTEL_GT_H__ */
+3 −0
Original line number Diff line number Diff line
@@ -61,6 +61,7 @@

#include "gem/i915_gem_context.h"
#include "gem/i915_gem_ioctls.h"
#include "gt/intel_gt.h"
#include "gt/intel_gt_pm.h"
#include "gt/intel_reset.h"
#include "gt/intel_workarounds.h"
@@ -922,6 +923,8 @@ static int i915_driver_init_early(struct drm_i915_private *dev_priv)
	if (ret < 0)
		goto err_engines;

	intel_gt_init_early(&dev_priv->gt);

	ret = i915_gem_init_early(dev_priv);
	if (ret < 0)
		goto err_workqueues;
+0 −4
Original line number Diff line number Diff line
@@ -1748,10 +1748,6 @@ int i915_gem_init_early(struct drm_i915_private *dev_priv)

	intel_gt_pm_init(dev_priv);

	INIT_LIST_HEAD(&dev_priv->gt.active_rings);
	INIT_LIST_HEAD(&dev_priv->gt.closed_vma);
	spin_lock_init(&dev_priv->gt.closed_lock);

	i915_gem_init__mm(dev_priv);
	i915_gem_init__pm(dev_priv);

Loading