• 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 #define VCMD_RES_CREATE_SIZE 10
68 #define VCMD_RES_CREATE_RES_HANDLE 0
69 #define VCMD_RES_CREATE_TARGET 1
70 #define VCMD_RES_CREATE_FORMAT 2
71 #define VCMD_RES_CREATE_BIND 3
72 #define VCMD_RES_CREATE_WIDTH 4
73 #define VCMD_RES_CREATE_HEIGHT 5
74 #define VCMD_RES_CREATE_DEPTH 6
75 #define VCMD_RES_CREATE_ARRAY_SIZE 7
76 #define VCMD_RES_CREATE_LAST_LEVEL 8
77 #define VCMD_RES_CREATE_NR_SAMPLES 9
78 
79 #define VCMD_RES_CREATE2_SIZE 11
80 #define VCMD_RES_CREATE2_RES_HANDLE 0
81 #define VCMD_RES_CREATE2_TARGET 1
82 #define VCMD_RES_CREATE2_FORMAT 2
83 #define VCMD_RES_CREATE2_BIND 3
84 #define VCMD_RES_CREATE2_WIDTH 4
85 #define VCMD_RES_CREATE2_HEIGHT 5
86 #define VCMD_RES_CREATE2_DEPTH 6
87 #define VCMD_RES_CREATE2_ARRAY_SIZE 7
88 #define VCMD_RES_CREATE2_LAST_LEVEL 8
89 #define VCMD_RES_CREATE2_NR_SAMPLES 9
90 #define VCMD_RES_CREATE2_DATA_SIZE 10
91 
92 #define VCMD_RES_UNREF_SIZE 1
93 #define VCMD_RES_UNREF_RES_HANDLE 0
94 
95 #define VCMD_TRANSFER_HDR_SIZE 11
96 #define VCMD_TRANSFER_RES_HANDLE 0
97 #define VCMD_TRANSFER_LEVEL 1
98 #define VCMD_TRANSFER_STRIDE 2
99 #define VCMD_TRANSFER_LAYER_STRIDE 3
100 #define VCMD_TRANSFER_X 4
101 #define VCMD_TRANSFER_Y 5
102 #define VCMD_TRANSFER_Z 6
103 #define VCMD_TRANSFER_WIDTH 7
104 #define VCMD_TRANSFER_HEIGHT 8
105 #define VCMD_TRANSFER_DEPTH 9
106 #define VCMD_TRANSFER_DATA_SIZE 10
107 
108 #define VCMD_TRANSFER2_HDR_SIZE 10
109 #define VCMD_TRANSFER2_RES_HANDLE 0
110 #define VCMD_TRANSFER2_LEVEL 1
111 #define VCMD_TRANSFER2_X 2
112 #define VCMD_TRANSFER2_Y 3
113 #define VCMD_TRANSFER2_Z 4
114 #define VCMD_TRANSFER2_WIDTH 5
115 #define VCMD_TRANSFER2_HEIGHT 6
116 #define VCMD_TRANSFER2_DEPTH 7
117 #define VCMD_TRANSFER2_DATA_SIZE 8
118 #define VCMD_TRANSFER2_OFFSET 9
119 
120 #define VCMD_BUSY_WAIT_FLAG_WAIT 1
121 
122 #define VCMD_BUSY_WAIT_SIZE 2
123 #define VCMD_BUSY_WAIT_HANDLE 0
124 #define VCMD_BUSY_WAIT_FLAGS 1
125 
126 #define VCMD_PING_PROTOCOL_VERSION_SIZE 0
127 
128 #define VCMD_PROTOCOL_VERSION_SIZE 1
129 #define VCMD_PROTOCOL_VERSION_VERSION 0
130 
131 #endif
132