/* * Virtio GPU Device * * Copyright Red Hat, Inc. 2013-2014 * * Authors: * Dave Airlie <[email protected]> * Gerd Hoffmann <[email protected]> * * This header is BSD licensed so anyone can use the definitions * to implement compatible drivers/servers: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of IBM nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL IBM OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef VIRTIO_GPU_HW_H #define VIRTIO_GPU_HW_H #include <linux/types.h> /* * VIRTIO_GPU_CMD_CTX_* * VIRTIO_GPU_CMD_*_3D */ #define VIRTIO_GPU_F_VIRGL … /* * VIRTIO_GPU_CMD_GET_EDID */ #define VIRTIO_GPU_F_EDID … /* * VIRTIO_GPU_CMD_RESOURCE_ASSIGN_UUID */ #define VIRTIO_GPU_F_RESOURCE_UUID … /* * VIRTIO_GPU_CMD_RESOURCE_CREATE_BLOB */ #define VIRTIO_GPU_F_RESOURCE_BLOB … /* * VIRTIO_GPU_CMD_CREATE_CONTEXT with * context_init and multiple timelines */ #define VIRTIO_GPU_F_CONTEXT_INIT … enum virtio_gpu_ctrl_type { … }; enum virtio_gpu_shm_id { … }; #define VIRTIO_GPU_FLAG_FENCE … /* * If the following flag is set, then ring_idx contains the index * of the command ring that needs to used when creating the fence */ #define VIRTIO_GPU_FLAG_INFO_RING_IDX … struct virtio_gpu_ctrl_hdr { … }; /* data passed in the cursor vq */ struct virtio_gpu_cursor_pos { … }; /* VIRTIO_GPU_CMD_UPDATE_CURSOR, VIRTIO_GPU_CMD_MOVE_CURSOR */ struct virtio_gpu_update_cursor { … }; /* data passed in the control vq, 2d related */ struct virtio_gpu_rect { … }; /* VIRTIO_GPU_CMD_RESOURCE_UNREF */ struct virtio_gpu_resource_unref { … }; /* VIRTIO_GPU_CMD_RESOURCE_CREATE_2D: create a 2d resource with a format */ struct virtio_gpu_resource_create_2d { … }; /* VIRTIO_GPU_CMD_SET_SCANOUT */ struct virtio_gpu_set_scanout { … }; /* VIRTIO_GPU_CMD_RESOURCE_FLUSH */ struct virtio_gpu_resource_flush { … }; /* VIRTIO_GPU_CMD_TRANSFER_TO_HOST_2D: simple transfer to_host */ struct virtio_gpu_transfer_to_host_2d { … }; struct virtio_gpu_mem_entry { … }; /* VIRTIO_GPU_CMD_RESOURCE_ATTACH_BACKING */ struct virtio_gpu_resource_attach_backing { … }; /* VIRTIO_GPU_CMD_RESOURCE_DETACH_BACKING */ struct virtio_gpu_resource_detach_backing { … }; /* VIRTIO_GPU_RESP_OK_DISPLAY_INFO */ #define VIRTIO_GPU_MAX_SCANOUTS … struct virtio_gpu_resp_display_info { … }; /* data passed in the control vq, 3d related */ struct virtio_gpu_box { … }; /* VIRTIO_GPU_CMD_TRANSFER_TO_HOST_3D, VIRTIO_GPU_CMD_TRANSFER_FROM_HOST_3D */ struct virtio_gpu_transfer_host_3d { … }; /* VIRTIO_GPU_CMD_RESOURCE_CREATE_3D */ #define VIRTIO_GPU_RESOURCE_FLAG_Y_0_TOP … struct virtio_gpu_resource_create_3d { … }; /* VIRTIO_GPU_CMD_CTX_CREATE */ #define VIRTIO_GPU_CONTEXT_INIT_CAPSET_ID_MASK … struct virtio_gpu_ctx_create { … }; /* VIRTIO_GPU_CMD_CTX_DESTROY */ struct virtio_gpu_ctx_destroy { … }; /* VIRTIO_GPU_CMD_CTX_ATTACH_RESOURCE, VIRTIO_GPU_CMD_CTX_DETACH_RESOURCE */ struct virtio_gpu_ctx_resource { … }; /* VIRTIO_GPU_CMD_SUBMIT_3D */ struct virtio_gpu_cmd_submit { … }; #define VIRTIO_GPU_CAPSET_VIRGL … #define VIRTIO_GPU_CAPSET_VIRGL2 … /* 3 is reserved for gfxstream */ #define VIRTIO_GPU_CAPSET_VENUS … /* VIRTIO_GPU_CMD_GET_CAPSET_INFO */ struct virtio_gpu_get_capset_info { … }; /* VIRTIO_GPU_RESP_OK_CAPSET_INFO */ struct virtio_gpu_resp_capset_info { … }; /* VIRTIO_GPU_CMD_GET_CAPSET */ struct virtio_gpu_get_capset { … }; /* VIRTIO_GPU_RESP_OK_CAPSET */ struct virtio_gpu_resp_capset { … }; /* VIRTIO_GPU_CMD_GET_EDID */ struct virtio_gpu_cmd_get_edid { … }; /* VIRTIO_GPU_RESP_OK_EDID */ struct virtio_gpu_resp_edid { … }; #define VIRTIO_GPU_EVENT_DISPLAY … struct virtio_gpu_config { … }; /* simple formats for fbcon/X use */ enum virtio_gpu_formats { … }; /* VIRTIO_GPU_CMD_RESOURCE_ASSIGN_UUID */ struct virtio_gpu_resource_assign_uuid { … }; /* VIRTIO_GPU_RESP_OK_RESOURCE_UUID */ struct virtio_gpu_resp_resource_uuid { … }; /* VIRTIO_GPU_CMD_RESOURCE_CREATE_BLOB */ struct virtio_gpu_resource_create_blob { … }; /* VIRTIO_GPU_CMD_SET_SCANOUT_BLOB */ struct virtio_gpu_set_scanout_blob { … }; /* VIRTIO_GPU_CMD_RESOURCE_MAP_BLOB */ struct virtio_gpu_resource_map_blob { … }; /* VIRTIO_GPU_RESP_OK_MAP_INFO */ #define VIRTIO_GPU_MAP_CACHE_MASK … #define VIRTIO_GPU_MAP_CACHE_NONE … #define VIRTIO_GPU_MAP_CACHE_CACHED … #define VIRTIO_GPU_MAP_CACHE_UNCACHED … #define VIRTIO_GPU_MAP_CACHE_WC … struct virtio_gpu_resp_map_info { … }; /* VIRTIO_GPU_CMD_RESOURCE_UNMAP_BLOB */ struct virtio_gpu_resource_unmap_blob { … }; #endif