xref: /linux/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.h (revision 566ab427f827b0256d3e8ce0235d088e6a9c28bd)
1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2023-2024 Intel Corporation
4  */
5 
6 #ifndef _XE_GT_SRIOV_PF_CONFIG_H_
7 #define _XE_GT_SRIOV_PF_CONFIG_H_
8 
9 #include <linux/types.h>
10 
11 enum xe_guc_klv_threshold_index;
12 struct drm_printer;
13 struct xe_gt;
14 
15 u64 xe_gt_sriov_pf_config_get_ggtt(struct xe_gt *gt, unsigned int vfid);
16 int xe_gt_sriov_pf_config_set_ggtt(struct xe_gt *gt, unsigned int vfid, u64 size);
17 int xe_gt_sriov_pf_config_set_fair_ggtt(struct xe_gt *gt,
18 					unsigned int vfid, unsigned int num_vfs);
19 int xe_gt_sriov_pf_config_bulk_set_ggtt(struct xe_gt *gt,
20 					unsigned int vfid, unsigned int num_vfs, u64 size);
21 
22 u32 xe_gt_sriov_pf_config_get_ctxs(struct xe_gt *gt, unsigned int vfid);
23 int xe_gt_sriov_pf_config_set_ctxs(struct xe_gt *gt, unsigned int vfid, u32 num_ctxs);
24 int xe_gt_sriov_pf_config_set_fair_ctxs(struct xe_gt *gt, unsigned int vfid, unsigned int num_vfs);
25 int xe_gt_sriov_pf_config_bulk_set_ctxs(struct xe_gt *gt, unsigned int vfid, unsigned int num_vfs,
26 					u32 num_ctxs);
27 
28 u32 xe_gt_sriov_pf_config_get_dbs(struct xe_gt *gt, unsigned int vfid);
29 int xe_gt_sriov_pf_config_set_dbs(struct xe_gt *gt, unsigned int vfid, u32 num_dbs);
30 int xe_gt_sriov_pf_config_set_fair_dbs(struct xe_gt *gt, unsigned int vfid, unsigned int num_vfs);
31 int xe_gt_sriov_pf_config_bulk_set_dbs(struct xe_gt *gt, unsigned int vfid, unsigned int num_vfs,
32 				       u32 num_dbs);
33 
34 u64 xe_gt_sriov_pf_config_get_lmem(struct xe_gt *gt, unsigned int vfid);
35 int xe_gt_sriov_pf_config_set_lmem(struct xe_gt *gt, unsigned int vfid, u64 size);
36 int xe_gt_sriov_pf_config_set_fair_lmem(struct xe_gt *gt, unsigned int vfid, unsigned int num_vfs);
37 int xe_gt_sriov_pf_config_bulk_set_lmem(struct xe_gt *gt, unsigned int vfid, unsigned int num_vfs,
38 					u64 size);
39 
40 u32 xe_gt_sriov_pf_config_get_exec_quantum(struct xe_gt *gt, unsigned int vfid);
41 int xe_gt_sriov_pf_config_set_exec_quantum(struct xe_gt *gt, unsigned int vfid, u32 exec_quantum);
42 
43 u32 xe_gt_sriov_pf_config_get_preempt_timeout(struct xe_gt *gt, unsigned int vfid);
44 int xe_gt_sriov_pf_config_set_preempt_timeout(struct xe_gt *gt, unsigned int vfid,
45 					      u32 preempt_timeout);
46 
47 u32 xe_gt_sriov_pf_config_get_threshold(struct xe_gt *gt, unsigned int vfid,
48 					enum xe_guc_klv_threshold_index index);
49 int xe_gt_sriov_pf_config_set_threshold(struct xe_gt *gt, unsigned int vfid,
50 					enum xe_guc_klv_threshold_index index, u32 value);
51 
52 int xe_gt_sriov_pf_config_set_fair(struct xe_gt *gt, unsigned int vfid, unsigned int num_vfs);
53 int xe_gt_sriov_pf_config_sanitize(struct xe_gt *gt, unsigned int vfid, long timeout);
54 int xe_gt_sriov_pf_config_release(struct xe_gt *gt, unsigned int vfid, bool force);
55 int xe_gt_sriov_pf_config_push(struct xe_gt *gt, unsigned int vfid, bool refresh);
56 
57 bool xe_gt_sriov_pf_config_is_empty(struct xe_gt *gt, unsigned int vfid);
58 
59 void xe_gt_sriov_pf_config_restart(struct xe_gt *gt);
60 
61 int xe_gt_sriov_pf_config_print_ggtt(struct xe_gt *gt, struct drm_printer *p);
62 int xe_gt_sriov_pf_config_print_ctxs(struct xe_gt *gt, struct drm_printer *p);
63 int xe_gt_sriov_pf_config_print_dbs(struct xe_gt *gt, struct drm_printer *p);
64 
65 int xe_gt_sriov_pf_config_print_available_ggtt(struct xe_gt *gt, struct drm_printer *p);
66 
67 #endif
68