Home | History | Annotate | Download | only in vtest
      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 #ifndef VTEST_PROTOCOL
     25 #define VTEST_PROTOCOL
     26 
     27 #define VTEST_DEFAULT_SOCKET_NAME "/tmp/.virgl_test"
     28 
     29 /* 32-bit length field */
     30 /* 32-bit cmd field */
     31 #define VTEST_HDR_SIZE 2
     32 #define VTEST_CMD_LEN 0 /* length of data */
     33 #define VTEST_CMD_ID  1
     34 #define VTEST_CMD_DATA_START 2
     35 
     36 /* vtest cmds */
     37 #define VCMD_GET_CAPS 1
     38 
     39 #define VCMD_RESOURCE_CREATE 2
     40 #define VCMD_RESOURCE_UNREF 3
     41 
     42 #define VCMD_TRANSFER_GET 4
     43 #define VCMD_TRANSFER_PUT 5
     44 
     45 #define VCMD_SUBMIT_CMD 6
     46 
     47 #define VCMD_RESOURCE_BUSY_WAIT 7
     48 
     49 /* pass the process cmd line for debugging */
     50 #define VCMD_CREATE_RENDERER 8
     51 
     52 #define VCMD_GET_CAPS2 9
     53 /* get caps */
     54 /* 0 length cmd */
     55 /* resp VCMD_GET_CAPS + caps */
     56 
     57 #define VCMD_RES_CREATE_SIZE 10
     58 #define VCMD_RES_CREATE_RES_HANDLE 0
     59 #define VCMD_RES_CREATE_TARGET 1
     60 #define VCMD_RES_CREATE_FORMAT 2
     61 #define VCMD_RES_CREATE_BIND 3
     62 #define VCMD_RES_CREATE_WIDTH 4
     63 #define VCMD_RES_CREATE_HEIGHT 5
     64 #define VCMD_RES_CREATE_DEPTH 6
     65 #define VCMD_RES_CREATE_ARRAY_SIZE 7
     66 #define VCMD_RES_CREATE_LAST_LEVEL 8
     67 #define VCMD_RES_CREATE_NR_SAMPLES 9
     68 
     69 #define VCMD_RES_UNREF_SIZE 1
     70 #define VCMD_RES_UNREF_RES_HANDLE 0
     71 
     72 #define VCMD_TRANSFER_HDR_SIZE 11
     73 #define VCMD_TRANSFER_RES_HANDLE 0
     74 #define VCMD_TRANSFER_LEVEL 1
     75 #define VCMD_TRANSFER_STRIDE 2
     76 #define VCMD_TRANSFER_LAYER_STRIDE 3
     77 #define VCMD_TRANSFER_X 4
     78 #define VCMD_TRANSFER_Y 5
     79 #define VCMD_TRANSFER_Z 6
     80 #define VCMD_TRANSFER_WIDTH 7
     81 #define VCMD_TRANSFER_HEIGHT 8
     82 #define VCMD_TRANSFER_DEPTH 9
     83 #define VCMD_TRANSFER_DATA_SIZE 10
     84 
     85 #define VCMD_BUSY_WAIT_FLAG_WAIT 1
     86 
     87 #define VCMD_BUSY_WAIT_SIZE 2
     88 #define VCMD_BUSY_WAIT_HANDLE 0
     89 #define VCMD_BUSY_WAIT_FLAGS 1
     90 
     91 #endif
     92