1 // SPDX-License-Identifier: MIT
3 * Copyright © 2021 Intel Corporation
6 #include <drm/drm_managed.h>
9 #include "gt/intel_gt.h"
10 #include "gt/intel_sa_media.h"
12 int intel_sa_mediagt_setup(struct intel_gt *gt, phys_addr_t phys_addr,
15 struct drm_i915_private *i915 = gt->i915;
16 struct intel_uncore *uncore;
18 uncore = drmm_kzalloc(&i915->drm, sizeof(*uncore), GFP_KERNEL);
22 uncore->gsi_offset = gsi_offset;
24 gt->irq_lock = to_gt(i915)->irq_lock;
25 intel_gt_common_init_early(gt);
26 intel_uncore_init_early(uncore, gt);
29 * Standalone media shares the general MMIO space with the primary
30 * GT. We'll re-use the primary GT's mapping.
32 uncore->regs = intel_uncore_regs(&i915->uncore);
33 if (drm_WARN_ON(&i915->drm, uncore->regs == NULL))
37 gt->phys_addr = phys_addr;
40 * For current platforms we can assume there's only a single
41 * media GT and cache it for quick lookup.
43 drm_WARN_ON(&i915->drm, i915->media_gt);