Commit 39fa9a7d authored by Jani Nikula's avatar Jani Nikula
parent 5ed8c7bc
...@@ -62,7 +62,13 @@ void intel_gt_common_init_early(struct intel_gt *gt) ...@@ -62,7 +62,13 @@ void intel_gt_common_init_early(struct intel_gt *gt)
/* Preliminary initialization of Tile 0 */ /* Preliminary initialization of Tile 0 */
int intel_root_gt_init_early(struct drm_i915_private *i915) int intel_root_gt_init_early(struct drm_i915_private *i915)
{ {
struct intel_gt *gt = to_gt(i915); struct intel_gt *gt;
gt = drmm_kzalloc(&i915->drm, sizeof(*gt), GFP_KERNEL);
if (!gt)
return -ENOMEM;
i915->gt0 = gt;
gt->i915 = i915; gt->i915 = i915;
gt->uncore = &i915->uncore; gt->uncore = &i915->uncore;
......
...@@ -318,10 +318,10 @@ struct drm_i915_private { ...@@ -318,10 +318,10 @@ struct drm_i915_private {
struct i915_hwmon *hwmon; struct i915_hwmon *hwmon;
/* Abstract the submission mechanism (legacy ringbuffer or execlists) away */ /* Abstract the submission mechanism (legacy ringbuffer or execlists) away */
struct intel_gt gt0; struct intel_gt *gt0;
/* /*
* i915->gt[0] == &i915->gt0 * i915->gt[0] == i915->gt0
*/ */
struct intel_gt *gt[I915_MAX_GT]; struct intel_gt *gt[I915_MAX_GT];
...@@ -382,9 +382,9 @@ static inline struct drm_i915_private *pdev_to_i915(struct pci_dev *pdev) ...@@ -382,9 +382,9 @@ static inline struct drm_i915_private *pdev_to_i915(struct pci_dev *pdev)
return pci_get_drvdata(pdev); return pci_get_drvdata(pdev);
} }
static inline struct intel_gt *to_gt(struct drm_i915_private *i915) static inline struct intel_gt *to_gt(const struct drm_i915_private *i915)
{ {
return &i915->gt0; return i915->gt0;
} }
/* Simple iterator over all initialised engines */ /* Simple iterator over all initialised engines */
......
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