drm/xe/mert: Move MERT initialization to xe_mert.c
authorMichal Wajdeczko <michal.wajdeczko@intel.com>
Fri, 9 Jan 2026 15:12:19 +0000 (16:12 +0100)
committerMichal Wajdeczko <michal.wajdeczko@intel.com>
Mon, 12 Jan 2026 13:38:44 +0000 (14:38 +0100)
Most of the MERT code is already in dedicated file, no reason to
keep internal MERT data structure initialization elsewhere.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Lukasz Laguna <lukasz.laguna@intel.com>
Reviewed-by: Lukasz Laguna <lukasz.laguna@intel.com>
Link: https://patch.msgid.link/20260109151219.26206-6-michal.wajdeczko@intel.com
drivers/gpu/drm/xe/xe_mert.c
drivers/gpu/drm/xe/xe_mert.h
drivers/gpu/drm/xe/xe_sriov_pf.c

index ad832e8..fc027d2 100644 (file)
 #include "xe_mmio.h"
 #include "xe_tile.h"
 
+/**
+ * xe_mert_init_early() - Initialize MERT data
+ * @xe: the &xe_device with MERT to init
+ */
+void xe_mert_init_early(struct xe_device *xe)
+{
+       struct xe_tile *tile = xe_device_get_root_tile(xe);
+       struct xe_mert *mert = &tile->mert;
+
+       spin_lock_init(&mert->lock);
+       init_completion(&mert->tlb_inv_done);
+}
+
 /**
  * xe_mert_invalidate_lmtt() - Invalidate MERT LMTT
  * @xe: the &xe_device with MERT
index 44daeca..fc97720 100644 (file)
@@ -25,6 +25,7 @@ struct xe_mert {
 };
 
 #ifdef CONFIG_PCI_IOV
+void xe_mert_init_early(struct xe_device *xe);
 int xe_mert_invalidate_lmtt(struct xe_device *xe);
 void xe_mert_irq_handler(struct xe_device *xe, u32 master_ctl);
 #else
index 72423bb..6ce3c58 100644 (file)
@@ -90,7 +90,6 @@ bool xe_sriov_pf_readiness(struct xe_device *xe)
  */
 int xe_sriov_pf_init_early(struct xe_device *xe)
 {
-       struct xe_mert *mert = &xe_device_get_root_tile(xe)->mert;
        int err;
 
        xe_assert(xe, IS_SRIOV_PF(xe));
@@ -112,8 +111,7 @@ int xe_sriov_pf_init_early(struct xe_device *xe)
 
        xe_sriov_pf_service_init(xe);
 
-       spin_lock_init(&mert->lock);
-       init_completion(&mert->tlb_inv_done);
+       xe_mert_init_early(xe);
 
        return 0;
 }