1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 #ifndef QXL_DRM_H
25 #define QXL_DRM_H
26
27 #include "drm.h"
28
29 #if defined(__cplusplus)
30 extern "C" {
31 #endif
32
33
34
35
36
37
38
39
40 #define QXL_GEM_DOMAIN_CPU 0
41 #define QXL_GEM_DOMAIN_VRAM 1
42 #define QXL_GEM_DOMAIN_SURFACE 2
43
44 #define DRM_QXL_ALLOC 0x00
45 #define DRM_QXL_MAP 0x01
46 #define DRM_QXL_EXECBUFFER 0x02
47 #define DRM_QXL_UPDATE_AREA 0x03
48 #define DRM_QXL_GETPARAM 0x04
49 #define DRM_QXL_CLIENTCAP 0x05
50
51 #define DRM_QXL_ALLOC_SURF 0x06
52
53 struct drm_qxl_alloc {
54 __u32 size;
55 __u32 handle;
56 };
57
58 struct drm_qxl_map {
59 __u64 offset;
60 __u32 handle;
61 __u32 pad;
62 };
63
64
65
66
67
68
69
70 #define QXL_RELOC_TYPE_BO 1
71 #define QXL_RELOC_TYPE_SURF 2
72
73 struct drm_qxl_reloc {
74 __u64 src_offset;
75 __u64 dst_offset;
76 __u32 src_handle;
77 __u32 dst_handle;
78 __u32 reloc_type;
79 __u32 pad;
80 };
81
82 struct drm_qxl_command {
83 __u64 command;
84 __u64 relocs;
85 __u32 type;
86 __u32 command_size;
87 __u32 relocs_num;
88 __u32 pad;
89 };
90
91 struct drm_qxl_execbuffer {
92 __u32 flags;
93 __u32 commands_num;
94 __u64 commands;
95 };
96
97 struct drm_qxl_update_area {
98 __u32 handle;
99 __u32 top;
100 __u32 left;
101 __u32 bottom;
102 __u32 right;
103 __u32 pad;
104 };
105
106 #define QXL_PARAM_NUM_SURFACES 1
107 #define QXL_PARAM_MAX_RELOCS 2
108 struct drm_qxl_getparam {
109 __u64 param;
110 __u64 value;
111 };
112
113
114 struct drm_qxl_clientcap {
115 __u32 index;
116 __u32 pad;
117 };
118
119 struct drm_qxl_alloc_surf {
120 __u32 format;
121 __u32 width;
122 __u32 height;
123 __s32 stride;
124 __u32 handle;
125 __u32 pad;
126 };
127
128 #define DRM_IOCTL_QXL_ALLOC \
129 DRM_IOWR(DRM_COMMAND_BASE + DRM_QXL_ALLOC, struct drm_qxl_alloc)
130
131 #define DRM_IOCTL_QXL_MAP \
132 DRM_IOWR(DRM_COMMAND_BASE + DRM_QXL_MAP, struct drm_qxl_map)
133
134 #define DRM_IOCTL_QXL_EXECBUFFER \
135 DRM_IOW(DRM_COMMAND_BASE + DRM_QXL_EXECBUFFER,\
136 struct drm_qxl_execbuffer)
137
138 #define DRM_IOCTL_QXL_UPDATE_AREA \
139 DRM_IOW(DRM_COMMAND_BASE + DRM_QXL_UPDATE_AREA,\
140 struct drm_qxl_update_area)
141
142 #define DRM_IOCTL_QXL_GETPARAM \
143 DRM_IOWR(DRM_COMMAND_BASE + DRM_QXL_GETPARAM,\
144 struct drm_qxl_getparam)
145
146 #define DRM_IOCTL_QXL_CLIENTCAP \
147 DRM_IOW(DRM_COMMAND_BASE + DRM_QXL_CLIENTCAP,\
148 struct drm_qxl_clientcap)
149
150 #define DRM_IOCTL_QXL_ALLOC_SURF \
151 DRM_IOWR(DRM_COMMAND_BASE + DRM_QXL_ALLOC_SURF,\
152 struct drm_qxl_alloc_surf)
153
154 #if defined(__cplusplus)
155 }
156 #endif
157
158 #endif