File indexing completed on 2025-01-18 10:01:51
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 #ifndef VIRTGPU_DRM_H
0025 #define VIRTGPU_DRM_H
0026
0027 #include "drm.h"
0028
0029 #if defined(__cplusplus)
0030 extern "C" {
0031 #endif
0032
0033
0034
0035
0036
0037
0038
0039
0040 #define DRM_VIRTGPU_MAP 0x01
0041 #define DRM_VIRTGPU_EXECBUFFER 0x02
0042 #define DRM_VIRTGPU_GETPARAM 0x03
0043 #define DRM_VIRTGPU_RESOURCE_CREATE 0x04
0044 #define DRM_VIRTGPU_RESOURCE_INFO 0x05
0045 #define DRM_VIRTGPU_TRANSFER_FROM_HOST 0x06
0046 #define DRM_VIRTGPU_TRANSFER_TO_HOST 0x07
0047 #define DRM_VIRTGPU_WAIT 0x08
0048 #define DRM_VIRTGPU_GET_CAPS 0x09
0049
0050 #define VIRTGPU_EXECBUF_FENCE_FD_IN 0x01
0051 #define VIRTGPU_EXECBUF_FENCE_FD_OUT 0x02
0052 #define VIRTGPU_EXECBUF_FLAGS (\
0053 VIRTGPU_EXECBUF_FENCE_FD_IN |\
0054 VIRTGPU_EXECBUF_FENCE_FD_OUT |\
0055 0)
0056
0057 struct drm_virtgpu_map {
0058 __u64 offset;
0059 __u32 handle;
0060 __u32 pad;
0061 };
0062
0063 struct drm_virtgpu_execbuffer {
0064 __u32 flags;
0065 __u32 size;
0066 __u64 command;
0067 __u64 bo_handles;
0068 __u32 num_bo_handles;
0069 __s32 fence_fd;
0070 };
0071
0072 #define VIRTGPU_PARAM_3D_FEATURES 1
0073 #define VIRTGPU_PARAM_CAPSET_QUERY_FIX 2
0074
0075 struct drm_virtgpu_getparam {
0076 __u64 param;
0077 __u64 value;
0078 };
0079
0080
0081
0082 struct drm_virtgpu_resource_create {
0083 __u32 target;
0084 __u32 format;
0085 __u32 bind;
0086 __u32 width;
0087 __u32 height;
0088 __u32 depth;
0089 __u32 array_size;
0090 __u32 last_level;
0091 __u32 nr_samples;
0092 __u32 flags;
0093 __u32 bo_handle;
0094 __u32 res_handle;
0095 __u32 size;
0096 __u32 stride;
0097 };
0098
0099 struct drm_virtgpu_resource_info {
0100 __u32 bo_handle;
0101 __u32 res_handle;
0102 __u32 size;
0103 __u32 stride;
0104 };
0105
0106 struct drm_virtgpu_3d_box {
0107 __u32 x;
0108 __u32 y;
0109 __u32 z;
0110 __u32 w;
0111 __u32 h;
0112 __u32 d;
0113 };
0114
0115 struct drm_virtgpu_3d_transfer_to_host {
0116 __u32 bo_handle;
0117 struct drm_virtgpu_3d_box box;
0118 __u32 level;
0119 __u32 offset;
0120 };
0121
0122 struct drm_virtgpu_3d_transfer_from_host {
0123 __u32 bo_handle;
0124 struct drm_virtgpu_3d_box box;
0125 __u32 level;
0126 __u32 offset;
0127 };
0128
0129 #define VIRTGPU_WAIT_NOWAIT 1
0130 struct drm_virtgpu_3d_wait {
0131 __u32 handle;
0132 __u32 flags;
0133 };
0134
0135 struct drm_virtgpu_get_caps {
0136 __u32 cap_set_id;
0137 __u32 cap_set_ver;
0138 __u64 addr;
0139 __u32 size;
0140 __u32 pad;
0141 };
0142
0143 #define DRM_IOCTL_VIRTGPU_MAP \
0144 DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_MAP, struct drm_virtgpu_map)
0145
0146 #define DRM_IOCTL_VIRTGPU_EXECBUFFER \
0147 DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_EXECBUFFER,\
0148 struct drm_virtgpu_execbuffer)
0149
0150 #define DRM_IOCTL_VIRTGPU_GETPARAM \
0151 DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_GETPARAM,\
0152 struct drm_virtgpu_getparam)
0153
0154 #define DRM_IOCTL_VIRTGPU_RESOURCE_CREATE \
0155 DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_RESOURCE_CREATE, \
0156 struct drm_virtgpu_resource_create)
0157
0158 #define DRM_IOCTL_VIRTGPU_RESOURCE_INFO \
0159 DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_RESOURCE_INFO, \
0160 struct drm_virtgpu_resource_info)
0161
0162 #define DRM_IOCTL_VIRTGPU_TRANSFER_FROM_HOST \
0163 DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_TRANSFER_FROM_HOST, \
0164 struct drm_virtgpu_3d_transfer_from_host)
0165
0166 #define DRM_IOCTL_VIRTGPU_TRANSFER_TO_HOST \
0167 DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_TRANSFER_TO_HOST, \
0168 struct drm_virtgpu_3d_transfer_to_host)
0169
0170 #define DRM_IOCTL_VIRTGPU_WAIT \
0171 DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_WAIT, \
0172 struct drm_virtgpu_3d_wait)
0173
0174 #define DRM_IOCTL_VIRTGPU_GET_CAPS \
0175 DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_GET_CAPS, \
0176 struct drm_virtgpu_get_caps)
0177
0178 #if defined(__cplusplus)
0179 }
0180 #endif
0181
0182 #endif