xref: /linux/drivers/gpu/drm/xe/xe_devcoredump.h (revision cb8fef4b07f71da01843457b66e579ad248a625e)
1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2023 Intel Corporation
4  */
5 
6 #ifndef _XE_DEVCOREDUMP_H_
7 #define _XE_DEVCOREDUMP_H_
8 
9 #include <linux/types.h>
10 
11 struct drm_printer;
12 struct xe_device;
13 struct xe_exec_queue;
14 struct xe_gt;
15 struct xe_sched_job;
16 
17 #ifdef CONFIG_DEV_COREDUMP
18 void __xe_devcoredump(struct xe_gt *gt, struct xe_exec_queue *q,
19 		      struct xe_sched_job *job, const char *fmt, ...);
20 int xe_devcoredump_init(struct xe_device *xe);
21 #else
22 static inline void __xe_devcoredump(struct xe_gt *gt, struct xe_exec_queue *q,
23 				    struct xe_sched_job *job,
24 				    const char *fmt, ...)
25 {
26 }
27 
28 static inline int xe_devcoredump_init(struct xe_device *xe)
29 {
30 	return 0;
31 }
32 #endif
33 
34 #define xe_devcoredump(_q, _job, _fmt, ...) \
35 	__xe_devcoredump((_q)->gt, _q, _job, _fmt, ##__VA_ARGS__)
36 #define xe_devcoredump_gt(_gt, _fmt, ...) \
37 	__xe_devcoredump(_gt, NULL, NULL, _fmt, ##__VA_ARGS__)
38 
39 void xe_print_blob_ascii85(struct drm_printer *p, const char *prefix, char suffix,
40 			   const void *blob, size_t offset, size_t size);
41 
42 #endif
43