• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**************************************************************************
2  *
3  * Copyright (C) 2015 Red Hat Inc.
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included
13  * in all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
19  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21  * OTHER DEALINGS IN THE SOFTWARE.
22  *
23  **************************************************************************/
24 
25 #ifndef VTEST_PROTOCOL
26 #define VTEST_PROTOCOL
27 
28 #define VTEST_DEFAULT_SOCKET_NAME "/tmp/.virgl_test"
29 #define VTEST_PROTOCOL_VERSION 2
30 
31 /* 32-bit length field */
32 /* 32-bit cmd field */
33 #define VTEST_HDR_SIZE 2
34 #define VTEST_CMD_LEN 0 /* length of data */
35 #define VTEST_CMD_ID  1
36 #define VTEST_CMD_DATA_START 2
37 
38 /* vtest cmds */
39 #define VCMD_GET_CAPS 1
40 
41 #define VCMD_RESOURCE_CREATE 2
42 #define VCMD_RESOURCE_UNREF 3
43 
44 #define VCMD_TRANSFER_GET 4
45 #define VCMD_TRANSFER_PUT 5
46 
47 #define VCMD_SUBMIT_CMD 6
48 
49 #define VCMD_RESOURCE_BUSY_WAIT 7
50 
51 /* pass the process cmd line for debugging */
52 #define VCMD_CREATE_RENDERER 8
53 
54 #define VCMD_GET_CAPS2 9
55 /* get caps */
56 /* 0 length cmd */
57 /* resp VCMD_GET_CAPS + caps */
58 
59 #define VCMD_PING_PROTOCOL_VERSION 10
60 
61 #define VCMD_PROTOCOL_VERSION 11
62 
63 #define VCMD_RESOURCE_CREATE2 12
64 #define VCMD_TRANSFER_GET2 13
65 #define VCMD_TRANSFER_PUT2 14
66 
67 #ifdef VIRGL_RENDERER_UNSTABLE_APIS
68 /* since protocol version 3 */
69 #define VCMD_GET_PARAM 15
70 #define VCMD_GET_CAPSET 16
71 #define VCMD_CONTEXT_INIT 17
72 #endif /* VIRGL_RENDERER_UNSTABLE_APIS */
73 
74 #define VCMD_RES_CREATE_SIZE 10
75 #define VCMD_RES_CREATE_RES_HANDLE 0
76 #define VCMD_RES_CREATE_TARGET 1
77 #define VCMD_RES_CREATE_FORMAT 2
78 #define VCMD_RES_CREATE_BIND 3
79 #define VCMD_RES_CREATE_WIDTH 4
80 #define VCMD_RES_CREATE_HEIGHT 5
81 #define VCMD_RES_CREATE_DEPTH 6
82 #define VCMD_RES_CREATE_ARRAY_SIZE 7
83 #define VCMD_RES_CREATE_LAST_LEVEL 8
84 #define VCMD_RES_CREATE_NR_SAMPLES 9
85 
86 #define VCMD_RES_CREATE2_SIZE 11
87 #define VCMD_RES_CREATE2_RES_HANDLE 0
88 #define VCMD_RES_CREATE2_TARGET 1
89 #define VCMD_RES_CREATE2_FORMAT 2
90 #define VCMD_RES_CREATE2_BIND 3
91 #define VCMD_RES_CREATE2_WIDTH 4
92 #define VCMD_RES_CREATE2_HEIGHT 5
93 #define VCMD_RES_CREATE2_DEPTH 6
94 #define VCMD_RES_CREATE2_ARRAY_SIZE 7
95 #define VCMD_RES_CREATE2_LAST_LEVEL 8
96 #define VCMD_RES_CREATE2_NR_SAMPLES 9
97 #define VCMD_RES_CREATE2_DATA_SIZE 10
98 
99 #define VCMD_RES_UNREF_SIZE 1
100 #define VCMD_RES_UNREF_RES_HANDLE 0
101 
102 #define VCMD_TRANSFER_HDR_SIZE 11
103 #define VCMD_TRANSFER_RES_HANDLE 0
104 #define VCMD_TRANSFER_LEVEL 1
105 #define VCMD_TRANSFER_STRIDE 2
106 #define VCMD_TRANSFER_LAYER_STRIDE 3
107 #define VCMD_TRANSFER_X 4
108 #define VCMD_TRANSFER_Y 5
109 #define VCMD_TRANSFER_Z 6
110 #define VCMD_TRANSFER_WIDTH 7
111 #define VCMD_TRANSFER_HEIGHT 8
112 #define VCMD_TRANSFER_DEPTH 9
113 #define VCMD_TRANSFER_DATA_SIZE 10
114 
115 #define VCMD_TRANSFER2_HDR_SIZE 10
116 #define VCMD_TRANSFER2_RES_HANDLE 0
117 #define VCMD_TRANSFER2_LEVEL 1
118 #define VCMD_TRANSFER2_X 2
119 #define VCMD_TRANSFER2_Y 3
120 #define VCMD_TRANSFER2_Z 4
121 #define VCMD_TRANSFER2_WIDTH 5
122 #define VCMD_TRANSFER2_HEIGHT 6
123 #define VCMD_TRANSFER2_DEPTH 7
124 #define VCMD_TRANSFER2_DATA_SIZE 8
125 #define VCMD_TRANSFER2_OFFSET 9
126 
127 #define VCMD_BUSY_WAIT_FLAG_WAIT 1
128 
129 #define VCMD_BUSY_WAIT_SIZE 2
130 #define VCMD_BUSY_WAIT_HANDLE 0
131 #define VCMD_BUSY_WAIT_FLAGS 1
132 
133 #define VCMD_PING_PROTOCOL_VERSION_SIZE 0
134 
135 #define VCMD_PROTOCOL_VERSION_SIZE 1
136 #define VCMD_PROTOCOL_VERSION_VERSION 0
137 
138 #ifdef VIRGL_RENDERER_UNSTABLE_APIS
139 
140 #define VCMD_GET_PARAM_SIZE 1
141 #define VCMD_GET_PARAM_PARAM 0
142 /* resp param validity and value */
143 
144 #define VCMD_GET_CAPSET_SIZE 2
145 #define VCMD_GET_CAPSET_ID 0
146 #define VCMD_GET_CAPSET_VERSION 1
147 /* resp capset validity and contents */
148 
149 #define VCMD_CONTEXT_INIT_SIZE 1
150 #define VCMD_CONTEXT_INIT_CAPSET_ID 0
151 
152 #endif /* VIRGL_RENDERER_UNSTABLE_APIS */
153 
154 #endif /* VTEST_PROTOCOL */
155