xref: /linux/drivers/gpu/drm/xe/xe_configfs.h (revision 55a42f78ffd386e01a5404419f8c5ded7db70a21)
1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2025 Intel Corporation
4  */
5 #ifndef _XE_CONFIGFS_H_
6 #define _XE_CONFIGFS_H_
7 
8 #include <linux/limits.h>
9 #include <linux/types.h>
10 
11 #include <xe_hw_engine_types.h>
12 
13 struct pci_dev;
14 
15 #if IS_ENABLED(CONFIG_CONFIGFS_FS)
16 int xe_configfs_init(void);
17 void xe_configfs_exit(void);
18 void xe_configfs_check_device(struct pci_dev *pdev);
19 bool xe_configfs_get_survivability_mode(struct pci_dev *pdev);
20 u64 xe_configfs_get_engines_allowed(struct pci_dev *pdev);
21 bool xe_configfs_get_psmi_enabled(struct pci_dev *pdev);
22 u32 xe_configfs_get_ctx_restore_mid_bb(struct pci_dev *pdev, enum xe_engine_class,
23 				       const u32 **cs);
24 u32 xe_configfs_get_ctx_restore_post_bb(struct pci_dev *pdev, enum xe_engine_class,
25 					const u32 **cs);
26 #else
27 static inline int xe_configfs_init(void) { return 0; }
28 static inline void xe_configfs_exit(void) { }
29 static inline void xe_configfs_check_device(struct pci_dev *pdev) { }
30 static inline bool xe_configfs_get_survivability_mode(struct pci_dev *pdev) { return false; }
31 static inline u64 xe_configfs_get_engines_allowed(struct pci_dev *pdev) { return U64_MAX; }
32 static inline bool xe_configfs_get_psmi_enabled(struct pci_dev *pdev) { return false; }
33 static inline u32 xe_configfs_get_ctx_restore_mid_bb(struct pci_dev *pdev, enum xe_engine_class,
34 						     const u32 **cs) { return 0; }
35 static inline u32 xe_configfs_get_ctx_restore_post_bb(struct pci_dev *pdev, enum xe_engine_class,
36 						      const u32 **cs) { return 0; }
37 #endif
38 
39 #endif
40