blob: 6b7fb0b61da46915ea8b3b6796082e35310a0c19 [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 Ferris106b3a82016-08-24 12:15:38 -070023#endif
Christopher Ferris05d08e92016-02-04 13:16:38 -080024#define DRM_VIRTGPU_MAP 0x01
25#define DRM_VIRTGPU_EXECBUFFER 0x02
26#define DRM_VIRTGPU_GETPARAM 0x03
Christopher Ferris106b3a82016-08-24 12:15:38 -070027#define DRM_VIRTGPU_RESOURCE_CREATE 0x04
Christopher Ferris05d08e92016-02-04 13:16:38 -080028#define DRM_VIRTGPU_RESOURCE_INFO 0x05
29#define DRM_VIRTGPU_TRANSFER_FROM_HOST 0x06
30#define DRM_VIRTGPU_TRANSFER_TO_HOST 0x07
Christopher Ferris106b3a82016-08-24 12:15:38 -070031#define DRM_VIRTGPU_WAIT 0x08
Christopher Ferris05d08e92016-02-04 13:16:38 -080032#define DRM_VIRTGPU_GET_CAPS 0x09
33struct drm_virtgpu_map {
Christopher Ferris106b3a82016-08-24 12:15:38 -070034 __u64 offset;
Christopher Ferris106b3a82016-08-24 12:15:38 -070035 __u32 handle;
36 __u32 pad;
Christopher Ferris05d08e92016-02-04 13:16:38 -080037};
38struct drm_virtgpu_execbuffer {
Christopher Ferris106b3a82016-08-24 12:15:38 -070039 __u32 flags;
40 __u32 size;
41 __u64 command;
42 __u64 bo_handles;
Christopher Ferris106b3a82016-08-24 12:15:38 -070043 __u32 num_bo_handles;
44 __u32 pad;
Christopher Ferris05d08e92016-02-04 13:16:38 -080045};
46#define VIRTGPU_PARAM_3D_FEATURES 1
Christopher Ferris76a1d452018-06-27 14:12:29 -070047#define VIRTGPU_PARAM_CAPSET_QUERY_FIX 2
Christopher Ferris05d08e92016-02-04 13:16:38 -080048struct drm_virtgpu_getparam {
Christopher Ferris106b3a82016-08-24 12:15:38 -070049 __u64 param;
50 __u64 value;
Christopher Ferris05d08e92016-02-04 13:16:38 -080051};
52struct drm_virtgpu_resource_create {
Christopher Ferris106b3a82016-08-24 12:15:38 -070053 __u32 target;
54 __u32 format;
55 __u32 bind;
Christopher Ferris106b3a82016-08-24 12:15:38 -070056 __u32 width;
57 __u32 height;
58 __u32 depth;
59 __u32 array_size;
Christopher Ferris106b3a82016-08-24 12:15:38 -070060 __u32 last_level;
61 __u32 nr_samples;
62 __u32 flags;
63 __u32 bo_handle;
Christopher Ferris106b3a82016-08-24 12:15:38 -070064 __u32 res_handle;
65 __u32 size;
66 __u32 stride;
Christopher Ferris05d08e92016-02-04 13:16:38 -080067};
68struct drm_virtgpu_resource_info {
Christopher Ferris106b3a82016-08-24 12:15:38 -070069 __u32 bo_handle;
70 __u32 res_handle;
71 __u32 size;
Christopher Ferris106b3a82016-08-24 12:15:38 -070072 __u32 stride;
Christopher Ferris05d08e92016-02-04 13:16:38 -080073};
74struct drm_virtgpu_3d_box {
Christopher Ferris106b3a82016-08-24 12:15:38 -070075 __u32 x;
Christopher Ferris106b3a82016-08-24 12:15:38 -070076 __u32 y;
77 __u32 z;
78 __u32 w;
79 __u32 h;
Christopher Ferris106b3a82016-08-24 12:15:38 -070080 __u32 d;
Christopher Ferris05d08e92016-02-04 13:16:38 -080081};
82struct drm_virtgpu_3d_transfer_to_host {
Christopher Ferris106b3a82016-08-24 12:15:38 -070083 __u32 bo_handle;
Christopher Ferris106b3a82016-08-24 12:15:38 -070084 struct drm_virtgpu_3d_box box;
85 __u32 level;
86 __u32 offset;
Christopher Ferris05d08e92016-02-04 13:16:38 -080087};
88struct drm_virtgpu_3d_transfer_from_host {
Christopher Ferris106b3a82016-08-24 12:15:38 -070089 __u32 bo_handle;
Christopher Ferris05d08e92016-02-04 13:16:38 -080090 struct drm_virtgpu_3d_box box;
Christopher Ferris106b3a82016-08-24 12:15:38 -070091 __u32 level;
Christopher Ferris106b3a82016-08-24 12:15:38 -070092 __u32 offset;
Christopher Ferris05d08e92016-02-04 13:16:38 -080093};
94#define VIRTGPU_WAIT_NOWAIT 1
95struct drm_virtgpu_3d_wait {
Christopher Ferris106b3a82016-08-24 12:15:38 -070096 __u32 handle;
97 __u32 flags;
Christopher Ferris05d08e92016-02-04 13:16:38 -080098};
99struct drm_virtgpu_get_caps {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700100 __u32 cap_set_id;
101 __u32 cap_set_ver;
102 __u64 addr;
103 __u32 size;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700104 __u32 pad;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800105};
106#define DRM_IOCTL_VIRTGPU_MAP DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_MAP, struct drm_virtgpu_map)
107#define DRM_IOCTL_VIRTGPU_EXECBUFFER DRM_IOW(DRM_COMMAND_BASE + DRM_VIRTGPU_EXECBUFFER, struct drm_virtgpu_execbuffer)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700108#define DRM_IOCTL_VIRTGPU_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_GETPARAM, struct drm_virtgpu_getparam)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800109#define DRM_IOCTL_VIRTGPU_RESOURCE_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_RESOURCE_CREATE, struct drm_virtgpu_resource_create)
110#define DRM_IOCTL_VIRTGPU_RESOURCE_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_RESOURCE_INFO, struct drm_virtgpu_resource_info)
111#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 -0700112#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 -0800113#define DRM_IOCTL_VIRTGPU_WAIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_WAIT, struct drm_virtgpu_3d_wait)
114#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 -0700115#ifdef __cplusplus
Christopher Ferris106b3a82016-08-24 12:15:38 -0700116#endif
Christopher Ferris05d08e92016-02-04 13:16:38 -0800117#endif