Lines Matching full:gt

22 void intel_gt_init_early(struct intel_gt *gt, struct drm_i915_private *i915)  in intel_gt_init_early()  argument
24 gt->i915 = i915; in intel_gt_init_early()
25 gt->uncore = &i915->uncore; in intel_gt_init_early()
27 spin_lock_init(&gt->irq_lock); in intel_gt_init_early()
29 INIT_LIST_HEAD(&gt->closed_vma); in intel_gt_init_early()
30 spin_lock_init(&gt->closed_lock); in intel_gt_init_early()
32 intel_gt_init_buffer_pool(gt); in intel_gt_init_early()
33 intel_gt_init_reset(gt); in intel_gt_init_early()
34 intel_gt_init_requests(gt); in intel_gt_init_early()
35 intel_gt_init_timelines(gt); in intel_gt_init_early()
36 intel_gt_pm_init_early(gt); in intel_gt_init_early()
38 intel_rps_init_early(&gt->rps); in intel_gt_init_early()
39 intel_uc_init_early(&gt->uc); in intel_gt_init_early()
42 void intel_gt_init_hw_early(struct intel_gt *gt, struct i915_ggtt *ggtt) in intel_gt_init_hw_early() argument
44 gt->ggtt = ggtt; in intel_gt_init_hw_early()
47 int intel_gt_init_mmio(struct intel_gt *gt) in intel_gt_init_mmio() argument
49 intel_uc_init_mmio(&gt->uc); in intel_gt_init_mmio()
50 intel_sseu_info_init(gt); in intel_gt_init_mmio()
52 return intel_engines_init_mmio(gt); in intel_gt_init_mmio()
55 static void init_unused_ring(struct intel_gt *gt, u32 base) in init_unused_ring() argument
57 struct intel_uncore *uncore = gt->uncore; in init_unused_ring()
65 static void init_unused_rings(struct intel_gt *gt) in init_unused_rings() argument
67 struct drm_i915_private *i915 = gt->i915; in init_unused_rings()
70 init_unused_ring(gt, PRB1_BASE); in init_unused_rings()
71 init_unused_ring(gt, SRB0_BASE); in init_unused_rings()
72 init_unused_ring(gt, SRB1_BASE); in init_unused_rings()
73 init_unused_ring(gt, SRB2_BASE); in init_unused_rings()
74 init_unused_ring(gt, SRB3_BASE); in init_unused_rings()
76 init_unused_ring(gt, SRB0_BASE); in init_unused_rings()
77 init_unused_ring(gt, SRB1_BASE); in init_unused_rings()
79 init_unused_ring(gt, PRB1_BASE); in init_unused_rings()
80 init_unused_ring(gt, PRB2_BASE); in init_unused_rings()
84 int intel_gt_init_hw(struct intel_gt *gt) in intel_gt_init_hw() argument
86 struct drm_i915_private *i915 = gt->i915; in intel_gt_init_hw()
87 struct intel_uncore *uncore = gt->uncore; in intel_gt_init_hw()
90 gt->last_init_time = ktime_get(); in intel_gt_init_hw()
104 /* Apply the GT workarounds... */ in intel_gt_init_hw()
105 intel_gt_apply_workarounds(gt); in intel_gt_init_hw()
107 intel_gt_verify_workarounds(gt, "init"); in intel_gt_init_hw()
109 intel_gt_init_swizzling(gt); in intel_gt_init_hw()
117 init_unused_rings(gt); in intel_gt_init_hw()
119 ret = i915_ppgtt_init_hw(gt); in intel_gt_init_hw()
126 ret = intel_uc_init_hw(&gt->uc); in intel_gt_init_hw()
132 intel_mocs_init(gt); in intel_gt_init_hw()
161 intel_gt_clear_error_registers(struct intel_gt *gt, in intel_gt_clear_error_registers() argument
164 struct drm_i915_private *i915 = gt->i915; in intel_gt_clear_error_registers()
165 struct intel_uncore *uncore = gt->uncore; in intel_gt_clear_error_registers()
199 for_each_engine_masked(engine, gt, engine_mask, id) in intel_gt_clear_error_registers()
204 static void gen6_check_faults(struct intel_gt *gt) in gen6_check_faults() argument
210 for_each_engine(engine, gt, id) { in gen6_check_faults()
227 static void gen8_check_faults(struct intel_gt *gt) in gen8_check_faults() argument
229 struct intel_uncore *uncore = gt->uncore; in gen8_check_faults()
233 if (INTEL_GEN(gt->i915) >= 12) { in gen8_check_faults()
268 void intel_gt_check_and_clear_faults(struct intel_gt *gt) in intel_gt_check_and_clear_faults() argument
270 struct drm_i915_private *i915 = gt->i915; in intel_gt_check_and_clear_faults()
274 gen8_check_faults(gt); in intel_gt_check_and_clear_faults()
276 gen6_check_faults(gt); in intel_gt_check_and_clear_faults()
280 intel_gt_clear_error_registers(gt, ALL_ENGINES); in intel_gt_check_and_clear_faults()
283 void intel_gt_flush_ggtt_writes(struct intel_gt *gt) in intel_gt_flush_ggtt_writes() argument
285 struct intel_uncore *uncore = gt->uncore; in intel_gt_flush_ggtt_writes()
309 if (INTEL_INFO(gt->i915)->has_coherent_ggtt) in intel_gt_flush_ggtt_writes()
312 intel_gt_chipset_flush(gt); in intel_gt_flush_ggtt_writes()
324 void intel_gt_chipset_flush(struct intel_gt *gt) in intel_gt_chipset_flush() argument
327 if (INTEL_GEN(gt->i915) < 6) in intel_gt_chipset_flush()
331 void intel_gt_driver_register(struct intel_gt *gt) in intel_gt_driver_register() argument
333 intel_rps_driver_register(&gt->rps); in intel_gt_driver_register()
335 debugfs_gt_register(gt); in intel_gt_driver_register()
338 static int intel_gt_init_scratch(struct intel_gt *gt, unsigned int size) in intel_gt_init_scratch() argument
340 struct drm_i915_private *i915 = gt->i915; in intel_gt_init_scratch()
353 vma = i915_vma_instance(obj, &gt->ggtt->vm, NULL); in intel_gt_init_scratch()
363 gt->scratch = i915_vma_make_unshrinkable(vma); in intel_gt_init_scratch()
372 static void intel_gt_fini_scratch(struct intel_gt *gt) in intel_gt_fini_scratch() argument
374 i915_vma_unpin_and_release(&gt->scratch, 0); in intel_gt_fini_scratch()
377 static struct i915_address_space *kernel_vm(struct intel_gt *gt) in kernel_vm() argument
379 if (INTEL_PPGTT(gt->i915) > INTEL_PPGTT_ALIASING) in kernel_vm()
380 return &i915_ppgtt_create(gt)->vm; in kernel_vm()
382 return i915_vm_get(&gt->ggtt->vm); in kernel_vm()
385 static int __engines_record_defaults(struct intel_gt *gt) in __engines_record_defaults() argument
401 for_each_engine(engine, gt, id) { in __engines_record_defaults()
446 if (intel_gt_wait_for_idle(gt, I915_GEM_IDLE_TIMEOUT) == -ETIME) { in __engines_record_defaults()
484 intel_gt_set_wedged(gt); in __engines_record_defaults()
501 static int __engines_verify_workarounds(struct intel_gt *gt) in __engines_verify_workarounds() argument
510 for_each_engine(engine, gt, id) { in __engines_verify_workarounds()
516 if (intel_gt_wait_for_idle(gt, I915_GEM_IDLE_TIMEOUT) == -ETIME) in __engines_verify_workarounds()
522 static void __intel_gt_disable(struct intel_gt *gt) in __intel_gt_disable() argument
524 intel_gt_set_wedged_on_fini(gt); in __intel_gt_disable()
526 intel_gt_suspend_prepare(gt); in __intel_gt_disable()
527 intel_gt_suspend_late(gt); in __intel_gt_disable()
529 GEM_BUG_ON(intel_gt_pm_is_awake(gt)); in __intel_gt_disable()
532 int intel_gt_init(struct intel_gt *gt) in intel_gt_init() argument
536 err = i915_inject_probe_error(gt->i915, -ENODEV); in intel_gt_init()
547 intel_uncore_forcewake_get(gt->uncore, FORCEWAKE_ALL); in intel_gt_init()
549 intel_gt_init_clock_frequency(gt); in intel_gt_init()
551 err = intel_gt_init_scratch(gt, IS_GEN(gt->i915, 2) ? SZ_256K : SZ_4K); in intel_gt_init()
555 intel_gt_pm_init(gt); in intel_gt_init()
557 gt->vm = kernel_vm(gt); in intel_gt_init()
558 if (!gt->vm) { in intel_gt_init()
563 err = intel_engines_init(gt); in intel_gt_init()
567 err = intel_uc_init(&gt->uc); in intel_gt_init()
571 err = intel_gt_resume(gt); in intel_gt_init()
575 err = __engines_record_defaults(gt); in intel_gt_init()
579 err = __engines_verify_workarounds(gt); in intel_gt_init()
583 err = i915_inject_probe_error(gt->i915, -EIO); in intel_gt_init()
589 __intel_gt_disable(gt); in intel_gt_init()
590 intel_uc_fini_hw(&gt->uc); in intel_gt_init()
592 intel_uc_fini(&gt->uc); in intel_gt_init()
594 intel_engines_release(gt); in intel_gt_init()
595 i915_vm_put(fetch_and_zero(&gt->vm)); in intel_gt_init()
597 intel_gt_pm_fini(gt); in intel_gt_init()
598 intel_gt_fini_scratch(gt); in intel_gt_init()
601 intel_gt_set_wedged_on_init(gt); in intel_gt_init()
602 intel_uncore_forcewake_put(gt->uncore, FORCEWAKE_ALL); in intel_gt_init()
606 void intel_gt_driver_remove(struct intel_gt *gt) in intel_gt_driver_remove() argument
608 __intel_gt_disable(gt); in intel_gt_driver_remove()
610 intel_uc_driver_remove(&gt->uc); in intel_gt_driver_remove()
612 intel_engines_release(gt); in intel_gt_driver_remove()
615 void intel_gt_driver_unregister(struct intel_gt *gt) in intel_gt_driver_unregister() argument
617 intel_rps_driver_unregister(&gt->rps); in intel_gt_driver_unregister()
624 intel_gt_set_wedged(gt); in intel_gt_driver_unregister()
627 void intel_gt_driver_release(struct intel_gt *gt) in intel_gt_driver_release() argument
633 with_intel_runtime_pm(gt->uncore->rpm, wakeref) in intel_gt_driver_release()
634 __intel_gt_reset(gt, ALL_ENGINES); in intel_gt_driver_release()
636 vm = fetch_and_zero(&gt->vm); in intel_gt_driver_release()
640 intel_gt_pm_fini(gt); in intel_gt_driver_release()
641 intel_gt_fini_scratch(gt); in intel_gt_driver_release()
642 intel_gt_fini_buffer_pool(gt); in intel_gt_driver_release()
645 void intel_gt_driver_late_release(struct intel_gt *gt) in intel_gt_driver_late_release() argument
650 intel_uc_driver_late_release(&gt->uc); in intel_gt_driver_late_release()
651 intel_gt_fini_requests(gt); in intel_gt_driver_late_release()
652 intel_gt_fini_reset(gt); in intel_gt_driver_late_release()
653 intel_gt_fini_timelines(gt); in intel_gt_driver_late_release()
654 intel_engines_free(gt); in intel_gt_driver_late_release()