xref: /linux/drivers/gpu/drm/lima/lima_dump.h (revision 4b4193256c8d3bc3a5397b5cd9494c2ad386317d)
1 /* SPDX-License-Identifier: GPL-2.0 OR MIT */
2 /* Copyright 2020 Qiang Yu <yuq825@gmail.com> */
3 
4 #ifndef __LIMA_DUMP_H__
5 #define __LIMA_DUMP_H__
6 
7 #include <linux/types.h>
8 
9 /**
10  * dump file format for all the information to start a lima task
11  *
12  * top level format
13  * | magic code "LIMA" | format version | num tasks | data size |
14  * | reserved | reserved | reserved | reserved |
15  * | task 1 ID | task 1 size | num chunks | reserved | task 1 data |
16  * | task 2 ID | task 2 size | num chunks | reserved | task 2 data |
17  * ...
18  *
19  * task data format
20  * | chunk 1 ID | chunk 1 size | reserved | reserved | chunk 1 data |
21  * | chunk 2 ID | chunk 2 size | reserved | reserved | chunk 2 data |
22  * ...
23  *
24  */
25 
26 #define LIMA_DUMP_MAJOR 1
27 #define LIMA_DUMP_MINOR 0
28 
29 #define LIMA_DUMP_MAGIC 0x414d494c
30 
31 struct lima_dump_head {
32 	__u32 magic;
33 	__u16 version_major;
34 	__u16 version_minor;
35 	__u32 num_tasks;
36 	__u32 size;
37 	__u32 reserved[4];
38 };
39 
40 #define LIMA_DUMP_TASK_GP   0
41 #define LIMA_DUMP_TASK_PP   1
42 #define LIMA_DUMP_TASK_NUM  2
43 
44 struct lima_dump_task {
45 	__u32 id;
46 	__u32 size;
47 	__u32 num_chunks;
48 	__u32 reserved;
49 };
50 
51 #define LIMA_DUMP_CHUNK_FRAME         0
52 #define LIMA_DUMP_CHUNK_BUFFER        1
53 #define LIMA_DUMP_CHUNK_PROCESS_NAME  2
54 #define LIMA_DUMP_CHUNK_PROCESS_ID    3
55 #define LIMA_DUMP_CHUNK_NUM           4
56 
57 struct lima_dump_chunk {
58 	__u32 id;
59 	__u32 size;
60 	__u32 reserved[2];
61 };
62 
63 struct lima_dump_chunk_buffer {
64 	__u32 id;
65 	__u32 size;
66 	__u32 va;
67 	__u32 reserved;
68 };
69 
70 struct lima_dump_chunk_pid {
71 	__u32 id;
72 	__u32 size;
73 	__u32 pid;
74 	__u32 reserved;
75 };
76 
77 #endif
78