122851890Sopenharmony_ci/*
222851890Sopenharmony_ci * This header was generated from the Linux kernel headers by update_headers.py,
322851890Sopenharmony_ci * to provide necessary information from kernel to userspace, such as constants,
422851890Sopenharmony_ci * structures, and macros, and thus, contains no copyrightable information.
522851890Sopenharmony_ci */
622851890Sopenharmony_ci#ifndef VIRTGPU_DRM_H
722851890Sopenharmony_ci#define VIRTGPU_DRM_H
822851890Sopenharmony_ci#include "drm.h"
922851890Sopenharmony_ci#if defined(__cplusplus)
1022851890Sopenharmony_ciextern "C" {
1122851890Sopenharmony_ci#endif
1222851890Sopenharmony_ci#define DRM_VIRTGPU_MAP         0x01
1322851890Sopenharmony_ci#define DRM_VIRTGPU_EXECBUFFER  0x02
1422851890Sopenharmony_ci#define DRM_VIRTGPU_GETPARAM    0x03
1522851890Sopenharmony_ci#define DRM_VIRTGPU_RESOURCE_CREATE 0x04
1622851890Sopenharmony_ci#define DRM_VIRTGPU_RESOURCE_INFO     0x05
1722851890Sopenharmony_ci#define DRM_VIRTGPU_TRANSFER_FROM_HOST 0x06
1822851890Sopenharmony_ci#define DRM_VIRTGPU_TRANSFER_TO_HOST 0x07
1922851890Sopenharmony_ci#define DRM_VIRTGPU_WAIT     0x08
2022851890Sopenharmony_ci#define DRM_VIRTGPU_GET_CAPS  0x09
2122851890Sopenharmony_cistruct drm_virtgpu_map {
2222851890Sopenharmony_ci	__u64 offset;
2322851890Sopenharmony_ci	__u32 handle;
2422851890Sopenharmony_ci	__u32 pad;
2522851890Sopenharmony_ci};
2622851890Sopenharmony_cistruct drm_virtgpu_execbuffer {
2722851890Sopenharmony_ci	__u32		flags;
2822851890Sopenharmony_ci	__u32 size;
2922851890Sopenharmony_ci	__u64 command;
3022851890Sopenharmony_ci	__u64 bo_handles;
3122851890Sopenharmony_ci	__u32 num_bo_handles;
3222851890Sopenharmony_ci	__u32 pad;
3322851890Sopenharmony_ci};
3422851890Sopenharmony_ci#define VIRTGPU_PARAM_3D_FEATURES 1
3522851890Sopenharmony_ci#define VIRTGPU_PARAM_CAPSET_QUERY_FIX 2
3622851890Sopenharmony_cistruct drm_virtgpu_getparam {
3722851890Sopenharmony_ci	__u64 param;
3822851890Sopenharmony_ci	__u64 value;
3922851890Sopenharmony_ci};
4022851890Sopenharmony_cistruct drm_virtgpu_resource_create {
4122851890Sopenharmony_ci	__u32 target;
4222851890Sopenharmony_ci	__u32 format;
4322851890Sopenharmony_ci	__u32 bind;
4422851890Sopenharmony_ci	__u32 width;
4522851890Sopenharmony_ci	__u32 height;
4622851890Sopenharmony_ci	__u32 depth;
4722851890Sopenharmony_ci	__u32 array_size;
4822851890Sopenharmony_ci	__u32 last_level;
4922851890Sopenharmony_ci	__u32 nr_samples;
5022851890Sopenharmony_ci	__u32 flags;
5122851890Sopenharmony_ci	__u32 bo_handle;
5222851890Sopenharmony_ci	__u32 res_handle;
5322851890Sopenharmony_ci	__u32 size;
5422851890Sopenharmony_ci	__u32 stride;
5522851890Sopenharmony_ci};
5622851890Sopenharmony_cistruct drm_virtgpu_resource_info {
5722851890Sopenharmony_ci	__u32 bo_handle;
5822851890Sopenharmony_ci	__u32 res_handle;
5922851890Sopenharmony_ci	__u32 size;
6022851890Sopenharmony_ci	__u32 stride;
6122851890Sopenharmony_ci};
6222851890Sopenharmony_cistruct drm_virtgpu_3d_box {
6322851890Sopenharmony_ci	__u32 x;
6422851890Sopenharmony_ci	__u32 y;
6522851890Sopenharmony_ci	__u32 z;
6622851890Sopenharmony_ci	__u32 w;
6722851890Sopenharmony_ci	__u32 h;
6822851890Sopenharmony_ci	__u32 d;
6922851890Sopenharmony_ci};
7022851890Sopenharmony_cistruct drm_virtgpu_3d_transfer_to_host {
7122851890Sopenharmony_ci	__u32 bo_handle;
7222851890Sopenharmony_ci	struct drm_virtgpu_3d_box box;
7322851890Sopenharmony_ci	__u32 level;
7422851890Sopenharmony_ci	__u32 offset;
7522851890Sopenharmony_ci};
7622851890Sopenharmony_cistruct drm_virtgpu_3d_transfer_from_host {
7722851890Sopenharmony_ci	__u32 bo_handle;
7822851890Sopenharmony_ci	struct drm_virtgpu_3d_box box;
7922851890Sopenharmony_ci	__u32 level;
8022851890Sopenharmony_ci	__u32 offset;
8122851890Sopenharmony_ci};
8222851890Sopenharmony_ci#define VIRTGPU_WAIT_NOWAIT 1
8322851890Sopenharmony_cistruct drm_virtgpu_3d_wait {
8422851890Sopenharmony_ci	__u32 handle;
8522851890Sopenharmony_ci	__u32 flags;
8622851890Sopenharmony_ci};
8722851890Sopenharmony_cistruct drm_virtgpu_get_caps {
8822851890Sopenharmony_ci	__u32 cap_set_id;
8922851890Sopenharmony_ci	__u32 cap_set_ver;
9022851890Sopenharmony_ci	__u64 addr;
9122851890Sopenharmony_ci	__u32 size;
9222851890Sopenharmony_ci	__u32 pad;
9322851890Sopenharmony_ci};
9422851890Sopenharmony_ci#define DRM_IOCTL_VIRTGPU_MAP \
9522851890Sopenharmony_ci	DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_MAP, struct drm_virtgpu_map)
9622851890Sopenharmony_ci#define DRM_IOCTL_VIRTGPU_EXECBUFFER \
9722851890Sopenharmony_ci	DRM_IOW(DRM_COMMAND_BASE + DRM_VIRTGPU_EXECBUFFER,\
9822851890Sopenharmony_ci		struct drm_virtgpu_execbuffer)
9922851890Sopenharmony_ci#define DRM_IOCTL_VIRTGPU_GETPARAM \
10022851890Sopenharmony_ci	DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_GETPARAM,\
10122851890Sopenharmony_ci		struct drm_virtgpu_getparam)
10222851890Sopenharmony_ci#define DRM_IOCTL_VIRTGPU_RESOURCE_CREATE			\
10322851890Sopenharmony_ci	DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_RESOURCE_CREATE,	\
10422851890Sopenharmony_ci		struct drm_virtgpu_resource_create)
10522851890Sopenharmony_ci#define DRM_IOCTL_VIRTGPU_RESOURCE_INFO \
10622851890Sopenharmony_ci	DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_RESOURCE_INFO, \
10722851890Sopenharmony_ci		 struct drm_virtgpu_resource_info)
10822851890Sopenharmony_ci#define DRM_IOCTL_VIRTGPU_TRANSFER_FROM_HOST \
10922851890Sopenharmony_ci	DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_TRANSFER_FROM_HOST,	\
11022851890Sopenharmony_ci		struct drm_virtgpu_3d_transfer_from_host)
11122851890Sopenharmony_ci#define DRM_IOCTL_VIRTGPU_TRANSFER_TO_HOST \
11222851890Sopenharmony_ci	DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_TRANSFER_TO_HOST,	\
11322851890Sopenharmony_ci		struct drm_virtgpu_3d_transfer_to_host)
11422851890Sopenharmony_ci#define DRM_IOCTL_VIRTGPU_WAIT				\
11522851890Sopenharmony_ci	DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_WAIT,	\
11622851890Sopenharmony_ci		struct drm_virtgpu_3d_wait)
11722851890Sopenharmony_ci#define DRM_IOCTL_VIRTGPU_GET_CAPS \
11822851890Sopenharmony_ci	DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_GET_CAPS, \
11922851890Sopenharmony_ci	struct drm_virtgpu_get_caps)
12022851890Sopenharmony_ci#if defined(__cplusplus)
12122851890Sopenharmony_ci}
12222851890Sopenharmony_ci#endif
12322851890Sopenharmony_ci#endif
124