xref: /linux/drivers/gpu/drm/i915/gt/intel_tlb.h (revision 34dc1baba215b826e454b8d19e4f24adbeb7d00d)
1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2023 Intel Corporation
4  */
5 
6 #ifndef INTEL_TLB_H
7 #define INTEL_TLB_H
8 
9 #include <linux/seqlock.h>
10 #include <linux/types.h>
11 
12 #include "intel_gt_types.h"
13 
14 void intel_gt_invalidate_tlb_full(struct intel_gt *gt, u32 seqno);
15 
16 void intel_gt_init_tlb(struct intel_gt *gt);
17 void intel_gt_fini_tlb(struct intel_gt *gt);
18 
19 static inline u32 intel_gt_tlb_seqno(const struct intel_gt *gt)
20 {
21 	return seqprop_sequence(&gt->tlb.seqno);
22 }
23 
24 static inline u32 intel_gt_next_invalidate_tlb_full(const struct intel_gt *gt)
25 {
26 	return intel_gt_tlb_seqno(gt) | 1;
27 }
28 
29 #endif /* INTEL_TLB_H */
30