aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'include/drm/qxl_drm.h')
-rw-r--r--include/drm/qxl_drm.h82
1 files changed, 45 insertions, 37 deletions
diff --git a/include/drm/qxl_drm.h b/include/drm/qxl_drm.h
index 1e331a86..38a0dbdf 100644
--- a/include/drm/qxl_drm.h
+++ b/include/drm/qxl_drm.h
@@ -27,10 +27,14 @@
27#include <stddef.h> 27#include <stddef.h>
28#include "drm.h" 28#include "drm.h"
29 29
30#if defined(__cplusplus)
31extern "C" {
32#endif
33
30/* Please note that modifications to all structs defined here are 34/* Please note that modifications to all structs defined here are
31 * subject to backwards-compatibility constraints. 35 * subject to backwards-compatibility constraints.
32 * 36 *
33 * Do not use pointers, use uint64_t instead for 32 bit / 64 bit user/kernel 37 * Do not use pointers, use __u64 instead for 32 bit / 64 bit user/kernel
34 * compatibility Keep fields aligned to their size 38 * compatibility Keep fields aligned to their size
35 */ 39 */
36 40
@@ -48,14 +52,14 @@
48#define DRM_QXL_ALLOC_SURF 0x06 52#define DRM_QXL_ALLOC_SURF 0x06
49 53
50struct drm_qxl_alloc { 54struct drm_qxl_alloc {
51 uint32_t size; 55 __u32 size;
52 uint32_t handle; /* 0 is an invalid handle */ 56 __u32 handle; /* 0 is an invalid handle */
53}; 57};
54 58
55struct drm_qxl_map { 59struct drm_qxl_map {
56 uint64_t offset; /* use for mmap system call */ 60 __u64 offset; /* use for mmap system call */
57 uint32_t handle; 61 __u32 handle;
58 uint32_t pad; 62 __u32 pad;
59}; 63};
60 64
61/* 65/*
@@ -68,59 +72,59 @@ struct drm_qxl_map {
68#define QXL_RELOC_TYPE_SURF 2 72#define QXL_RELOC_TYPE_SURF 2
69 73
70struct drm_qxl_reloc { 74struct drm_qxl_reloc {
71 uint64_t src_offset; /* offset into src_handle or src buffer */ 75 __u64 src_offset; /* offset into src_handle or src buffer */
72 uint64_t dst_offset; /* offset in dest handle */ 76 __u64 dst_offset; /* offset in dest handle */
73 uint32_t src_handle; /* dest handle to compute address from */ 77 __u32 src_handle; /* dest handle to compute address from */
74 uint32_t dst_handle; /* 0 if to command buffer */ 78 __u32 dst_handle; /* 0 if to command buffer */
75 uint32_t reloc_type; 79 __u32 reloc_type;
76 uint32_t pad; 80 __u32 pad;
77}; 81};
78 82
79struct drm_qxl_command { 83struct drm_qxl_command {
80 uint64_t command; /* void* */ 84 __u64 command; /* void* */
81 uint64_t relocs; /* struct drm_qxl_reloc* */ 85 __u64 relocs; /* struct drm_qxl_reloc* */
82 uint32_t type; 86 __u32 type;
83 uint32_t command_size; 87 __u32 command_size;
84 uint32_t relocs_num; 88 __u32 relocs_num;
85 uint32_t pad; 89 __u32 pad;
86}; 90};
87 91
88/* XXX: call it drm_qxl_commands? */ 92/* XXX: call it drm_qxl_commands? */
89struct drm_qxl_execbuffer { 93struct drm_qxl_execbuffer {
90 uint32_t flags; /* for future use */ 94 __u32 flags; /* for future use */
91 uint32_t commands_num; 95 __u32 commands_num;
92 uint64_t commands; /* struct drm_qxl_command* */ 96 __u64 commands; /* struct drm_qxl_command* */
93}; 97};
94 98
95struct drm_qxl_update_area { 99struct drm_qxl_update_area {
96 uint32_t handle; 100 __u32 handle;
97 uint32_t top; 101 __u32 top;
98 uint32_t left; 102 __u32 left;
99 uint32_t bottom; 103 __u32 bottom;
100 uint32_t right; 104 __u32 right;
101 uint32_t pad; 105 __u32 pad;
102}; 106};
103 107
104#define QXL_PARAM_NUM_SURFACES 1 /* rom->n_surfaces */ 108#define QXL_PARAM_NUM_SURFACES 1 /* rom->n_surfaces */
105#define QXL_PARAM_MAX_RELOCS 2 109#define QXL_PARAM_MAX_RELOCS 2
106struct drm_qxl_getparam { 110struct drm_qxl_getparam {
107 uint64_t param; 111 __u64 param;
108 uint64_t value; 112 __u64 value;
109}; 113};
110 114
111/* these are one bit values */ 115/* these are one bit values */
112struct drm_qxl_clientcap { 116struct drm_qxl_clientcap {
113 uint32_t index; 117 __u32 index;
114 uint32_t pad; 118 __u32 pad;
115}; 119};
116 120
117struct drm_qxl_alloc_surf { 121struct drm_qxl_alloc_surf {
118 uint32_t format; 122 __u32 format;
119 uint32_t width; 123 __u32 width;
120 uint32_t height; 124 __u32 height;
121 int32_t stride; 125 __s32 stride;
122 uint32_t handle; 126 __u32 handle;
123 uint32_t pad; 127 __u32 pad;
124}; 128};
125 129
126#define DRM_IOCTL_QXL_ALLOC \ 130#define DRM_IOCTL_QXL_ALLOC \
@@ -149,4 +153,8 @@ struct drm_qxl_alloc_surf {
149 DRM_IOWR(DRM_COMMAND_BASE + DRM_QXL_ALLOC_SURF,\ 153 DRM_IOWR(DRM_COMMAND_BASE + DRM_QXL_ALLOC_SURF,\
150 struct drm_qxl_alloc_surf) 154 struct drm_qxl_alloc_surf)
151 155
156#if defined(__cplusplus)
157}
158#endif
159
152#endif 160#endif