xref: /linux/drivers/gpu/drm/xe/xe_mert.h (revision c7decec2f2d2ab0366567f9e30c0e1418cece43f)
1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright(c) 2025, Intel Corporation. All rights reserved.
4  */
5 
6 #ifndef _XE_MERT_H_
7 #define _XE_MERT_H_
8 
9 #include <linux/completion.h>
10 #include <linux/spinlock.h>
11 #include <linux/types.h>
12 
13 struct xe_device;
14 
15 /**
16  * struct xe_mert - MERT related data
17  */
18 struct xe_mert {
19 	/** @lock: protects the TLB invalidation status */
20 	spinlock_t lock;
21 	/** @tlb_inv_triggered: indicates if TLB invalidation was triggered */
22 	bool tlb_inv_triggered;
23 	/** @tlb_inv_done: completion of TLB invalidation */
24 	struct completion tlb_inv_done;
25 };
26 
27 #ifdef CONFIG_PCI_IOV
28 void xe_mert_init_early(struct xe_device *xe);
29 int xe_mert_invalidate_lmtt(struct xe_device *xe);
30 void xe_mert_irq_handler(struct xe_device *xe, u32 master_ctl);
31 #else
32 static inline void xe_mert_irq_handler(struct xe_device *xe, u32 master_ctl) { }
33 #endif
34 
35 #endif
36