xref: /linux/drivers/gpu/drm/xe/xe_guc_submit.h (revision 570f7e331f5febb30f1384817463c7e42b65ca7d)
1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2022 Intel Corporation
4  */
5 
6 #ifndef _XE_GUC_SUBMIT_H_
7 #define _XE_GUC_SUBMIT_H_
8 
9 #include <linux/types.h>
10 
11 struct drm_printer;
12 struct xe_exec_queue;
13 struct xe_guc;
14 
15 int xe_guc_submit_init(struct xe_guc *guc, unsigned int num_ids);
16 int xe_guc_submit_enable(struct xe_guc *guc);
17 void xe_guc_submit_disable(struct xe_guc *guc);
18 
19 int xe_guc_submit_reset_prepare(struct xe_guc *guc);
20 void xe_guc_submit_reset_wait(struct xe_guc *guc);
21 void xe_guc_submit_stop(struct xe_guc *guc);
22 int xe_guc_submit_start(struct xe_guc *guc);
23 void xe_guc_submit_pause(struct xe_guc *guc);
24 void xe_guc_submit_pause_abort(struct xe_guc *guc);
25 void xe_guc_submit_pause_vf(struct xe_guc *guc);
26 void xe_guc_submit_unpause(struct xe_guc *guc);
27 void xe_guc_submit_unpause_vf(struct xe_guc *guc);
28 void xe_guc_submit_unpause_prepare_vf(struct xe_guc *guc);
29 void xe_guc_submit_wedge(struct xe_guc *guc);
30 
31 int xe_guc_read_stopped(struct xe_guc *guc);
32 int xe_guc_sched_done_handler(struct xe_guc *guc, u32 *msg, u32 len);
33 int xe_guc_deregister_done_handler(struct xe_guc *guc, u32 *msg, u32 len);
34 int xe_guc_exec_queue_reset_handler(struct xe_guc *guc, u32 *msg, u32 len);
35 int xe_guc_exec_queue_memory_cat_error_handler(struct xe_guc *guc, u32 *msg,
36 					       u32 len);
37 int xe_guc_uncorrectable_error_handler(struct xe_guc *guc, u32 *msg, u32 len);
38 int xe_guc_exec_queue_reset_failure_handler(struct xe_guc *guc, u32 *msg, u32 len);
39 int xe_guc_error_capture_handler(struct xe_guc *guc, u32 *msg, u32 len);
40 int xe_guc_exec_queue_cgp_sync_done_handler(struct xe_guc *guc, u32 *msg, u32 len);
41 int xe_guc_exec_queue_cgp_context_error_handler(struct xe_guc *guc, u32 *msg,
42 						u32 len);
43 
44 struct xe_guc_submit_exec_queue_snapshot *
45 xe_guc_exec_queue_snapshot_capture(struct xe_exec_queue *q);
46 void
47 xe_guc_exec_queue_snapshot_capture_delayed(struct xe_guc_submit_exec_queue_snapshot *snapshot);
48 void
49 xe_guc_exec_queue_snapshot_print(struct xe_guc_submit_exec_queue_snapshot *snapshot,
50 				 struct drm_printer *p);
51 void
52 xe_guc_exec_queue_snapshot_free(struct xe_guc_submit_exec_queue_snapshot *snapshot);
53 void xe_guc_submit_print(struct xe_guc *guc, struct drm_printer *p);
54 void xe_guc_register_vf_exec_queue(struct xe_exec_queue *q, int ctx_type);
55 
56 bool xe_guc_has_registered_mlrc_queues(struct xe_guc *guc);
57 
58 int xe_guc_contexts_hwsp_rebase(struct xe_guc *guc, void *scratch);
59 
60 #endif
61