xref: /linux/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.h (revision 52a5a22d8afe3bd195f7b470c7535c63717f5ff7)
1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2023 Intel Corporation
4  */
5 
6 #ifndef _XE_GT_TLB_INVALIDATION_H_
7 #define _XE_GT_TLB_INVALIDATION_H_
8 
9 #include <linux/types.h>
10 
11 #include "xe_gt_tlb_invalidation_types.h"
12 
13 struct xe_gt;
14 struct xe_guc;
15 struct xe_vma;
16 
17 int xe_gt_tlb_invalidation_init_early(struct xe_gt *gt);
18 
19 void xe_gt_tlb_invalidation_reset(struct xe_gt *gt);
20 int xe_gt_tlb_invalidation_ggtt(struct xe_gt *gt);
21 int xe_gt_tlb_invalidation_vma(struct xe_gt *gt,
22 			       struct xe_gt_tlb_invalidation_fence *fence,
23 			       struct xe_vma *vma);
24 int xe_gt_tlb_invalidation_range(struct xe_gt *gt,
25 				 struct xe_gt_tlb_invalidation_fence *fence,
26 				 u64 start, u64 end, u32 asid);
27 int xe_guc_tlb_invalidation_done_handler(struct xe_guc *guc, u32 *msg, u32 len);
28 
29 void xe_gt_tlb_invalidation_fence_init(struct xe_gt *gt,
30 				       struct xe_gt_tlb_invalidation_fence *fence,
31 				       bool stack);
32 void xe_gt_tlb_invalidation_fence_signal(struct xe_gt_tlb_invalidation_fence *fence);
33 
34 static inline void
35 xe_gt_tlb_invalidation_fence_wait(struct xe_gt_tlb_invalidation_fence *fence)
36 {
37 	dma_fence_wait(&fence->base, false);
38 }
39 
40 #endif	/* _XE_GT_TLB_INVALIDATION_ */
41