blob: 84986e4332091a50f366818ebf276e05625d68ed [file] [log] [blame]
Christopher Ferris05d08e92016-02-04 13:16:38 -08001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef VIRTGPU_DRM_H
20#define VIRTGPU_DRM_H
Christopher Ferris106b3a82016-08-24 12:15:38 -070021#include "drm.h"
22#ifdef __cplusplus
Christopher Ferris48fe0ae2019-01-10 15:59:33 -080023extern "C" {
Christopher Ferris106b3a82016-08-24 12:15:38 -070024#endif
Christopher Ferris05d08e92016-02-04 13:16:38 -080025#define DRM_VIRTGPU_MAP 0x01
26#define DRM_VIRTGPU_EXECBUFFER 0x02
27#define DRM_VIRTGPU_GETPARAM 0x03
Christopher Ferris106b3a82016-08-24 12:15:38 -070028#define DRM_VIRTGPU_RESOURCE_CREATE 0x04
Christopher Ferris05d08e92016-02-04 13:16:38 -080029#define DRM_VIRTGPU_RESOURCE_INFO 0x05
30#define DRM_VIRTGPU_TRANSFER_FROM_HOST 0x06
31#define DRM_VIRTGPU_TRANSFER_TO_HOST 0x07
Christopher Ferris106b3a82016-08-24 12:15:38 -070032#define DRM_VIRTGPU_WAIT 0x08
Christopher Ferris05d08e92016-02-04 13:16:38 -080033#define DRM_VIRTGPU_GET_CAPS 0x09
34struct drm_virtgpu_map {
Christopher Ferris106b3a82016-08-24 12:15:38 -070035 __u64 offset;
Christopher Ferris106b3a82016-08-24 12:15:38 -070036 __u32 handle;
37 __u32 pad;
Christopher Ferris05d08e92016-02-04 13:16:38 -080038};
39struct drm_virtgpu_execbuffer {
Christopher Ferris106b3a82016-08-24 12:15:38 -070040 __u32 flags;
41 __u32 size;
42 __u64 command;
43 __u64 bo_handles;
Christopher Ferris106b3a82016-08-24 12:15:38 -070044 __u32 num_bo_handles;
45 __u32 pad;
Christopher Ferris05d08e92016-02-04 13:16:38 -080046};
47#define VIRTGPU_PARAM_3D_FEATURES 1
Christopher Ferris76a1d452018-06-27 14:12:29 -070048#define VIRTGPU_PARAM_CAPSET_QUERY_FIX 2
Christopher Ferris05d08e92016-02-04 13:16:38 -080049struct drm_virtgpu_getparam {
Christopher Ferris106b3a82016-08-24 12:15:38 -070050 __u64 param;
51 __u64 value;
Christopher Ferris05d08e92016-02-04 13:16:38 -080052};
53struct drm_virtgpu_resource_create {
Christopher Ferris106b3a82016-08-24 12:15:38 -070054 __u32 target;
55 __u32 format;
56 __u32 bind;
Christopher Ferris106b3a82016-08-24 12:15:38 -070057 __u32 width;
58 __u32 height;
59 __u32 depth;
60 __u32 array_size;
Christopher Ferris106b3a82016-08-24 12:15:38 -070061 __u32 last_level;
62 __u32 nr_samples;
63 __u32 flags;
64 __u32 bo_handle;
Christopher Ferris106b3a82016-08-24 12:15:38 -070065 __u32 res_handle;
66 __u32 size;
67 __u32 stride;
Christopher Ferris05d08e92016-02-04 13:16:38 -080068};
69struct drm_virtgpu_resource_info {
Christopher Ferris106b3a82016-08-24 12:15:38 -070070 __u32 bo_handle;
71 __u32 res_handle;
72 __u32 size;
Christopher Ferris106b3a82016-08-24 12:15:38 -070073 __u32 stride;
Christopher Ferris05d08e92016-02-04 13:16:38 -080074};
75struct drm_virtgpu_3d_box {
Christopher Ferris106b3a82016-08-24 12:15:38 -070076 __u32 x;
Christopher Ferris106b3a82016-08-24 12:15:38 -070077 __u32 y;
78 __u32 z;
79 __u32 w;
80 __u32 h;
Christopher Ferris106b3a82016-08-24 12:15:38 -070081 __u32 d;
Christopher Ferris05d08e92016-02-04 13:16:38 -080082};
83struct drm_virtgpu_3d_transfer_to_host {
Christopher Ferris106b3a82016-08-24 12:15:38 -070084 __u32 bo_handle;
Christopher Ferris106b3a82016-08-24 12:15:38 -070085 struct drm_virtgpu_3d_box box;
86 __u32 level;
87 __u32 offset;
Christopher Ferris05d08e92016-02-04 13:16:38 -080088};
89struct drm_virtgpu_3d_transfer_from_host {
Christopher Ferris106b3a82016-08-24 12:15:38 -070090 __u32 bo_handle;
Christopher Ferris05d08e92016-02-04 13:16:38 -080091 struct drm_virtgpu_3d_box box;
Christopher Ferris106b3a82016-08-24 12:15:38 -070092 __u32 level;
Christopher Ferris106b3a82016-08-24 12:15:38 -070093 __u32 offset;
Christopher Ferris05d08e92016-02-04 13:16:38 -080094};
95#define VIRTGPU_WAIT_NOWAIT 1
96struct drm_virtgpu_3d_wait {
Christopher Ferris106b3a82016-08-24 12:15:38 -070097 __u32 handle;
98 __u32 flags;
Christopher Ferris05d08e92016-02-04 13:16:38 -080099};
100struct drm_virtgpu_get_caps {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700101 __u32 cap_set_id;
102 __u32 cap_set_ver;
103 __u64 addr;
104 __u32 size;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700105 __u32 pad;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800106};
107#define DRM_IOCTL_VIRTGPU_MAP DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_MAP, struct drm_virtgpu_map)
108#define DRM_IOCTL_VIRTGPU_EXECBUFFER DRM_IOW(DRM_COMMAND_BASE + DRM_VIRTGPU_EXECBUFFER, struct drm_virtgpu_execbuffer)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700109#define DRM_IOCTL_VIRTGPU_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_GETPARAM, struct drm_virtgpu_getparam)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800110#define DRM_IOCTL_VIRTGPU_RESOURCE_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_RESOURCE_CREATE, struct drm_virtgpu_resource_create)
111#define DRM_IOCTL_VIRTGPU_RESOURCE_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_RESOURCE_INFO, struct drm_virtgpu_resource_info)
112#define DRM_IOCTL_VIRTGPU_TRANSFER_FROM_HOST DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_TRANSFER_FROM_HOST, struct drm_virtgpu_3d_transfer_from_host)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700113#define DRM_IOCTL_VIRTGPU_TRANSFER_TO_HOST DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_TRANSFER_TO_HOST, struct drm_virtgpu_3d_transfer_to_host)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800114#define DRM_IOCTL_VIRTGPU_WAIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_WAIT, struct drm_virtgpu_3d_wait)
115#define DRM_IOCTL_VIRTGPU_GET_CAPS DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_GET_CAPS, struct drm_virtgpu_get_caps)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700116#ifdef __cplusplus
Christopher Ferris48fe0ae2019-01-10 15:59:33 -0800117}
Christopher Ferris106b3a82016-08-24 12:15:38 -0700118#endif
Christopher Ferris05d08e92016-02-04 13:16:38 -0800119#endif