Commit cdeea858 authored by Andi Shyti's avatar Andi Shyti Committed by Matt Roper
Browse files

drm/i915: Remove unused i915->ggtt



The reference to the GGTT from the private date is not used
anymore. Remove it.

The ggtt in the root gt will now be dynamically allocated and the
deallocation handled by the drmm_* managed allocation.

Suggested-by: default avatarMatt Roper <matthew.d.roper@intel.com>
Signed-off-by: default avatarAndi Shyti <andi.shyti@linux.intel.com>
Cc: Michał Winiarski <michal.winiarski@intel.com>
Reviewed-by: default avatarSujaritha Sundaresan <sujaritha.sundaresan@intel.com>
Reviewed-by: default avatarMatt Roper <matthew.d.roper@intel.com>
Signed-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211219212500.61432-7-andi.shyti@linux.intel.com
parent 17190a34
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -3,6 +3,8 @@
 * Copyright © 2019 Intel Corporation
 */

#include <drm/drm_managed.h>

#include "intel_gt_debugfs.h"

#include "gem/i915_gem_lmem.h"
@@ -83,9 +85,11 @@ int intel_gt_probe_lmem(struct intel_gt *gt)
	return 0;
}

void intel_gt_init_hw_early(struct intel_gt *gt, struct i915_ggtt *ggtt)
int intel_gt_assign_ggtt(struct intel_gt *gt)
{
	gt->ggtt = ggtt;
	gt->ggtt = drmm_kzalloc(&gt->i915->drm, sizeof(*gt->ggtt), GFP_KERNEL);

	return gt->ggtt ? 0 : -ENOMEM;
}

static const struct intel_mmio_range icl_l3bank_steering_table[] = {
+1 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ static inline struct intel_gt *huc_to_gt(struct intel_huc *huc)

void intel_gt_init_early(struct intel_gt *gt, struct drm_i915_private *i915);
void __intel_gt_init_early(struct intel_gt *gt, struct drm_i915_private *i915);
void intel_gt_init_hw_early(struct intel_gt *gt, struct i915_ggtt *ggtt);
int intel_gt_assign_ggtt(struct intel_gt *gt);
int intel_gt_probe_lmem(struct intel_gt *gt);
int intel_gt_init_mmio(struct intel_gt *gt);
int __must_check intel_gt_init_hw(struct intel_gt *gt);
+3 −1
Original line number Diff line number Diff line
@@ -569,7 +569,9 @@ static int i915_driver_hw_probe(struct drm_i915_private *dev_priv)

	i915_perf_init(dev_priv);

	intel_gt_init_hw_early(to_gt(dev_priv), &dev_priv->ggtt);
	ret = intel_gt_assign_ggtt(to_gt(dev_priv));
	if (ret)
		goto err_perf;

	ret = i915_ggtt_probe_hw(dev_priv);
	if (ret)
+0 −2
Original line number Diff line number Diff line
@@ -1008,8 +1008,6 @@ struct drm_i915_private {
	struct drm_atomic_state *modeset_restore_state;
	struct drm_modeset_acquire_ctx reset_ctx;

	struct i915_ggtt ggtt; /* VM representing the global address space */

	struct i915_gem_mm mm;

	/* Kernel Modesetting */
+11 −9
Original line number Diff line number Diff line
@@ -1737,26 +1737,28 @@ int i915_gem_gtt_mock_selftests(void)
		SUBTEST(igt_gtt_insert),
	};
	struct drm_i915_private *i915;
	struct i915_ggtt *ggtt;
	struct intel_gt *gt;
	int err;

	i915 = mock_gem_device();
	if (!i915)
		return -ENOMEM;

	ggtt = kmalloc(sizeof(*ggtt), GFP_KERNEL);
	if (!ggtt) {
		err = -ENOMEM;
	/* allocate the ggtt */
	err = intel_gt_assign_ggtt(to_gt(i915));
	if (err)
		goto out_put;
	}
	mock_init_ggtt(i915, ggtt);

	err = i915_subtests(tests, ggtt);
	gt = to_gt(i915);

	mock_init_ggtt(gt);

	err = i915_subtests(tests, gt->ggtt);

	mock_device_flush(i915);
	i915_gem_drain_freed_objects(i915);
	mock_fini_ggtt(ggtt);
	kfree(ggtt);
	mock_fini_ggtt(gt->ggtt);

out_put:
	mock_destroy_device(i915);
	return err;
Loading