1 /* 2 * Copyright 2014, 2015 Red Hat. 3 * 4 * Permission is hereby granted, free of charge, to any person obtaining a 5 * copy of this software and associated documentation files (the "Software"), 6 * to deal in the Software without restriction, including without limitation 7 * on the rights to use, copy, modify, merge, publish, distribute, sub 8 * license, and/or sell copies of the Software, and to permit persons to whom 9 * the Software is furnished to do so, subject to the following conditions: 10 * 11 * The above copyright notice and this permission notice (including the next 12 * paragraph) shall be included in all copies or substantial portions of the 13 * Software. 14 * 15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL 18 * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, 19 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 21 * USE OR OTHER DEALINGS IN THE SOFTWARE. 22 */ 23 #ifndef VTEST_PROTOCOL 24 #define VTEST_PROTOCOL 25 26 #define VTEST_DEFAULT_SOCKET_NAME "/tmp/.virgl_test" 27 28 /* 32-bit length field */ 29 /* 32-bit cmd field */ 30 #define VTEST_HDR_SIZE 2 31 #define VTEST_CMD_LEN 0 /* length of data */ 32 #define VTEST_CMD_ID 1 33 #define VTEST_CMD_DATA_START 2 34 35 /* vtest cmds */ 36 #define VCMD_GET_CAPS 1 37 38 #define VCMD_RESOURCE_CREATE 2 39 #define VCMD_RESOURCE_UNREF 3 40 41 #define VCMD_TRANSFER_GET 4 42 #define VCMD_TRANSFER_PUT 5 43 44 #define VCMD_SUBMIT_CMD 6 45 46 #define VCMD_RESOURCE_BUSY_WAIT 7 47 48 /* pass the process cmd line for debugging */ 49 #define VCMD_CREATE_RENDERER 8 50 /* get caps */ 51 /* 0 length cmd */ 52 /* resp VCMD_GET_CAPS + caps */ 53 54 #define VCMD_RES_CREATE_SIZE 10 55 #define VCMD_RES_CREATE_RES_HANDLE 0 56 #define VCMD_RES_CREATE_TARGET 1 57 #define VCMD_RES_CREATE_FORMAT 2 58 #define VCMD_RES_CREATE_BIND 3 59 #define VCMD_RES_CREATE_WIDTH 4 60 #define VCMD_RES_CREATE_HEIGHT 5 61 #define VCMD_RES_CREATE_DEPTH 6 62 #define VCMD_RES_CREATE_ARRAY_SIZE 7 63 #define VCMD_RES_CREATE_LAST_LEVEL 8 64 #define VCMD_RES_CREATE_NR_SAMPLES 9 65 66 #define VCMD_RES_UNREF_SIZE 1 67 #define VCMD_RES_UNREF_RES_HANDLE 0 68 69 #define VCMD_TRANSFER_HDR_SIZE 11 70 #define VCMD_TRANSFER_RES_HANDLE 0 71 #define VCMD_TRANSFER_LEVEL 1 72 #define VCMD_TRANSFER_STRIDE 2 73 #define VCMD_TRANSFER_LAYER_STRIDE 3 74 #define VCMD_TRANSFER_X 4 75 #define VCMD_TRANSFER_Y 5 76 #define VCMD_TRANSFER_Z 6 77 #define VCMD_TRANSFER_WIDTH 7 78 #define VCMD_TRANSFER_HEIGHT 8 79 #define VCMD_TRANSFER_DEPTH 9 80 #define VCMD_TRANSFER_DATA_SIZE 10 81 82 #define VCMD_BUSY_WAIT_FLAG_WAIT 1 83 84 #define VCMD_BUSY_WAIT_SIZE 2 85 #define VCMD_BUSY_WAIT_HANDLE 0 86 #define VCMD_BUSY_WAIT_FLAGS 1 87 88 #endif 89