1 /* SPDX-License-Identifier: MIT */ 2 /* 3 * Copyright © 2021 Intel Corporation 4 */ 5 6 #ifndef _XE_GGTT_H_ 7 #define _XE_GGTT_H_ 8 9 #include "xe_ggtt_types.h" 10 11 struct drm_printer; 12 13 void xe_ggtt_set_pte(struct xe_ggtt *ggtt, u64 addr, u64 pte); 14 int xe_ggtt_init_early(struct xe_ggtt *ggtt); 15 int xe_ggtt_init(struct xe_ggtt *ggtt); 16 void xe_ggtt_printk(struct xe_ggtt *ggtt, const char *prefix); 17 18 int xe_ggtt_balloon(struct xe_ggtt *ggtt, u64 start, u64 size, struct drm_mm_node *node); 19 void xe_ggtt_deballoon(struct xe_ggtt *ggtt, struct drm_mm_node *node); 20 21 int xe_ggtt_insert_special_node(struct xe_ggtt *ggtt, struct drm_mm_node *node, 22 u32 size, u32 align); 23 int xe_ggtt_insert_special_node_locked(struct xe_ggtt *ggtt, 24 struct drm_mm_node *node, 25 u32 size, u32 align, u32 mm_flags); 26 void xe_ggtt_remove_node(struct xe_ggtt *ggtt, struct drm_mm_node *node, 27 bool invalidate); 28 void xe_ggtt_map_bo(struct xe_ggtt *ggtt, struct xe_bo *bo); 29 int xe_ggtt_insert_bo(struct xe_ggtt *ggtt, struct xe_bo *bo); 30 int xe_ggtt_insert_bo_at(struct xe_ggtt *ggtt, struct xe_bo *bo, 31 u64 start, u64 end); 32 void xe_ggtt_remove_bo(struct xe_ggtt *ggtt, struct xe_bo *bo); 33 34 int xe_ggtt_dump(struct xe_ggtt *ggtt, struct drm_printer *p); 35 36 #ifdef CONFIG_PCI_IOV 37 void xe_ggtt_assign(struct xe_ggtt *ggtt, const struct drm_mm_node *node, u16 vfid); 38 #endif 39 40 #endif 41