xref: /linux/drivers/gpu/drm/xe/xe_lmtt.h (revision 220994d61cebfc04f071d69049127657c7e8191b)
1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2023 Intel Corporation
4  */
5 
6 #ifndef _XE_LMTT_H_
7 #define _XE_LMTT_H_
8 
9 #include <linux/types.h>
10 
11 struct xe_bo;
12 struct xe_lmtt;
13 struct xe_lmtt_ops;
14 
15 #ifdef CONFIG_PCI_IOV
16 int xe_lmtt_init(struct xe_lmtt *lmtt);
17 void xe_lmtt_init_hw(struct xe_lmtt *lmtt);
18 void xe_lmtt_invalidate_hw(struct xe_lmtt *lmtt);
19 int xe_lmtt_prepare_pages(struct xe_lmtt *lmtt, unsigned int vfid, u64 range);
20 int xe_lmtt_populate_pages(struct xe_lmtt *lmtt, unsigned int vfid, struct xe_bo *bo, u64 offset);
21 void xe_lmtt_drop_pages(struct xe_lmtt *lmtt, unsigned int vfid);
22 u64 xe_lmtt_estimate_pt_size(struct xe_lmtt *lmtt, u64 size);
23 #else
xe_lmtt_init(struct xe_lmtt * lmtt)24 static inline int xe_lmtt_init(struct xe_lmtt *lmtt) { return 0; }
xe_lmtt_init_hw(struct xe_lmtt * lmtt)25 static inline void xe_lmtt_init_hw(struct xe_lmtt *lmtt) { }
26 #endif
27 
28 #endif
29